summaryrefslogtreecommitdiff
path: root/xfontsel.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-03 15:34:31 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-03 15:34:31 -0700
commit954fc5687b9805201c425fd3139acb6d19bd9bd5 (patch)
tree8145fed234d1879178f2dec648c132e402f223b2 /xfontsel.c
parentb08c43c680e4ad3092893bc7f3eb5f98e67648af (diff)
const cleanup
Clears up 32 out of 49 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xfontsel.c')
-rw-r--r--xfontsel.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/xfontsel.c b/xfontsel.c
index 9ab33d1..24a9745 100644
--- a/xfontsel.c
+++ b/xfontsel.c
@@ -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];