diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | ULabel.c | 16 | ||||
-rw-r--r-- | ULabelP.h | 2 | ||||
-rw-r--r-- | xfontsel.c | 21 |
4 files changed, 21 insertions, 19 deletions
diff --git a/Makefile.am b/Makefile.am index f7ab434..e62fd49 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,7 @@ SUBDIRS = man bin_PROGRAMS = xfontsel +AM_CPPFLAGS = -D_CONST_X_STRING AM_CFLAGS = $(XFONTSEL_CFLAGS) $(CWARNFLAGS) xfontsel_LDADD = $(XFONTSEL_LIBS) @@ -177,9 +177,9 @@ static XChar2b *buf2b; static int buf2blen = 0; static void _XawLabelDrawUCS(Display *dpy, Drawable d, GC gc, - int x, int y, char *str, int n) + int x, int y, const char *str, int n) { - char *ep; + const char *ep; unsigned short codepoint; XChar2b *ptr; @@ -214,11 +214,11 @@ static void _XawLabelDrawUCS(Display *dpy, Drawable d, GC gc, static int _XawLabelWidthUCS( XFontStruct *fs, - char *str, + const char *str, int n ) { - char *ep; + const char *ep; unsigned short codepoint; XChar2b *ptr; @@ -287,7 +287,7 @@ static void SetTextWidthAndHeight(UCSLabelWidget lw) lw->label.label_width = 0; } else if ((nl = index(lw->label.label, '\n')) != NULL) { - char *label; + const char *label; lw->label.label_len = MULTI_LINE_LABEL; lw->label.label_width = 0; for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) { @@ -320,7 +320,7 @@ static void SetTextWidthAndHeight(UCSLabelWidget lw) lw->label.label_width = 0; } else if ((nl = index(lw->label.label, '\n')) != NULL) { - char *label; + const char *label; lw->label.label_len = MULTI_LINE_LABEL; lw->label.label_width = 0; for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) { @@ -520,7 +520,7 @@ static void Redisplay(Widget gw, XEvent *event, Region region) if (w->label.pixmap == None) { int len = w->label.label_len; - char *label = w->label.label; + const char *label = w->label.label; Position y = w->label.label_y + w->label.font->max_bounds.ascent; Position ksy = w->label.label_y; @@ -756,7 +756,7 @@ static void Destroy(Widget w) UCSLabelWidget lw = (UCSLabelWidget)w; if ( lw->label.label != lw->core.name ) - XtFree( lw->label.label ); + XtFree( (char *) lw->label.label ); XtReleaseGC( w, lw->label.normal_GC ); XtReleaseGC( w, lw->label.gray_GC); XmuReleaseStippledPixmap( XtScreen(w), lw->label.stipple ); @@ -82,7 +82,7 @@ typedef struct { Pixel foreground; XFontStruct *font; XFontSet fontset; - char *label; + String label; XtJustify justify; Dimension internal_width; Dimension internal_height; @@ -95,8 +95,8 @@ static struct _appRes { int app_defaults_version; Cursor cursor; String pattern; - String pixelSizeList; - String pointSizeList; + char *pixelSizeList; + char *pointSizeList; Boolean print_on_quit; String sample_text; String sample_text16; @@ -237,7 +237,7 @@ static Widget ownButton; static Widget fieldBox; static Widget countLabel; static Widget currentFontName; -static String currentFontNameString; +static char *currentFontNameString; static int currentFontNameSize; static Widget sampleText; static int textEncoding = -1; @@ -323,7 +323,7 @@ see 'xfontsel' manual page." Arg args[1]; currentFontNameSize = strlen(AppRes.pattern); if (currentFontNameSize < 128) currentFontNameSize = 128; - currentFontNameString = (String)XtMalloc(currentFontNameSize); + currentFontNameString = XtMalloc(currentFontNameSize); strcpy(currentFontNameString, AppRes.pattern); XtSetArg(args[0], XtNlabel, currentFontNameString); currentFontName = @@ -444,7 +444,7 @@ void GetFontNames(XtPointer closure) Display *dpy = (Display*)closure; ParseRec *parseRec; int f, field, count; - String *fontNames; + char **fontNames; Boolean *b; int work_priority = 0; @@ -574,9 +574,10 @@ void ParseFontNames(XtPointer closure) if (len == 0) v->string = NULL; else { - v->string = (String)XtMalloc( len+1 ); - strncpy( v->string, fieldP, len ); - v->string[len] = '\0'; + char *s = XtMalloc(len + 1); + strncpy( s, fieldP, len ); + s[len] = '\0'; + v->string = (String) s; } v->font = (int*)XtMalloc( 10*sizeof(int) ); v->allocated = 10; @@ -1088,7 +1089,7 @@ void SetCurrentFont(XtPointer closure) len = 1; } if (len+1 > --bytesLeft) { - currentFontNameString = (String) + currentFontNameString = XtRealloc(currentFontNameString, currentFontNameSize+=128); bytesLeft += 128; } @@ -1284,7 +1285,7 @@ void EnableOtherValues(Widget w, XtPointer closure, XtPointer callData) if (scaledFonts) { /* Check for 2 out of 3 scalable y fields being set */ - char *str; + const char *str; Bool specificPxl, specificPt, specificY; f = currentFont.value_index[6]; |