1
0
Fork 0
forked from fte/fteqw

Try to fix some compile errors with xonotic.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5306 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-09-18 02:05:35 +00:00
parent c822482854
commit 44850dec4e
5 changed files with 28 additions and 9 deletions

View file

@ -435,7 +435,7 @@ unsigned int PDECL QC_NUM_FOR_EDICT(pubprogfuncs_t *progfuncs, struct edict_s *e
#define E_VECTOR(e,o) (&((float*)&e->v)[o])
#define E_STRING(e,o) (*(string_t *)&((float*)(e+1))[o])
const extern unsigned int type_size[];
extern const unsigned int type_size[];
extern unsigned short pr_crc;

View file

@ -475,7 +475,7 @@ extern char QCC_copyright[1024];
extern char QCC_Packname[5][128];
extern int QCC_packid;
const extern unsigned int type_size[];
extern const unsigned int type_size[];
//extern QCC_def_t *def_for_type[9];
extern QCC_type_t *type_void, *type_string, *type_float, *type_vector, *type_entity, *type_field, *type_function, *type_floatfunction, *type_pointer, *type_floatpointer, *type_intpointer, *type_integer, *type_variant, *type_floatfield;

View file

@ -4519,7 +4519,7 @@ void QCC_VerifyFormatString (const char *funcname, QCC_ref_t **arglist, unsigned
char *err;
int width, thisarg, arg;
char formatbuf[16];
int argpos = firstarg;
int argpos = firstarg, argn_last = firstarg;
int isfloat;
const QCC_eval_t *formatstring = QCC_SRef_EvalConst(arglist[0]->base);
if (!formatstring) //can't check variables.
@ -4529,6 +4529,7 @@ void QCC_VerifyFormatString (const char *funcname, QCC_ref_t **arglist, unsigned
s = strings + formatstring->string;
#define ARGTYPE(a) (((a)>=firstarg && (a)<argcount) ? (arglist[a]->cast->type) : ev_void)
#define ARGCTYPE(a) (((a)>=firstarg && (a)<argcount) ? (arglist[a]->cast) : type_void)
for(;;)
{
@ -4536,7 +4537,7 @@ void QCC_VerifyFormatString (const char *funcname, QCC_ref_t **arglist, unsigned
switch(*s)
{
case 0:
if (argpos < argcount)
if (argpos < argcount && argn_last < argcount)
QCC_PR_ParseWarning(WARN_FORMATSTRING, "%s: surplus trailing arguments", funcname);
return;
case '%':
@ -4707,6 +4708,8 @@ nolength:
if(thisarg < 0)
thisarg = argpos++;
if (argn_last < thisarg+1)
argn_last = thisarg+1;
memcpy(formatbuf, s0, s+1-s0);
formatbuf[s+1-s0] = 0;
@ -4725,7 +4728,11 @@ nolength:
case ev_variant:
break;
default:
QCC_PR_ParseWarning(WARN_FORMATSTRING, "%s: %s requires float at arg %i", funcname, formatbuf, thisarg+1);
{
char typename[256];
TypeName(ARGCTYPE(thisarg), typename, sizeof(typename));
QCC_PR_ParseWarning(WARN_FORMATSTRING, "%s: %s requires float at arg %i (got %s)", funcname, formatbuf, thisarg+1, typename);
}
break;
}
}
@ -14731,7 +14738,6 @@ void QCC_PR_ParseDefs (char *classname, pbool fatal)
QCC_def_t *def, *d;
QCC_sref_t dynlength;
QCC_function_t *f;
// int i = 0; // warning: i may be used uninitialized in this function
pbool shared=false;
pbool isstatic=defaultstatic;
pbool externfnc=false;
@ -15019,6 +15025,8 @@ void QCC_PR_ParseDefs (char *classname, pbool fatal)
QCC_PR_ParseWarning(WARN_GMQCC_SPECIFIC, "accumulating an accumulating accumulation");
accumulate = true;
}
else if (QCC_PR_CheckName("eraseable"))
noref = true;
else
{
QCC_PR_ParseWarning(WARN_GMQCC_SPECIFIC, "Unknown attribute \"%s\"", pr_token);
@ -15492,7 +15500,12 @@ void QCC_PR_ParseDefs (char *classname, pbool fatal)
QCC_PR_ParsePrintDef(WARN_REDECLARATIONMISMATCH, def);
}
}
if (accumulate)
{
if (def->initialized)
QCC_PR_ParseWarning(WARN_GMQCC_SPECIFIC, "%s redeclared to accumulate after initial declaration", def->name);
def->accumulate |= true;
}
if (dostrip)
def->referenced = true;

View file

@ -1298,7 +1298,6 @@ pbool QCC_PR_Precompiler(void)
{
#define MAXSOURCEFILESLIST 8
extern char sourcefileslist[MAXSOURCEFILESLIST][1024];
//extern int currentsourcefile; // warning: unused variable âcurrentsourcefileâ
extern int numsourcefiles;
int i;

View file

@ -4252,7 +4252,14 @@ void QCC_PR_CommandLinePrecompilerOptions (void)
else if (!stricmp(arg, "true-empty-strings"))
flag_brokenifstring = state;
else if (!stricmp(arg, "lno"))
; //currently we always try to write lno files...
{
//currently we always try to write lno files, when filename info isn't stripped
if (opt_filenames)
{
QCC_PR_Warning(0, NULL, WARN_BADPARAMS, "Disabling -Ofilenames to satisfy -flno request");
opt_filenames = false;
}
}
else if (!stricmp(arg, "utf8"))
; //we always interpret input as utf-8, and thus output strings are 'utf-8' too. -fno-utf8 might be useful to asciify inputs, but that'll just break quake-encoded text, so why bother
else if (!stricmp(arg, "return-assignments"))