From 4cbfb7d05ff16b5e75ce3425e59b925d8d791c5d Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 29 Dec 2018 03:02:07 -0800 Subject: [PATCH] X11 USE_XPM lint --- win/X11/tile2x11.c | 16 ++++++++++------ win/X11/winX.c | 22 +++++++++++----------- win/X11/wintext.c | 6 +++--- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/win/X11/tile2x11.c b/win/X11/tile2x11.c index 750f12ae4..774b6e636 100644 --- a/win/X11/tile2x11.c +++ b/win/X11/tile2x11.c @@ -1,4 +1,4 @@ -/* $NHDT-Date: 1524689304 2018/04/25 20:48:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.11 $ */ +/* $NHDT-Date: 1546081295 2018/12/29 11:01:35 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.12 $ */ /* Copyright (c) 2017 by Pasi Kallinen */ /* NetHack may be freely redistributed. See license for details. */ @@ -27,10 +27,11 @@ static unsigned char pix_to_colormap(pix) pixel pix; { - unsigned i; + unsigned long i; for (i = 0; i < header.ncolors; i++) { - if (pix.r == ColorMap[CM_RED][i] && pix.g == ColorMap[CM_GREEN][i] + if (pix.r == ColorMap[CM_RED][i] + && pix.g == ColorMap[CM_GREEN][i] && pix.b == ColorMap[CM_BLUE][i]) break; } @@ -129,7 +130,8 @@ static int xpm_write(fp) FILE *fp; { - int i, j, n; + unsigned long i, j; + unsigned n; if (header.ncolors > 64) { Fprintf(stderr, "Sorry, only configured for up to 64 colors\n"); @@ -144,7 +146,7 @@ FILE *fp; header.ncolors, 1 /* char per color */); for (i = 0; i < header.ncolors; i++) Fprintf(fp, "\"%c c #%02x%02x%02x\",\n", - i + '0', /* just one char per color */ + (char) (i + '0'), /* just one char per color */ x11_colormap[i][0], x11_colormap[i][1], x11_colormap[i][2]); n = 0; @@ -179,7 +181,9 @@ char **argv; header.per_row = TILES_PER_ROW; if (argc == 1) { - Fprintf(stderr, "usage: %s txt_file1 [txt_file2 ...] [-grayscale txt_fileN]\n", argv[0]); + Fprintf(stderr, + "usage: %s txt_file1 [txt_file2 ...] [-grayscale txt_fileN]\n", + argv[0]); exit(1); } diff --git a/win/X11/winX.c b/win/X11/winX.c index 09d5c7a50..654e997e4 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 winX.c $NHDT-Date: 1539392992 2018/10/13 01:09:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.57 $ */ +/* NetHack 3.6 winX.c $NHDT-Date: 1546081304 2018/12/29 11:01:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.71 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1440,16 +1440,16 @@ static XtResource resources[] = { sizeof(XtRPixel), XtOffset(AppResources *, pilemark_color), XtRString, nhStr("Green") }, #ifdef GRAPHIC_TOMBSTONE - { nhStr("tombstone"), "Tombstone", XtRString, sizeof(String), - XtOffset(AppResources *, tombstone), XtRString, "rip.xpm" }, - { nhStr("tombtext_x"), "Tombtext_x", XtRInt, sizeof(int), - XtOffset(AppResources *, tombtext_x), XtRString, "155" }, - { nhStr("tombtext_y"), "Tombtext_y", XtRInt, sizeof(int), - XtOffset(AppResources *, tombtext_y), XtRString, "78" }, - { nhStr("tombtext_dx"), "Tombtext_dx", XtRInt, sizeof(int), - XtOffset(AppResources *, tombtext_dx), XtRString, "0" }, - { nhStr("tombtext_dy"), "Tombtext_dy", XtRInt, sizeof(int), - XtOffset(AppResources *, tombtext_dy), XtRString, "13" }, + { nhStr("tombstone"), nhStr("Tombstone"), XtRString, sizeof(String), + XtOffset(AppResources *, tombstone), XtRString, nhStr("rip.xpm") }, + { nhStr("tombtext_x"), nhStr("Tombtext_x"), XtRInt, sizeof(int), + XtOffset(AppResources *, tombtext_x), XtRString, nhStr("155") }, + { nhStr("tombtext_y"), nhStr("Tombtext_y"), XtRInt, sizeof(int), + XtOffset(AppResources *, tombtext_y), XtRString, nhStr("78") }, + { nhStr("tombtext_dx"), nhStr("Tombtext_dx"), XtRInt, sizeof(int), + XtOffset(AppResources *, tombtext_dx), XtRString, nhStr("0") }, + { nhStr("tombtext_dy"), nhStr("Tombtext_dy"), XtRInt, sizeof(int), + XtOffset(AppResources *, tombtext_dy), XtRString, nhStr("13") }, #endif }; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 1f743766d..122ef8e02 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintext.c $NHDT-Date: 1543622533 2018/12/01 00:02:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.16 $ */ +/* NetHack 3.6 wintext.c $NHDT-Date: 1546081305 2018/12/29 11:01:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.17 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -204,7 +204,7 @@ boolean blocking; #ifdef GRAPHIC_TOMBSTONE if (text_info->is_rip) { Widget rip = create_ripout_widget(XtParent(wp->w)); - XtSetArg(args[num_args], XtNfromVert, rip); + XtSetArg(args[num_args], nhStr(XtNfromVert), rip); num_args++; } #endif @@ -533,7 +533,7 @@ calculate_rip_text(int how, time_t when) static void rip_exposed(w, client_data, widget_data) Widget w; -XtPointer client_data; /* unused */ +XtPointer client_data UNUSED; XtPointer widget_data; /* expose event from Window widget */ { XExposeEvent *event = (XExposeEvent *) widget_data; -- 2.40.0