diff options
author | Gentoo <installgentoo@endianness.com> | 2022-05-27 00:05:48 +1000 |
---|---|---|
committer | Gentoo <installgentoo@endianness.com> | 2022-05-27 00:05:48 +1000 |
commit | 1559091f3b33eb407850a3e2e1dae2eec96fee99 (patch) | |
tree | d94a6dfb12ce22792da842bf360b459985b49fd2 | |
parent | 70c7b41a1581d6ce6750f96934494d0c39e07010 (diff) | |
download | xlennart-1559091f3b33eb407850a3e2e1dae2eec96fee99.tar.gz xlennart-1559091f3b33eb407850a3e2e1dae2eec96fee99.tar.bz2 xlennart-1559091f3b33eb407850a3e2e1dae2eec96fee99.zip |
removed distros that are now infected with systemd, plus fixed most compile time errors aside from the gtk ones
-rw-r--r-- | Game.c | 5 | ||||
-rw-r--r-- | OS.c | 9 | ||||
-rw-r--r-- | Scorelist.c | 14 | ||||
-rw-r--r-- | UI.c | 3 | ||||
-rw-r--r-- | config.h | 68 | ||||
-rw-r--r-- | game-strings.h (renamed from strings.h) | 0 | ||||
-rw-r--r-- | gtk.c | 16 | ||||
-rw-r--r-- | pixmaps/arch.xpm | 41 | ||||
-rw-r--r-- | x11-athena.c | 6 | ||||
-rw-r--r-- | x11-motif.c | 6 |
10 files changed, 101 insertions, 67 deletions
@@ -2,6 +2,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <strings.h> #include <time.h> #include "types.h" @@ -254,8 +255,8 @@ parse_args(int argc, char **argv) { char *endp; int i; - for (i = 1; i < argc; i++) { - if (strncasecmp(argv[i], "-l", 2) == 0) { + for (i = 1; i < argc; ++i) { + if (strncasecmp(argv[i], "-l", (size_t)2) == 0) { if (strlen(argv[i]) == 2 && i == argc - 1) fatal("-l takes an argument"); if (strlen(argv[i]) > 2) @@ -4,11 +4,10 @@ #include "OS.h" #include "UI.h" -#define MIN_PC 6 /* OS >= MIN_PC means the OS is a PC OS */ +#define MIN_PC 4 /* OS >= MIN_PC means the OS is a PC OS - now 4 instead of 6, as there are only 6 OS's */ -static const char *osname[] = { "initfail", "arch", "bsd", "centos", "debian", - "gentoo", "mandriva", "openbsd", "slackware", - "suse", "ubuntu"}; +static const char *osname[] = { "initfail", "bsd", + "gentoo", "mandriva", "openbsd", "slackware"}; #define NUM_OS (sizeof(osname) / sizeof(osname[0])) static Picture *os[NUM_OS]; /* array of OS pictures*/ @@ -18,7 +17,7 @@ static MCursor *cursor[NUM_OS]; /* array of OS cursors (drag/drop) */ void OS_load_pix() { unsigned int i; - for (i = 0; i < NUM_OS; i++) { + for (i = 0; i < NUM_OS; ++i) { UI_load_picture(osname[i], 1, &os[i]); if (i != 0) UI_load_cursor(osname[i], CURSOR_OWN_MASK, &cursor[i]); diff --git a/Scorelist.c b/Scorelist.c index 9c2afc6..dba1d6d 100644 --- a/Scorelist.c +++ b/Scorelist.c @@ -22,13 +22,17 @@ Scorelist_read() { int i; if (scorefile != NULL) { - for (i = 0; i < SCORES; i++) - fscanf(scorefile, "%20s%d%d\n", scores[i].name, - &scores[i].level, &scores[i].score); + for (i = 0; i < SCORES; ++i) { + int result = fscanf(scorefile, "%20s%d%d\n", scores[i].name, + &scores[i].level, &scores[i].score); + /* doesn't appear to be too much of an issue if can't read from scorefile */ + if (!result){fprintf(stderr, "Reading from scorefile %s failed!", SCOREFILE);} + } + fclose(scorefile); } else { - for (i = 0; i < SCORES; i++) { + for (i = 0; i < SCORES; ++i) { strcpy(scores[i].name, "Anonymous"); scores[i].level = 0; scores[i].score = 0; @@ -42,7 +46,7 @@ Scorelist_write() { int i; if (scorefile == NULL) return; - for (i = 0; i < SCORES; i++) + for (i = 0; i < SCORES; ++i) fprintf(scorefile, "%-*s %d %d\n", NAMELEN, scores[i].name, scores[i].level, scores[i].score); fclose(scorefile); @@ -1,8 +1,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <strings.h> -#include "strings.h" +#include "game-strings.h" #include "types.h" #include "util.h" diff --git a/config.h b/config.h new file mode 100644 index 0000000..c1c4b01 --- /dev/null +++ b/config.h @@ -0,0 +1,68 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ +/* Use athena widgets */ +#define USE_ATHENA 1 + +/* Use motif widgets */ +#define USE_MOTIF 1 + +/* Use gtk widgets */ +#define USE_GTK 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ diff --git a/strings.h b/game-strings.h index a07d138..a07d138 100644 --- a/strings.h +++ b/game-strings.h @@ -165,16 +165,16 @@ timer_tick(gpointer arg) { */ #include "bitmaps/initfail.xbm" -#include "bitmaps/arch.xbm" +//#include "bitmaps/arch.xbm" #include "bitmaps/bsd.xbm" -#include "bitmaps/centos.xbm" -#include "bitmaps/debian.xbm" +//#include "bitmaps/centos.xbm" +//#include "bitmaps/debian.xbm" #include "bitmaps/gentoo.xbm" #include "bitmaps/mandriva.xbm" #include "bitmaps/openbsd.xbm" #include "bitmaps/slackware.xbm" -#include "bitmaps/suse.xbm" -#include "bitmaps/ubuntu.xbm" +//#include "bitmaps/suse.xbm" +//#include "bitmaps/ubuntu.xbm" #include "bitmaps/bucket.xbm" #include "bitmaps/hand_down.xbm" #include "bitmaps/hand_down_mask.xbm" @@ -194,10 +194,8 @@ typedef struct cursormap { {#x, x ## _width, x ## _height, x ## _bits, x ## _mask_bits} static cursormap cursors[] = { - CURSOR_ADD(arch), CURSOR_ADD( bsd), CURSOR_ADD(centos), - CURSOR_ADD(debian), CURSOR_ADD(gentoo), CURSOR_ADD(mandriva), - CURSOR_ADD(openbsd), CURSOR_ADD(slackware), CURSOR_ADD(suse), - CURSOR_ADD(ubuntu), CURSOR_ADD(bucket), + CURSOR_ADD( bsd), CURSOR_ADD(gentoo), CURSOR_ADD(mandriva), + CURSOR_ADD(openbsd), CURSOR_ADD(slackware), CURSOR_ADD(bucket), CURSOR_ADD_MASKED(hand_up), CURSOR_ADD_MASKED(hand_down), {NULL, 0, 0, NULL, NULL}, }; diff --git a/pixmaps/arch.xpm b/pixmaps/arch.xpm deleted file mode 100644 index d1d990e..0000000 --- a/pixmaps/arch.xpm +++ /dev/null @@ -1,41 +0,0 @@ -/* XPM */ -static char * arch_xpm[] = { -"28 24 14 1", -" c None", -". c #FFFFFF", -"+ c #1692D1", -"@ c #1792D1", -"# c #1692D0", -"$ c #1793D1", -"% c #1592D0", -"& c #1693D1", -"* c #1D95D1", -"= c #1B94D1", -"- c #1894D0", -"; c #1E95D2", -"> c #1792CF", -", c #1693D0", -"............................", -".............+@.............", -".............##.............", -"............$$$$............", -"............$$$$............", -"...........$$$$$$...........", -"...........$$$$$$...........", -".............$$$$$..........", -"..........%&..$$$$..........", -".........$$$$+#$$$$.........", -".........$$$$$$$$$$.........", -"........*$$$$$$$$$$$........", -"........#$$$$$$$$$$$........", -".......=$$$$$$$$$$$$$.......", -".......$$$$$$..$$$$$#.......", -"......-$$$$$....$$..$;......", -"......#$$$#$....$$$$........", -".....>$$$$#......$$&$$......", -".....#$$$$#......$$$$$$.....", -"....,$$$$#........+$$$$$....", -"...$$$$&$...........%$$$$...", -"...$$$$..............$$#@...", -"..$$$..................$$$..", -"............................"}; diff --git a/x11-athena.c b/x11-athena.c index 49453b9..c3989d9 100644 --- a/x11-athena.c +++ b/x11-athena.c @@ -12,6 +12,7 @@ #include <X11/Xaw/SmeBSB.h> #include <X11/Xaw/SmeLine.h> #include <X11/Xaw/AsciiText.h> +#include <stdint.h> #include "util.h" @@ -31,7 +32,8 @@ static void popup(Widget w, XtPointer client_data, XtPointer call_data) { UNUSED(w); UNUSED(call_data); - x11_athena_popup_dialog((int)client_data); + /* int casted to needs to match size of pointer */ + x11_athena_popup_dialog((intptr_t)client_data); } static Widget @@ -39,7 +41,7 @@ new_menu_item(Widget pshell, int dialog) { Widget menu_item = XtCreateManagedWidget(UI_menu_string(dialog), smeBSBObjectClass, pshell, NULL, 0); - XtAddCallback(menu_item, XtNcallback, popup, (void *) dialog); + XtAddCallback(menu_item, XtNcallback, popup, (XtPointer)&dialog); return menu_item; } diff --git a/x11-motif.c b/x11-motif.c index b1af1b0..827f444 100644 --- a/x11-motif.c +++ b/x11-motif.c @@ -13,6 +13,7 @@ #include <Xm/MessageB.h> #include <Xm/SelectioB.h> #include <Xm/Text.h> +#include <stdint.h> #include "util.h" @@ -32,7 +33,8 @@ static void popup(Widget w, XtPointer client_data, XtPointer call_data) { UNUSED(w); UNUSED(call_data); - x11_motif_popup_dialog((int)client_data); + /* it appears that a pointer needs to be casted to an int of the same size here */ + x11_motif_popup_dialog((intptr_t)client_data); } static Widget @@ -40,7 +42,7 @@ new_menu_item(Widget pulldown, int dialog) { Widget menu_item = XtCreateManagedWidget(UI_menu_string(dialog), xmPushButtonWidgetClass, pulldown, NULL, 0); - XtAddCallback(menu_item, XmNactivateCallback, popup, (void *) dialog); + XtAddCallback(menu_item, XmNactivateCallback, popup, (XtPointer)&dialog); return menu_item; } |