Fix a bunch of bit-rot.

This commit is contained in:
Bill Currie 2018-06-08 13:21:30 +09:00
parent f522e58d53
commit 0de0eb2fc7
8 changed files with 15 additions and 11 deletions

View file

@ -74,9 +74,9 @@ AH_VERBATIM([HAVE___ATTRIBUTE__GCC_STRUCT],
#endif])
AC_MSG_CHECKING(for __builtin_expect)
AC_TRY_COMPILE(
[long (*foo) (long, long) = __builtin_expect;],
[],
AC_TRY_LINK(
[int x;],
[if (__builtin_expect(!x, 1)) {}],
AC_DEFINE(HAVE___BUILTIN_EXPECT)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)

View file

@ -346,8 +346,8 @@ typedef union pr_type_u {
string_t string_var;
func_t func_var;
pr_int_t entity_var;
float vector_var[1]; // really 3, but this structure must be 32 bits
float quat_var[1]; // really 4, but this structure must be 32 bits
float vector_var[0]; // really 3, but this structure must be 32 bits
float quat_var[0]; // really 4, but this structure must be 32 bits
pr_int_t integer_var;
pointer_t pointer_var;
pr_uint_t uinteger_var;

View file

@ -221,7 +221,7 @@ struct edict_s {
int entnum; ///< number of this entity
float freetime; ///< sv.time when the object was freed
void *edata; ///< external per-edict data
pr_type_t v[1]; ///< fields from progs
pr_type_t v[]; ///< fields from progs
};
// pr_edict.c

View file

@ -177,7 +177,7 @@ PR_LoadProgsFile (progs_t *pr, QFile *file, int size, int max_edicts, int zone)
// size of edict asked for by progs
pr->pr_edict_size = max (1, progs.entityfields) * 4;
// size of engine data
pr->pr_edict_size += sizeof (edict_t) - sizeof (pr_type_t);
pr->pr_edict_size += sizeof (edict_t);
// round off to next highest whole word address (esp for Alpha)
// this ensures that pointers in the engine data area are always
// properly aligned

View file

@ -98,11 +98,13 @@ loaded_plugin_delete (void *lp, void *unused)
static int
pi_close_lib (void *handle)
{
if (handle) {
#if defined(HAVE_DLOPEN)
return (dlclose (handle) == 0);
return (dlclose (handle) == 0);
#elif defined (_WIN32)
return (FreeLibrary (handle) == 0);
return (FreeLibrary (handle) == 0);
#endif
}
return 1;
}

View file

@ -45,7 +45,7 @@ server_t sv;
server_static_t svs;
double sv_frametime;
char localmodels[MAX_MODELS][5]; // inline model names for precache
char localmodels[MAX_MODELS][6]; // inline model names for precache
int sv_protocol = PROTOCOL_FITZQUAKE;

View file

@ -348,7 +348,7 @@ gettoklen (char *str, int req, char delim)
int len = 0;
start = gettokstart (str, req, delim);
if (start == '\0') {
if (*start == '\0') {
return 0;
}
while (*start != delim && *start != '\0') {

View file

@ -296,7 +296,9 @@ convert_relop (const char *relop)
#ifdef YY_FLEX_REALLOC_HACK
static __attribute__ ((used)) void *(*const yy_flex_realloc_hack)(void *,yy_size_t) = yy_flex_realloc;
#else
#ifdef yyunput
static __attribute__ ((used)) void (*yyunput_hack)(int, char*) = yyunput;
#endif
static __attribute__ ((used)) int (*input_hack)(void) = input;
#endif