]> granicus.if.org Git - nethack/commitdiff
Fix some coordxy declarations that should be xint16
authorPatric Mueller <bhaak@gmx.net>
Tue, 23 Aug 2022 07:10:17 +0000 (09:10 +0200)
committerPatric Mueller <bhaak@gmx.net>
Tue, 23 Aug 2022 07:10:17 +0000 (09:10 +0200)
By temporarily changing the type definition for each of xint16 and
coordxy to int32_t, the compiler was able to find several places where
the type definitions were wrong.

include/extern.h
src/mkmaze.c
src/shk.c
src/sp_lev.c
src/teleport.c

index 72a4394035dce6dc9b8d94c9e8a21c2b05451c8f..18a65328dd4c65934f160abf5433b231271e813c 100644 (file)
@@ -601,7 +601,7 @@ extern void losedogs(void);
 extern void mon_arrive(struct monst *, int);
 extern void mon_catchup_elapsed_time(struct monst *, long);
 extern void keepdogs(boolean);
-extern void migrate_to_level(struct monst *, coordxy, coordxy, coord *);
+extern void migrate_to_level(struct monst *, xint16, xint16, coord *);
 extern void discard_migrations(void);
 extern int dogfood(struct monst *, struct obj *);
 extern boolean tamedog(struct monst *, struct obj *);
@@ -626,7 +626,7 @@ extern boolean ship_object(struct obj *, coordxy, coordxy, boolean);
 extern void obj_delivery(boolean);
 extern void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long);
 extern schar down_gate(coordxy, coordxy);
-extern void impact_drop(struct obj *, coordxy, coordxy, coordxy);
+extern void impact_drop(struct obj *, coordxy, coordxy, xint16);
 
 /* ### dothrow.c ### */
 
@@ -806,7 +806,7 @@ extern const char *ceiling(coordxy, coordxy);
 extern struct engr *engr_at(coordxy, coordxy);
 extern boolean sengr_at(const char *, coordxy, coordxy, boolean);
 extern void u_wipe_engr(int);
-extern void wipe_engr_at(coordxy, coordxy, coordxy, boolean);
+extern void wipe_engr_at(coordxy, coordxy, xint16, boolean);
 extern void read_engr_at(coordxy, coordxy);
 extern void make_engr_at(coordxy, coordxy, const char *, long, xint16);
 extern void del_engr_at(coordxy, coordxy);
@@ -1406,10 +1406,10 @@ extern void makemaz(const char *);
 extern void mazexy(coord *);
 extern void get_level_extends(coordxy *, coordxy *, coordxy *, coordxy *);
 extern void bound_digging(void);
-extern void mkportal(coordxy, coordxy, coordxy, coordxy);
+extern void mkportal(coordxy, coordxy, xint16, xint16);
 extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy);
 extern void place_lregion(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy,
-                          coordxy, coordxy, d_level *);
+                          coordxy, xint16, d_level *);
 extern void fixup_special(void);
 extern void fumaroles(void);
 extern void movebubbles(void);
@@ -1561,7 +1561,7 @@ extern void killed(struct monst *);
 extern void xkilled(struct monst *, int);
 extern void mon_to_stone(struct monst *);
 extern void m_into_limbo(struct monst *);
-extern void migrate_mon(struct monst *, coordxy, coordxy);
+extern void migrate_mon(struct monst *, xint16, xint16);
 extern void mnexto(struct monst *, unsigned);
 extern void deal_with_overcrowding(struct monst *);
 extern void maybe_mnexto(struct monst *);
index 169532ef37f9cf965828a7d23e62df02c7d52e5e..8c8ca9f5069f181bf67bc19f0c5895b27117fd7b 100644 (file)
@@ -14,7 +14,7 @@ static void wall_cleanup(coordxy, coordxy, coordxy, coordxy);
 static boolean okay(coordxy, coordxy, coordxy);
 static void maze0xy(coord *);
 static boolean put_lregion_here(coordxy, coordxy, coordxy, coordxy, coordxy,
-                                coordxy, coordxy, boolean, d_level *);
+                                coordxy, xint16, boolean, d_level *);
 static void baalz_fixup(void);
 static void setup_waterlevel(void);
 static void unsetup_waterlevel(void);
index fd888ff0660439f9d363d8f0c7dcdfc1984e56bc..a7b02c10e3536536a91be797eb37c0894b7f34ff 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -63,9 +63,9 @@ static struct damage *find_damage(struct monst *);
 static void discard_damage_struct(struct damage *);
 static void discard_damage_owned_by(struct monst *);
 static void shk_fixes_damage(struct monst *);
-static coordxy *litter_getpos(int *, coordxy, coordxy, struct monst *);
-static void litter_scatter(coordxy *, int, coordxy, coordxy, struct monst *);
-static void litter_newsyms(coordxy *, coordxy, coordxy);
+static xint16 *litter_getpos(int *, coordxy, coordxy, struct monst *);
+static void litter_scatter(xint16 *, int, coordxy, coordxy, struct monst *);
+static void litter_newsyms(xint16 *, coordxy, coordxy);
 static int repair_damage(struct monst *, struct damage *, boolean);
 static void sub_one_frombill(struct obj *, struct monst *);
 static void add_one_tobill(struct obj *, boolean, struct monst *);
@@ -3669,7 +3669,7 @@ shk_fixes_damage(struct monst *shkp)
 #define horiz(i) ((i % 3) - 1)
 #define vert(i) ((i / 3) - 1)
 
-static coordxy *
+static xint16 *
 litter_getpos(int *k, coordxy x, coordxy y, struct monst *shkp)
 {
     static xint16 litter[9];
index 4f4416a6893c54eb5203170756ed180408266de2..e6805c305134d6a5a59d5f6ebc16a2124a662fc7 100644 (file)
@@ -57,7 +57,7 @@ static unsigned int sp_amask_to_amask(unsigned int sp_amask);
 static void create_monster(monster *, struct mkroom *);
 static void create_object(object *, struct mkroom *);
 static void create_altar(altar *, struct mkroom *);
-static boolean search_door(struct mkroom *, coordxy *, coordxy *, coordxy, int);
+static boolean search_door(struct mkroom *, coordxy *, coordxy *, xint16, int);
 static void create_corridor(corridor *);
 static struct mkroom *build_room(room *, struct mkroom *);
 static void light_region(region *);
@@ -1304,7 +1304,7 @@ get_location_coord(
     *y = c.y;
     get_location(x, y, c.getloc_flags | (c.is_random ? NO_LOC_WARN : 0),
                  croom);
-    
+
     if (*x == -1 && *y == -1 && c.is_random)
         get_location(x, y, humidity, croom);
 }
index 08dda0bafcab521e7a21a5fc57491566f570f9f2..49794e37dd2fb989b02a5b44dd166c04b12cdfc7 100644 (file)
@@ -902,7 +902,7 @@ level_tele(void)
             }
             if (wizard && !strcmp(buf, "?")) {
                 schar destlev;
-                coordxy destdnum;
+                xint16 destdnum;
 
  levTport_menu:
                 destlev = 0;