1
0
Fork 0
forked from len0rd/rockbox

SDL: Silence a large number of compile warnings (WIP)

There are some real bugs in here, but we're drowning in warnings.

Change-Id: I7c2c0eafc8426327521bdd8a3ac2d3742ac16864
This commit is contained in:
Solomon Peachy 2020-04-04 20:24:33 -04:00
parent 2ad6c3438e
commit e28d1fe916
44 changed files with 424 additions and 395 deletions

View file

@ -172,35 +172,36 @@ float CL_KeyState (kbutton_t *key)
{
float val;
qboolean impulsedown, impulseup, down;
impulsedown = key->state & 2;
impulseup = key->state & 4;
down = key->state & 1;
val = 0;
if (impulsedown && !impulseup)
if (impulsedown && !impulseup) {
if (down)
val = 0.5; // pressed and held this frame
else
val = 0; // I_Error ();
if (impulseup && !impulsedown)
} else if (impulseup && !impulsedown) {
if (down)
val = 0; // I_Error ();
else
val = 0; // released this frame
if (!impulsedown && !impulseup)
} else if (!impulsedown && !impulseup) {
if (down)
val = 1.0; // held the entire frame
else
val = 0; // up the entire frame
if (impulsedown && impulseup)
} else if (impulsedown && impulseup) {
if (down)
val = 0.75; // released and re-pressed this frame
else
val = 0.25; // pressed and released this frame
}
key->state &= 1; // clear impulses
return val;
}

View file

@ -182,6 +182,9 @@ extern byte *r_skysource;
#define DR_TRANSPARENT 1
// !!! must be kept the same as in quakeasm.h !!!
#ifdef TRANSPARENT_COLOR
#undef TRANSPARENT_COLOR
#endif
#define TRANSPARENT_COLOR 0xFF
extern void *acolormap; // FIXME: should go away

View file

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -69,11 +69,13 @@ void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
//void VectorNormalizeNoRet (vec3_t v); // uses finvsqrt
//float VectorNormalize (vec3_t v); // returns vector length
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
static inline float InvSqrt( float number ) {
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
@ -84,13 +86,14 @@ static inline float InvSqrt( float number ) {
return y;
}
#pragma GCC diagnostic pop
static inline void VectorNormalizeNoRet (vec3_t v)
{
float length, ilength;
ilength = InvSqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
v[0] *= ilength;
v[1] *= ilength;
v[2] *= ilength;
@ -110,7 +113,7 @@ static inline float VectorNormalize (vec3_t v)
v[1] *= ilength;
v[2] *= ilength;
}
return length;
}

View file

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@ -126,7 +126,7 @@ typedef struct qsocket_s
qboolean disconnected;
qboolean canSend;
qboolean sendNext;
int driver;
int landriver;
int socket;
@ -314,7 +314,7 @@ typedef struct _PollProcedure
{
struct _PollProcedure *next;
double nextTime;
void (*procedure)();
void (*procedure)(void *);
void *arg;
} PollProcedure;

View file

@ -250,7 +250,7 @@ void SV_MoveToGoal (void);
void SV_CheckForNewClients (void);
void SV_RunClients (void);
void SV_SaveSpawnparms ();
void SV_SaveSpawnparms (void);
#ifdef QUAKE2
void SV_SpawnServer (char *server, char *startspot);
#else