From f7d816afa33e6b5c39822d05a4a5ccfd25f68558 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 1 May 2024 21:42:14 +0200 Subject: [PATCH 1/5] fix -Wunused-but-set-variable in rt_actor.c --- rott/rt_actor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rott/rt_actor.c b/rott/rt_actor.c index 02b7fef..97c799e 100644 --- a/rott/rt_actor.c +++ b/rott/rt_actor.c @@ -12541,7 +12541,7 @@ boolean CheckLine (void *from, void *to, int condition) int value; int dx,dy,dz; int xydist; - int otx,oty,count=0; + int otx,oty; @@ -12633,7 +12633,7 @@ boolean CheckLine (void *from, void *to, int condition) do - {count ++; + { /* if (count > 1000) Error("possible infinite loop in CheckLine"); From 9632c83250ec5a1278078d8deb68853b26a203a6 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 1 May 2024 21:44:49 +0200 Subject: [PATCH 2/5] fix -Wunused-but-set-variable in rt_door.c --- rott/rt_door.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rott/rt_door.c b/rott/rt_door.c index 3719e9d..48d2662 100644 --- a/rott/rt_door.c +++ b/rott/rt_door.c @@ -299,7 +299,7 @@ int GetIndexForAction(void (*action)(intptr_t)) void SaveTouchPlates(byte ** buffer,int *size) -{int i,k; +{int i; byte * tptr; touchplatetype *temp; saved_touch_type dummy; @@ -318,7 +318,7 @@ void SaveTouchPlates(byte ** buffer,int *size) for(i=0;inextaction) + for(temp=touchplate[i];temp;temp = temp->nextaction) { dummy.tictime = temp->tictime; dummy.ticcount = temp->ticcount; From f5a9aeff006d6fda16fba5156b151f6faf8b75cc Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 1 May 2024 21:51:21 +0200 Subject: [PATCH 3/5] fix -Wdeprecated-non-prototype in rt_draw.c --- rott/rt_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rott/rt_draw.c b/rott/rt_draw.c index fd32286..0da7a99 100644 --- a/rott/rt_draw.c +++ b/rott/rt_draw.c @@ -751,13 +751,13 @@ int CalcRotate (objtype *ob) #define SGN(x) ((x>0) ? (1) : ((x==0) ? (0) : (-1))) /*--------------------------------------------------------------------------*/ -int CompareHeights(s1p,s2p) visobj_t **s1p,**s2p; +int CompareHeights(visobj_t **s1p, visobj_t **s2p) { whereami=3; return SGN((*s1p)->viewheight-(*s2p)->viewheight); } -void SwitchPointers(s1p,s2p) visobj_t **s1p,**s2p; +void SwitchPointers(visobj_t **s1p, visobj_t **s2p) { visobj_t * temp; From 9e328fbd9956c89337f76ab34c440c58315c0d6f Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 1 May 2024 21:55:16 +0200 Subject: [PATCH 4/5] fix -Wdeprecated-non-prototype and -Wunused-but-set-variable in rt_ted.c --- rott/rt_ted.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/rott/rt_ted.c b/rott/rt_ted.c index 04fb8f0..5bef04c 100644 --- a/rott/rt_ted.c +++ b/rott/rt_ted.c @@ -179,12 +179,12 @@ int GetLumpForTile(int tile); #define SGN(x) ((x>0) ? (1) : ((x==0) ? (0) : (-1))) /*--------------------------------------------------------------------------*/ -int CompareTags(s1p,s2p) cachetype *s1p,*s2p; +int CompareTags(cachetype *s1p, cachetype *s2p) { return SGN(s1p->lump-s2p->lump); } -void SwitchCacheEntries(s1p,s2p) cachetype *s1p,*s2p; +void SwitchCacheEntries(cachetype *s1p, cachetype *s2p) { cachetype temp; @@ -3289,20 +3289,15 @@ void SetupDoorLinks (void) int j, i, k; - unsigned short *map; int clocklinked; int clockx,clocky; int doornumber; unsigned short touchx, touchy; - map = mapplanes[0]; - for (j = 0; j < mapheight; j++) for (i = 0; i < mapwidth; i++) { - map++; - if (MAPSPOT (i, j, 2)) { if (IsDoor(i,j)==1) From e7eebf6b026707e98e2d8bc1e64c69fd873def17 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Thu, 2 May 2024 21:31:51 +0200 Subject: [PATCH 5/5] fix -Wdeprecated-non-prototype in hsort() --- rott/rt_draw.c | 7 +++++-- rott/rt_ted.c | 6 ++++-- rott/rt_util.c | 8 ++++---- rott/rt_util.h | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/rott/rt_draw.c b/rott/rt_draw.c index 0da7a99..f8038c0 100644 --- a/rott/rt_draw.c +++ b/rott/rt_draw.c @@ -751,14 +751,17 @@ int CalcRotate (objtype *ob) #define SGN(x) ((x>0) ? (1) : ((x==0) ? (0) : (-1))) /*--------------------------------------------------------------------------*/ -int CompareHeights(visobj_t **s1p, visobj_t **s2p) +int CompareHeights(void *v1p, void *v2p) { + visobj_t **s1p = (visobj_t **) v1p, **s2p = (visobj_t **) v2p; + whereami=3; return SGN((*s1p)->viewheight-(*s2p)->viewheight); } -void SwitchPointers(visobj_t **s1p, visobj_t **s2p) +void SwitchPointers(void *v1p, void *v2p) { + visobj_t **s1p = (visobj_t **) v1p, **s2p = (visobj_t **) v2p; visobj_t * temp; whereami=4; diff --git a/rott/rt_ted.c b/rott/rt_ted.c index 5bef04c..d12cbba 100644 --- a/rott/rt_ted.c +++ b/rott/rt_ted.c @@ -179,13 +179,15 @@ int GetLumpForTile(int tile); #define SGN(x) ((x>0) ? (1) : ((x==0) ? (0) : (-1))) /*--------------------------------------------------------------------------*/ -int CompareTags(cachetype *s1p, cachetype *s2p) +int CompareTags(void *v1p, void *v2p) { + cachetype *s1p = (cachetype *) v1p, *s2p = (cachetype *) v2p; return SGN(s1p->lump-s2p->lump); } -void SwitchCacheEntries(cachetype *s1p, cachetype *s2p) +void SwitchCacheEntries(void *v1p, void *v2p) { + cachetype *s1p = (cachetype *) v1p, *s2p = (cachetype *) v2p; cachetype temp; temp=*s1p; diff --git a/rott/rt_util.c b/rott/rt_util.c index 04ba739..831c7d4 100644 --- a/rott/rt_util.c +++ b/rott/rt_util.c @@ -1201,15 +1201,15 @@ int SideOfLine(int x1, int y1, int x2, int y2, int x3, int y3) // //****************************************************************************** -typedef int (*PFI)(); /* pointer to a function returning int */ -typedef void (*PFV)(); /* pointer to a function returning int */ +typedef int (*PFI)(void *, void*); /* pointer to a function returning int */ +typedef void (*PFV)(void *, void*); /* pointer to a function returning int */ static PFI Comp; /* pointer to comparison routine */ static PFV Switch; /* pointer to comparison routine */ static int Width; /* width of an object in bytes */ static char *Base; /* pointer to element [-1] of array */ -static void newsift_down(L,U) int L,U; +static void newsift_down(int L, int U) { int c; while(1) @@ -1222,7 +1222,7 @@ static void newsift_down(L,U) int L,U; } } -void hsort(char * base, int nel, int width, int (*compare)(), void (*switcher)()) +void hsort(char * base, int nel, int width, int (*compare)(void *, void*), void (*switcher)(void *, void*)) { static int i,n,stop; /* Perform a heap sort on an array starting at base. The array is diff --git a/rott/rt_util.h b/rott/rt_util.h index d3b4988..3bf8163 100644 --- a/rott/rt_util.h +++ b/rott/rt_util.h @@ -94,7 +94,7 @@ void UL_DisplayMemoryError ( int memneeded ); int SideOfLine(int x1, int y1, int x2, int y2, int x3, int y3); -void hsort(char * base, int nel, int width, int (*compare)(), void (*switcher)()); +void hsort(char * base, int nel, int width, int (*compare)(void *, void*), void (*switcher)(void *, void*)); char * UL_GetPath (char * path, char *dir); boolean UL_ChangeDirectory (char *path);