From: nhmall Date: Sun, 31 Jan 2021 18:58:19 +0000 (-0500) Subject: CFDECLSPEC -> QSORTCALLBACK X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41fc278cfbc3b8666b135221a96cf68ad0211fc5;p=nethack CFDECLSPEC -> QSORTCALLBACK also remove one inappropriate use of CFDECLSPEC --- diff --git a/include/hack.h b/include/hack.h index b245d9a6e..5ecfd2465 100644 --- a/include/hack.h +++ b/include/hack.h @@ -568,9 +568,9 @@ enum optset_restrictions { * in that environment. */ #if defined(WIN_CE) -#define CFDECLSPEC __cdecl +#define QSORTCALLBACK __cdecl #else -#define CFDECLSPEC +#define QSORTCALLBACK #endif #define DEVTEAM_EMAIL "devteam@nethack.org" diff --git a/src/botl.c b/src/botl.c index 4a2c8e26b..7a00673d5 100644 --- a/src/botl.c +++ b/src/botl.c @@ -449,8 +449,8 @@ static int compare_blstats(struct istat_s *, struct istat_s *); static char *anything_to_s(char *, anything *, int); static int percentage(struct istat_s *, struct istat_s *); static int exp_percentage(void); -static int CFDECLSPEC cond_cmp(const genericptr, const genericptr); -static int CFDECLSPEC menualpha_cmp(const genericptr, const genericptr); +static int QSORTCALLBACK cond_cmp(const genericptr, const genericptr); +static int QSORTCALLBACK menualpha_cmp(const genericptr, const genericptr); #ifdef STATUS_HILITES static void s_to_anything(anything *, char *, int); @@ -989,7 +989,7 @@ condopt(int idx, boolean *addr, boolean negated) } /* qsort callback routine for sorting the condition index */ -static int CFDECLSPEC +static int QSORTCALLBACK cond_cmp(const genericptr vptr1, const genericptr vptr2) { int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2, @@ -1002,7 +1002,7 @@ cond_cmp(const genericptr vptr1, const genericptr vptr2) } /* qsort callback routine for alphabetical sorting of index */ -static int CFDECLSPEC +static int QSORTCALLBACK menualpha_cmp(const genericptr vptr1, const genericptr vptr2) { int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2; diff --git a/src/do_name.c b/src/do_name.c index d9cae76e5..d2e334fa5 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -8,7 +8,7 @@ static char *nextmbuf(void); static void getpos_help_keyxhelp(winid, const char *, const char *, int); static void getpos_help(boolean, const char *); -static int CFDECLSPEC cmp_coord_distu(const void *, const void *); +static int cmp_coord_distu(const void *, const void *); static int gloc_filter_classify_glyph(int); static int gloc_filter_floodfill_matcharea(int, int); static void gloc_filter_floodfill(int, int); diff --git a/src/files.c b/src/files.c index 86b99caee..771f6d74f 100644 --- a/src/files.c +++ b/src/files.c @@ -126,7 +126,7 @@ extern char *sounddir; /* defined in sounds.c */ static NHFILE *new_nhfile(void); static void free_nhfile(NHFILE *); #ifdef SELECTSAVED -static int CFDECLSPEC strcmp_wrap(const void *, const void *); +static int QSORTCALLBACK strcmp_wrap(const void *, const void *); #endif static char *set_bonesfile_name(char *, d_level *); static char *set_bonestemp_name(void); @@ -613,7 +613,7 @@ clearlocks(void) #if defined(SELECTSAVED) /* qsort comparison routine */ -static int CFDECLSPEC +static int QSORTCALLBACK strcmp_wrap(const void *p, const void *q) { #if defined(UNIX) && defined(QT_GRAPHICS) diff --git a/src/insight.c b/src/insight.c index 4cea28c84..2c8a36ce4 100644 --- a/src/insight.c +++ b/src/insight.c @@ -30,7 +30,7 @@ static void status_enlightenment(int, int); static void weapon_insight(int); static void attributes_enlightenment(int, int); static void show_achievements(int); -static int CFDECLSPEC vanqsort_cmp(const genericptr, const genericptr); +static int QSORTCALLBACK vanqsort_cmp(const genericptr, const genericptr); static int set_vanq_order(void); static int num_extinct(void); @@ -2193,7 +2193,7 @@ static const char *vanqorders[NUM_VANQ_ORDER_MODES] = { "by count, low to high, by internal index within tied count", }; -static int CFDECLSPEC +static int QSORTCALLBACK vanqsort_cmp(const genericptr vptr1, const genericptr vptr2) { int indx1 = *(short *) vptr1, indx2 = *(short *) vptr2, diff --git a/src/invent.c b/src/invent.c index 06114d455..d44c41b71 100644 --- a/src/invent.c +++ b/src/invent.c @@ -15,7 +15,7 @@ static char *loot_xname(struct obj *); static int invletter_value(char); -static int CFDECLSPEC sortloot_cmp(const genericptr, const genericptr); +static int QSORTCALLBACK sortloot_cmp(const genericptr, const genericptr); static void reorder_invent(void); static struct obj *addinv_core0(struct obj *, struct obj *, boolean); static void noarmor(boolean); @@ -303,7 +303,7 @@ invletter_value(char c) } /* qsort comparison routine for sortloot() */ -static int CFDECLSPEC +static int QSORTCALLBACK sortloot_cmp(const genericptr vptr1, const genericptr vptr2) { struct sortloot_item *sli1 = (struct sortloot_item *) vptr1, diff --git a/src/mklev.c b/src/mklev.c index 0b606b4bf..7061fae22 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -27,7 +27,7 @@ static struct mkroom *pos_to_room(xchar, xchar); static boolean place_niche(struct mkroom *, int *, int *, int *); static void makeniche(int); static void make_niches(void); -static int CFDECLSPEC do_comp(const genericptr, const genericptr); +static int QSORTCALLBACK do_comp(const genericptr, const genericptr); static void dosdoor(xchar, xchar, struct mkroom *, int); static void join(int, int, boolean); static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean, @@ -44,7 +44,7 @@ static void mk_knox_portal(xchar, xchar); /* Args must be (const genericptr) so that qsort will always be happy. */ -static int CFDECLSPEC +static int QSORTCALLBACK do_comp(const genericptr vx, const genericptr vy) { #ifdef LINT diff --git a/src/o_init.c b/src/o_init.c index 13058f98b..68f3ba32b 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -9,7 +9,7 @@ static void setgemprobs(d_level *); static void shuffle(int, int, boolean); static void shuffle_all(void); static boolean interesting_to_discover(int); -static int CFDECLSPEC discovered_cmp(const genericptr, const genericptr); +static int QSORTCALLBACK discovered_cmp(const genericptr, const genericptr); static char *oclass_to_name(char, char *); #ifdef USE_TILES @@ -455,7 +455,7 @@ static const short uniq_objs[] = { }; /* discoveries qsort comparison function */ -static int CFDECLSPEC +static int QSORTCALLBACK discovered_cmp(const genericptr v1, const genericptr v2) { const char *s1 = *(const char **) v1; diff --git a/src/spell.c b/src/spell.c index 512ac8479..e20acfbe5 100644 --- a/src/spell.c +++ b/src/spell.c @@ -32,7 +32,7 @@ static void deadbook(struct obj *); static int learn(void); static boolean rejectcasting(void); static boolean getspell(int *); -static int CFDECLSPEC spell_cmp(const genericptr, const genericptr); +static int QSORTCALLBACK spell_cmp(const genericptr, const genericptr); static void sortspells(void); static boolean spellsortmenu(void); static boolean dospellmenu(const char *, int, int *); @@ -1443,7 +1443,7 @@ static const char *spl_sortchoices[NUM_SPELL_SORTBY] = { }; /* qsort callback routine */ -static int CFDECLSPEC +static int QSORTCALLBACK spell_cmp(const genericptr vptr1, const genericptr vptr2) { /*