Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fixes for gcc 14 #73

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rott/modexlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static void StretchMemPicture ();
// GLOBAL VARIABLES

boolean StretchScreen=0;//bná++
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to not change this, my editor does not support this character. What do I do?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove that character from the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've changed it now.

boolean StretchScreen=0;//bn�++
extern boolean iG_aimCross;
extern boolean sdl_fullscreen;
extern int iG_X_center;
Expand Down Expand Up @@ -106,7 +106,7 @@ void GraphicsMode ( void )
uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
uint32_t pixel_format;

unsigned int rmask, gmask, bmask, amask;
uint32_t rmask, gmask, bmask, amask;
fabiangreffrath marked this conversation as resolved.
Show resolved Hide resolved
int bpp;

if (SDL_InitSubSystem (SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0)
Expand Down
2 changes: 1 addition & 1 deletion rott/rt_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void BuildTables (void)
memcpy(&gammatable[0],ptr,length*sizeof(byte));
table=W_CacheLumpName("tables",PU_CACHE, CvtNull, 1);

costable = (fixed *)&(sintable[FINEANGLES/4]);
costable = &(sintable[FINEANGLES/4]);

wstart=W_GetNumForName("WALLSTRT");
#if (SHAREWARE==0)
Expand Down
4 changes: 2 additions & 2 deletions rott/rt_draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ extern int fandc;
// math tables
//
extern short tantable[FINEANGLES];
extern fixed sintable[FINEANGLES+FINEANGLEQUAD+1];
extern fixed *costable;
extern int sintable[FINEANGLES+FINEANGLEQUAD+1];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly, these tables should be of fixed type.

Copy link
Contributor Author

@sharkwouter sharkwouter Jul 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I set it to fixed type, I get an error in the BuildTables function, which seems like it might have some logical errors:

~/taradino/rott/rt_draw.c: In function ‘BuildTables’:
~/taradino/rott/rt_draw.c:240:23: error: passing argument 1 of ‘SwapIntelLongArray’ from incompatible pointer type [-Wincompatible-pointer-types]
  240 |    SwapIntelLongArray(&sintable[0], length);
      |                       ^~~~~~~~~~~~
      |                       |
      |                       fixed * {aka long int *}
In file included from ~/taradino/rott/rt_draw.c:40:
~/taradino/rott/rt_util.h:73:32: note: expected ‘int *’ but argument is of type ‘fixed *’ {aka ‘long int *’}
   73 | void  SwapIntelLongArray (int *l, int num);
      |                           ~~~~~^

This code over there seems a bit off, since it does not use the fixed type, but int:

//
// get size of sin/cos table
//

   memcpy(&length,ptr,sizeof(int));
   SwapIntelLong(&length);
   ptr+=sizeof(int);
   
//
// get sin/cos table
//
   memcpy(&sintable[0],ptr,length*sizeof(int));
   SwapIntelLongArray(&sintable[0], length);
   ptr+=(length)*sizeof(int);

This code can be found here: https://github.com/fabiangreffrath/taradino/blob/main/rott/rt_draw.c#L228

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it gets more and more fishy.

extern int *costable;

//
// refresh variables
Expand Down
Loading