various gcc 4.3 fixes

This commit is contained in:
Bill Currie 2008-07-19 05:40:57 +00:00 committed by Jeff Teunissen
parent d4b8097200
commit fe95805d86
13 changed files with 36 additions and 24 deletions

View file

@ -340,7 +340,7 @@ PR_SetString (progs_t *pr, const char *s)
s = "";
sr = Hash_Find (pr->strref_hash, s);
if (!sr) {
if (__builtin_expect (!sr, 1)) {
sr = new_string_ref (pr);
sr->type = str_static;
sr->s.string = pr_strdup(pr, s);

View file

@ -97,9 +97,10 @@ int
VCR_GetMessage (qsocket_t * sock)
{
int ret;
long *driverdata = (long *) &sock->driverdata;
if (host_time != next.time || next.op != VCR_OP_GETMESSAGE
|| next.session != *(long *) (char *) (&sock->driverdata))
|| next.session != *driverdata)
Sys_Error ("VCR missmatch");
Qread (vcrFile, &ret, sizeof (int));
@ -124,9 +125,10 @@ int
VCR_SendMessage (qsocket_t * sock, sizebuf_t *data)
{
int ret;
long *driverdata = (long *) &sock->driverdata;
if (host_time != next.time || next.op != VCR_OP_SENDMESSAGE
|| next.session != *(long *) (char *) (&sock->driverdata))
|| next.session != *driverdata)
Sys_Error ("VCR missmatch");
Qread (vcrFile, &ret, sizeof (int));
@ -141,9 +143,10 @@ qboolean
VCR_CanSendMessage (qsocket_t * sock)
{
qboolean ret;
long *driverdata = (long *) &sock->driverdata;
if (host_time != next.time || next.op != VCR_OP_CANSENDMESSAGE
|| next.session != *(long *) (char *) (&sock->driverdata))
|| next.session != *driverdata)
Sys_Error ("VCR missmatch");
Qread (vcrFile, &ret, sizeof (int));
@ -177,6 +180,7 @@ qsocket_t *
VCR_CheckNewConnections (void)
{
qsocket_t *sock;
long *driverdata;
if (host_time != next.time || next.op != VCR_OP_CONNECT)
Sys_Error ("VCR missmatch");
@ -187,7 +191,8 @@ VCR_CheckNewConnections (void)
}
sock = NET_NewQSocket ();
*(long *) (char *) (&sock->driverdata) = next.session;
driverdata = (long *) &sock->driverdata;
*driverdata = next.session;
Qread (vcrFile, sock->address, NET_NAMELEN);
VCR_ReadNext ();

View file

@ -92,7 +92,7 @@ gl_lightmap_init (void)
for (s = 1; s < 8192; s++)
dlightdivtable[s] = 1048576 / (s << 7);
}
/*
static void
R_RecursiveLightUpdate (mnode_t *node)
{
@ -108,7 +108,7 @@ R_RecursiveLightUpdate (mnode_t *node)
c--, surf++)
surf->cached_dlight = true;
}
*/
static inline void
R_AddDynamicLights_1 (msurface_t *surf)
{

View file

@ -90,7 +90,7 @@ float r_avertexnormal_dots[SHADEDOT_QUANT][256] = {
vec3_t shadevector;
static inline void
static void
GL_DrawAliasFrameTri (vert_order_t *vo)
{
int count = vo->count;
@ -133,7 +133,7 @@ GL_DrawAliasFrameTriMulti (vert_order_t *vo)
qfglEnd ();
}
static inline void
static void
GL_DrawAliasFrame (vert_order_t *vo)
{
int count;

View file

@ -94,7 +94,7 @@ Skin_Set_Translate (int top, int bottom, void *_dest)
}
}
static inline void
static void
build_skin_8 (byte * original, int tinwidth, int tinheight,
unsigned int scaled_width, unsigned int scaled_height,
int inwidth, qboolean alpha)
@ -121,7 +121,7 @@ build_skin_8 (byte * original, int tinwidth, int tinheight,
alpha);
}
static inline void
static void
build_skin_32 (byte * original, int tinwidth, int tinheight,
unsigned int scaled_width, unsigned int scaled_height,
int inwidth, qboolean alpha)

View file

@ -159,5 +159,6 @@ junk .
#ifdef YY_FLEX_REALLOC_HACK
#else
static __attribute__ ((unused)) void (*yyunput_hack)(int, char*) = yyunput;
static __attribute__ ((used)) void (*yyunput_hack)(int, char*) = yyunput;
static __attribute__ ((used)) int (*input_hack)(void) = input;
#endif

View file

@ -58,7 +58,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <asm/page.h>
#include <linux/kd.h>
#include <linux/vt.h>
#include <sys/stat.h>
@ -77,6 +76,11 @@ static __attribute__ ((used)) const char rcsid[] =
#include "d_iface.h"
#include "fbset.h"
#ifndef PAGE_SIZE
# define PAGE_SIZE (sysconf(_SC_PAGESIZE))
# define PAGE_MASK (~(PAGE_SIZE-1))
#endif
static struct VideoMode current_mode;
static char current_name[32];
static int num_modes;

View file

@ -149,7 +149,8 @@ plotpoint (image_t *image, long xco, long yco, unsigned int color)
{
unsigned int bigcol = 0;
if (xco < 0 || xco > image->width || yco < 0 || yco > image->height)
if (image->width < 0 || image->height < 0
|| xco < 0 || xco > image->width || yco < 0 || yco > image->height)
return;
bigcol = (unsigned int) image->image[yco * image->width + xco];

View file

@ -116,7 +116,7 @@ FindTexinfo (texinfo_t *t)
continue;
for (j = 0; j < 8; j++)
if (t->vecs[0][j] != tex->vecs[0][j])
if (t->vecs[j / 4][j % 4] != tex->vecs[j / 4][j % 4])
break;
if (j != 8)
continue;

View file

@ -55,7 +55,7 @@ face to region mapping numbers
int firstedge;
vec3_t region_mins, region_maxs;
/*
static void
AddPointToRegion (vec3_t p)
{
@ -157,7 +157,7 @@ RecursiveGrowRegion (dface_t *r, face_t *f)
}
}
*/
int edgemapping[MAX_MAP_EDGES];
typedef struct {

View file

@ -2319,7 +2319,7 @@ address_expr (expr_t *e1, expr_t *e2, type_t *t)
return e;
}
static inline int
static int
is_indirect (expr_t *e)
{
if (e->type == ex_expr && e->e.expr.op == '.')

View file

@ -695,7 +695,8 @@ line_info (char *text)
}
#ifdef YY_FLEX_REALLOC_HACK
static __attribute__ ((unused)) void *(*const yy_flex_realloc_hack)(void *,yy_size_t) = yy_flex_realloc;
static __attribute__ ((used)) void *(*const yy_flex_realloc_hack)(void *,yy_size_t) = yy_flex_realloc;
#else
static __attribute__ ((unused)) void (*yyunput_hack)(int, char*) = yyunput;
static __attribute__ ((used)) void (*yyunput_hack)(int, char*) = yyunput;
static __attribute__ ((used)) int (*input_hack)(void) = input;
#endif

View file

@ -74,8 +74,8 @@ LoadTriangleList (char *filename, triangle_t **pptri, int *numtriangles)
{
QFile *input;
char name[256], tex[256];
float start, t;
int count, exitpattern, iLevel, magic, i;
float start, exitpattern, t;
int count, iLevel, magic, i;
tf_triangle tri;
triangle_t *ptri;
@ -105,8 +105,8 @@ LoadTriangleList (char *filename, triangle_t **pptri, int *numtriangles)
while (Qeof(input) == 0) {
Qread(input, &start, sizeof (float));
*(int *) (char *) &start = BigLong (*(int *) (char *) &start);
if (*(int *) (char *) &start != exitpattern) {
start = BigFloat (start);
if (start != exitpattern) {
if (start == FLOAT_START) {
// Start of an object or group of objects.
i = -1;