-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
@@ -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�++ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@@ -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]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Is this ready to merge @fabiangreffrath? |
Yes, I think so. That's why I approved them. 😉 |
gcc 14 is a bit stricter with types, causing a compile errors. This PR makes the game able to build with it, without making any changes to how the game works. Let me know if you see any issue with it, I was able to play the game just fine.