#endif
#include "time.h"
+// I put the following here to resolve "undefined reference to `__imp__vsnprintf'" with MinGW64 ~ Moodles
+#ifdef __MINGW64__
+#ifndef QCCONLY
+ #if (_MSC_VER >= 1400)
+ //with MSVC 8, use MS extensions
+ #define snprintf linuxlike_snprintf_vc8
+ int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...) LIKEPRINTF(3);
+ #define vsnprintf(a, b, c, d) vsnprintf_s(a, b, _TRUNCATE, c, d)
+ #else
+ //msvc crap
+ #define snprintf linuxlike_snprintf
+ int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3);
+ #define vsnprintf linuxlike_vsnprintf
+ int VARGS linuxlike_vsnprintf(char *buffer, int size, const char *format, va_list argptr);
+ #endif
+#endif
+#endif
+
#define MEMBERFIELDNAME "__m%s"
#define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1+1,s2+1)) //saves about 2-6 out of 120 - expansion of idea from fastqcc
//also meant to include it.
void QCC_FindBestInclude(char *newfile, char *currentfile, char *rootpath)
{
- char fullname[10248];
- char *stripfrom;
+ char fullname[1024];
int doubledots;
char *end = fullname;
return;
doubledots = 0;
+ /*count how far up we need to go*/
while(!strncmp(newfile, "../", 3) || !strncmp(newfile, "..\\", 3))
{
newfile+=3;
currentfile += strlen(rootpath); //could this be bad?
- for(stripfrom = currentfile+strlen(currentfile)-1; stripfrom>currentfile; stripfrom--)
+ strcpy(fullname, rootpath);
+ end = fullname+strlen(end);
+ if (*fullname && end[-1] != '/')
+ {
+ strcpy(end, "/");
+ end = end+strlen(end);
+ }
+ strcpy(end, currentfile);
+ end = end+strlen(end);
+
+ while (end > fullname)
{
- if (*stripfrom == '/' || *stripfrom == '\\')
+ end--;
+ /*stop at the slash, unless we're meant to go further*/
+ if (*end == '/' || *end == '\\')
{
- if (doubledots>0)
- doubledots--;
- else
+ if (!doubledots)
{
- stripfrom++;
+ end++;
break;
}
+ doubledots--;
}
}
- strcpy(end, rootpath); end = end+strlen(end);
- if (*fullname && end[-1] != '/')
- {
- strcpy(end, "/");
- end = end+strlen(end);
- }
- strncpy(end, currentfile, stripfrom - currentfile); end += stripfrom - currentfile; *end = '\0';
+
strcpy(end, newfile);
QCC_Include(fullname);
}
+pbool defaultnoref;
pbool defaultstatic;
int ForcedCRC;
int QCC_PR_LexInteger (void);
int ParsePrecompilerIf(void)
{
CompilerConstant_t *c;
- int eval;
- char *start = pr_file_p;
+ int eval = 0;
+ //char *start = pr_file_p; //warning: unused variable âstartâ
if (!QCC_PR_SimpleGetToken())
- {
+ {
if (*pr_file_p == '(')
{
eval = ParsePrecompilerIf();
eval = true;
if (ifmode == 1)
- eval = eval?false:true;
+ eval = eval?false:true;
}
while(*pr_file_p != '\n' && *pr_file_p != '\0') //read on until the end of the line
}
}
else if (!strncmp(directive, "endif", 5))
- {
+ {
while(*pr_file_p != '\n' && *pr_file_p != '\0') //read on until the end of the line
{
pr_file_p++;
- }
+ }
if (ifs <= 0)
QCC_PR_ParseError(ERR_NOPRECOMPILERIF, "unmatched #endif");
else
return true;
}
else if (!strncmp(directive, "error", 5))
- {
+ {
pr_file_p = directive+5;
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
QCC_PR_ParseError(ERR_HASHERROR, "#Error: %s", msg);
}
else if (!strncmp(directive, "warning", 7))
- {
+ {
pr_file_p = directive+7;
for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
QCC_PR_ParseWarning(WARN_PRECOMPILERMESSAGE, "#warning: %s", msg);
}
else if (!strncmp(directive, "message", 7))
- {
+ {
pr_file_p = directive+7;
for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
else if (!strncmp(directive, "copyright", 9))
{
pr_file_p = directive+9;
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
pr_file_p=directive+4;
if (!strncmp(pr_file_p, "id", 2))
pr_file_p+=3;
- else
+ else
{
- ifmode = QCC_PR_LexInteger();
+ ifmode = QCC_PR_LexInteger();
if (ifmode == 0)
ifmode = 1;
pr_file_p++;
}
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
else if (ifmode <= 5)
strcpy(QCC_Packname[ifmode-1], msg);
else
- QCC_PR_ParseError(ERR_TOOMANYPACKFILES, "No more than 5 packs are allowed");
+ QCC_PR_ParseError(ERR_TOOMANYPACKFILES, "No more than 5 packs are allowed");
}
else if (!strncmp(directive, "forcecrc", 8))
- {
+ {
pr_file_p=directive+8;
- ForcedCRC = QCC_PR_LexInteger();
+ ForcedCRC = QCC_PR_LexInteger();
pr_file_p++;
-
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
while(*pr_file_p != '\n' && *pr_file_p != '\0') //read on until the end of the line
{
pr_file_p++;
- }
+ }
}
else if (!strncmp(directive, "includelist", 11))
{
if (*pr_file_p == '\r')
pr_file_p++;
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
pr_file_p++;
}
}
-
+
while(*pr_file_p != '\n' && *pr_file_p != '\0') //read on until the end of the line
{
pr_file_p++;
{
if (*pr_file_p == '\n')
{
- QCC_PR_ParseError(0, "#include continued over line boundy\n");
+ QCC_PR_ParseError(0, "#include continued over line boundry\n");
break;
}
msg[a++] = *pr_file_p;
}
}
else if (!strncmp(directive, "datafile", 8))
- {
+ {
pr_file_p=directive+8;
while(*pr_file_p <= ' ')
pr_file_p++;
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
printf("Outputfile: %s\n", destfile);
pr_file_p++;
-
- for (a = 0; a < 1023 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
+
+ for (a = 0; a < sizeof(msg)-1 && pr_file_p[a] != '\n' && pr_file_p[a] != '\0'; a++)
msg[a] = pr_file_p[a];
msg[a-1] = '\0';
}
msg[a++] = *pr_file_p;
}
-
+
msg[a] = '\0';
{
char *end;
{
ForcedCRC = atoi(msg);
}
+ else if (!strncmp(qcc_token, "noref", 8))
+ {
+ defaultnoref = atoi(msg);
+ }
else if (!strncmp(qcc_token, "defaultstatic", 13))
{
defaultstatic = atoi(msg);
{
#define MAXSOURCEFILESLIST 8
extern char sourcefileslist[MAXSOURCEFILESLIST][1024];
- extern int currentsourcefile;
+ //extern int currentsourcefile; // warning: unused variable âcurrentsourcefileâ
extern int numsourcefiles;
int i;
qcc_targetformat = QCF_STANDARD;
else if (!QC_strcasecmp(msg, "DEBUG"))
qcc_targetformat = QCF_FTEDEBUG;
+ else if (!QC_strcasecmp(msg, "QTEST"))
+ qcc_targetformat = QCF_QTEST;
else
QCC_PR_ParseWarning(WARN_BADTARGET, "Unknown target \'%s\'. Ignored.", msg);
}
#ifndef QCCONLY
p=0;
- s2 = qcc_token;
+ s2 = qcc_token;
if (!strncmp(s2, "./", 2))
s2+=2;
else
int c;
int len;
char tmpbuf[2048];
-
+
char *text;
char *oldf;
int oldline;
pr_file_p = oldf-1;
QCC_PR_LexWhitespace();
if (*pr_file_p != '\"') //annother string
- break;
+ break;
}
QCC_PR_LexWhitespace();
- text = pr_file_p;
-
+ text = pr_file_p;
+
} while (1);
strcpy(pr_token, tmpbuf);
char *end, *cnst;
int texttype=0;
-
+
len = 0;
pr_file_p++;
do
pr_token[len] = 0;
pr_token_type = tt_immediate;
pr_immediate_type = type_string;
- strcpy (pr_immediate_string, pr_token);
+ strcpy (pr_immediate_string, pr_token);
return;
}
else if (c == '#')
{
int c;
int len;
-
+
len = 0;
c = *pr_file_p;
if (pr_file_p[0] == '0' && pr_file_p[1] == 'x')
base = 10;
while((c = *pr_file_p))
- {
+ {
if (c >= '0' && c <= '9')
{
pr_token[tokenlen++] = c;
break;
}
else
- {
+ {
break;
}
pr_file_p++;
{
int c;
int len;
-
+
len = 0;
c = *pr_file_p;
do
void QCC_PR_LexVector (void)
{
int i;
-
+
pr_file_p++;
if (*pr_file_p == '\\')
{
int c;
int len;
-
+
len = 0;
c = *pr_file_p;
do
len++;
pr_file_p++;
c = *pr_file_p;
- } while ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'
- || (c >= '0' && c <= '9'));
+ } while ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'
+ || (c >= '0' && c <= '9'));
pr_token[len] = 0;
- pr_token_type = tt_name;
+ pr_token_type = tt_name;
}
/*
int i;
int len;
char *p;
-
+
pr_token_type = tt_punct;
-
+
for (i=0 ; (p = pr_punctuation[i]) != NULL ; i++)
{
len = strlen(p);
return;
}
}
-
+
QCC_PR_ParseError (ERR_UNKNOWNPUCTUATION, "Unknown punctuation");
}
-
+
/*
==============
PR_LexWhitespace
void QCC_PR_LexWhitespace (void)
{
int c;
-
+
while (1)
{
// skip whitespace
pr_file_p++;
}
}
-
+
// skip // comments
if (c=='/' && pr_file_p[1] == '/')
{
QCC_PR_NewLine(false);
continue;
}
-
+
// skip /* */ comments
if (c=='/' && pr_file_p[1] == '*')
{
pr_file_p+=2;
continue;
}
-
+
break; // a real character has been found
}
}
==============
*/
void QCC_PR_LexGrab (void)
-{
+{
pr_file_p++; // skip the $
// if (!QCC_PR_SimpleGetToken ())
// QCC_PR_ParseError ("hanging $");
QCC_PR_LexMacroName();
if (!*pr_token)
QCC_PR_ParseError (ERR_BADFRAMEMACRO, "hanging $");
-
+
// check for $frame
if (!STRCMP (pr_token, "frame") || !STRCMP (pr_token, "framesave"))
{
{
QCC_PR_LexMacroName ();
pr_macrovalue = atoi(pr_token);
-
+
QCC_PR_Lex ();
}
else if (!STRCMP (pr_token, "framerestore"))
QCC_PR_LexMacroName ();
QCC_PR_ExpandMacro();
pr_macrovalue = (int)pr_immediate._float;
-
+
QCC_PR_Lex ();
}
else if (!STRCMP (pr_token, "modelname"))
pr_macrovalue = i;
else
i = 0;
-
+
QCC_PR_Lex ();
}
// look for a frame name macro
Hash_Remove(&compconstantstable, name);
return true;
- /*
- a = c-CompilerConstant;
-// for (a = 0; a < numCompilerConstants; a++)
- {
-// if (!STRCMP(name, CompilerConstant[a].name))
- {
- memmove(&CompilerConstant[a], &CompilerConstant[a+1], sizeof(CompilerConstant_t) * (numCompilerConstants-a));
- numCompilerConstants--;
-
-
-
-
- if (!STRCMP(name, "OP_NODUP"))
- qccop_noduplicatestrings = false;
-
- if (!STRCMP(name, "OP_COMP_ALL")) //group
- {
- QCC_PR_UndefineName("OP_COMP_STATEMENTS");
- QCC_PR_UndefineName("OP_COMP_DEFS");
- QCC_PR_UndefineName("OP_COMP_FIELDS");
- QCC_PR_UndefineName("OP_COMP_FUNCTIONS");
- QCC_PR_UndefineName("OP_COMP_STRINGS");
- QCC_PR_UndefineName("OP_COMP_GLOBALS");
- QCC_PR_UndefineName("OP_COMP_LINES");
- QCC_PR_UndefineName("OP_COMP_TYPES");
- }
-
- return true;
- }
- }
-// return false;
-*/
}
CompilerConstant_t *QCC_PR_DefineName(char *name)
// QCC_PR_ParseError("Too many compiler constants - %i >= %i", numCompilerConstants, MAX_CONSTANTS);
if (strlen(name) >= MAXCONSTANTLENGTH || !*name)
- QCC_PR_ParseError(ERR_CONSTANTTOOLONG, "Compiler constant name length is too long or short");
-
+ QCC_PR_ParseError(ERR_NAMETOOLONG, "Compiler constant name length is too long or short");
+
cnst = pHash_Get(&compconstantstable, name);
- if (cnst )
+ if (cnst)
{
QCC_PR_ParseWarning(WARN_DUPLICATEDEFINITION, "Duplicate definition for Precompiler constant %s", name);
Hash_Remove(&compconstantstable, name);
cnst->numparams = 0;
strcpy(cnst->name, name);
cnst->namelen = strlen(name);
- *cnst->value = '\0';
+ cnst->value = cnst->name + strlen(cnst->name);
for (i = 0; i < MAXCONSTANTPARAMS; i++)
cnst->params[i][0] = '\0';
pHash_Add(&compconstantstable, cnst->name, cnst, qccHunkAlloc(sizeof(bucket_t)));
- if (!STRCMP(name, "OP_NODUP"))
- opt_noduplicatestrings = true;
-
-
- if (!STRCMP(name, "OP_TIME")) //group - optimize for a fast compiler
- {
- QCC_PR_UndefineName("OP_SIZE");
- QCC_PR_UndefineName("OP_SPEED");
-
- QCC_PR_UndefineName("OP_NODUP");
- QCC_PR_UndefineName("OP_COMP_ALL");
- }
-
- if (!STRCMP(name, "OP_SPEED")) //group - optimize run speed
- {
- QCC_PR_UndefineName("OP_SIZE");
- QCC_PR_UndefineName("OP_TIME");
-
-// QCC_PR_UndefineName("OP_NODUP");
- QCC_PR_UndefineName("OP_COMP_ALL");
- }
-
- if (!STRCMP(name, "OP_SIZE")) //group - produce small output.
- {
- QCC_PR_UndefineName("OP_SPEED");
- QCC_PR_UndefineName("OP_TIME");
-
- QCC_PR_DefineName("OP_NODUP");
- QCC_PR_DefineName("OP_COMP_ALL");
- }
-
- if (!STRCMP(name, "OP_COMP_ALL")) //group - compress the output
- {
- QCC_PR_DefineName("OP_COMP_STATEMENTS");
- QCC_PR_DefineName("OP_COMP_DEFS");
- QCC_PR_DefineName("OP_COMP_FIELDS");
- QCC_PR_DefineName("OP_COMP_FUNCTIONS");
- QCC_PR_DefineName("OP_COMP_STRINGS");
- QCC_PR_DefineName("OP_COMP_GLOBALS");
- QCC_PR_DefineName("OP_COMP_LINES");
- QCC_PR_DefineName("OP_COMP_TYPES");
- }
-
-
-
return cnst;
}
{
char *oldval;
char *d;
+ char *dbuf;
+ int dbuflen;
char *s;
int quote=false;
CompilerConstant_t *cnst;
QCC_PR_SimpleGetToken ();
- if (!QCC_PR_SimpleGetToken ())
+ if (!QCC_PR_SimpleGetToken ())
QCC_PR_ParseError(ERR_NONAME, "No name defined for compiler constant");
cnst = pHash_Get(&compconstantstable, pr_token);
else cnst->numparams = -1;
s = pr_file_p;
- d = cnst->value;
+ d = dbuf = NULL;
+ dbuflen = 0;
while(*s == ' ' || *s == '\t')
s++;
while(1)
{
+ if ((d - dbuf) + 2 >= dbuflen)
+ {
+ int len = d - dbuf;
+ dbuflen = (len+128) * 2;
+ dbuf = qccHunkAlloc(dbuflen);
+ memcpy(dbuf, d - len, len);
+ d = dbuf + len;
+ }
+
if( *s == '\\' )
{
// read over a newline if necessary
*d++ = *s++;
}
}
- }
+ }
else if(*s == '\r' || *s == '\n' || *s == '\0')
{
break;
s++;
}
*d = '\0';
- d--;
- while(*d<= ' ' && d >= cnst->value)
- *d-- = '\0';
- if (strlen(cnst->value) >= sizeof(cnst->value)) //this is too late.
- QCC_PR_ParseError(ERR_CONSTANTTOOLONG, "Macro %s too long (%i not %i)", cnst->name, strlen(cnst->value), sizeof(cnst->value));
+
+ cnst->value = dbuf;
if (oldval)
{ //we always warn if it was already defined
return true;
}
if (!strncmp(pr_file_p, "__FILE__", 8))
- {
+ {
static char retbuf[256];
sprintf(retbuf, "\"%s\"", strings + s_file);
pr_file_p = retbuf;
return true;
}
if (!strncmp(pr_file_p, "__FUNC__", 8))
- {
+ {
static char retbuf[256];
sprintf(retbuf, "\"%s\"",pr_scope->name);
pr_file_p = retbuf;
char *QCC_PR_CheakCompConstString(char *def)
{
char *s;
-
+
CompilerConstant_t *c;
c = pHash_Get(&compconstantstable, def);
- if (c)
+ if (c)
{
s = QCC_PR_CheakCompConstString(c->value);
return s;
{
CompilerConstant_t *c = pHash_Get(&compconstantstable, def);
return c;
- /*int a;
- for (a = 0; a < numCompilerConstants; a++)
- {
- if (!strncmp(def, CompilerConstant[a].name, CompilerConstant[a].namelen+1))
- return &CompilerConstant[a];
- }
- return NULL;
- */
}
//============================================================================
int c;
pr_token[0] = 0;
-
+
if (!pr_file_p)
{
if (QCC_PR_UnInclude())
- {
+ {
QCC_PR_Lex();
return;
}
if (!pr_file_p)
{
if (QCC_PR_UnInclude())
- {
+ {
QCC_PR_Lex();
return;
}
}
c = *pr_file_p;
-
+
if (!c)
{
if (QCC_PR_UnInclude())
- {
+ {
QCC_PR_Lex();
return;
}
return;
}
-
+
if ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' )
{
if (flag_hashonly || !QCC_PR_CheakCompConst()) //look for a macro.
if (pr_token_type == tt_eof)
{
if (QCC_PR_UnInclude())
- {
+ {
QCC_PR_Lex();
return;
}
}
return;
}
-
+
if (c == '$')
{
QCC_PR_LexGrab ();
return;
}
-
+
// parse symbol strings until a non-symbol is found
QCC_PR_LexPunctuation ();
}
printf ("%s(%i) : error: %s\n", strings + s_file, pr_source_line, string);
else
printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string);
-
+
longjmp (pr_parse_abort, 1);
}
void VARGS QCC_PR_ParseErrorPrintDef (int errortype, QCC_def_t *def, char *error, ...)
printf ("%s:%i: error: %s\n", strings + s_file, pr_source_line, string);
QCC_PR_ParsePrintDef(WARN_ERROR, def);
-
+
longjmp (pr_parse_abort, 1);
}
void VARGS QCC_PR_ParseWarning (int type, char *error, ...)
}
}
+void VARGS QCC_PR_Note (int type, char *file, int line, char *error, ...)
+{
+ va_list argptr;
+ char string[1024];
+
+ if (qccwarningdisabled[type])
+ return;
+
+ va_start (argptr,error);
+ QC_vsnprintf (string,sizeof(string)-1, error,argptr);
+ va_end (argptr);
+
+ QCC_PR_PrintScope();
+ if (file)
+ {
+ if (flag_msvcstyle)
+ printf ("%s(%i) : note: %s\n", file, line, string);
+ else
+ printf ("%s:%i: note: %s\n", file, line, string);
+ }
+ else
+ printf ("note: %s\n", string);
+}
+
void VARGS QCC_PR_Warning (int type, char *file, int line, char *error, ...)
{
va_list argptr;
if (STRCMP (string, pr_token))
return false;
-
+
QCC_PR_Lex ();
return true;
}
if (STRCMP (string, pr_token))
return false;
-
+
QCC_PR_Lex ();
return true;
}
{
if (pr_token_type != tt_name)
return false;
- if (flag_caseinsensative)
+ if (flag_caseinsensative)
{
if (stricmp (string, pr_token))
return false;
{
if (!keywordenabled)
return false;
- if (flag_caseinsensative)
+ if (flag_caseinsensative)
{
if (stricmp (string, pr_token))
return false;
{
static char ident[MAX_NAME];
char *ret;
-
+
if (pr_token_type != tt_name)
- QCC_PR_ParseError (ERR_NOTANAME, "\"%s\" - not a name", pr_token);
+ QCC_PR_ParseError (ERR_NOTANAME, "\"%s\" - not a name", pr_token);
if (strlen(pr_token) >= MAX_NAME-1)
QCC_PR_ParseError (ERR_NAMETOOLONG, "name too long");
strcpy (ident, pr_token);
QCC_PR_Lex ();
-
+
ret = qccHunkAlloc(strlen(ident)+1);
strcpy(ret, ident);
return ret;
// check = &qcc_typeinfo[t];
if (typecmp(&qcc_typeinfo[t], type))
continue;
-
+
// c2 = check->next;
// n2 = type->next;
strcpy (pr_parm_names[ftype->num_parms], "");
ftype->num_parms++;
} while (QCC_PR_CheckToken (","));
-
+
QCC_PR_Expect (")");
}
recursivefunctiontype--;
strcpy (pr_parm_names[ftype->num_parms], name);
ftype->num_parms++;
} while (QCC_PR_CheckToken (";"));
-
+
QCC_PR_Expect (")");
}
recursivefunctiontype--;
{
newt = &qcc_typeinfo[i];
break;
- }
+ }
}
if (newt && forwarddeclaration)
return NULL;
}
-
+
if (QCC_PR_CheckToken(":"))
{
newt = QCC_PR_NewType("union", ev_union);
newt->size=0;
QCC_PR_Expect("{");
-
+
type = NULL;
if (QCC_PR_CheckToken(","))
QCC_PR_ParseError(ERR_NOTANAME, "element missing name");
if (newparm->size > newt->size)
newt->size = newparm->size;
newt->num_parms++;
-
+
if (type)
type->next = newparm;
else
}
}
QCC_PR_Lex ();
-
+
if (QCC_PR_CheckToken ("(")) //this is followed by parameters. Must be a function.
{
type_inlinefunction = true;
{
if (newtype)
{
- type = QCC_PR_DuplicateType(type);
+ type = QCC_PR_DuplicateType(type);
}
return type;