Small bug fixes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@983 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
a2cb6abac0
commit
8eaac6ced3
5 changed files with 33 additions and 13 deletions
|
@ -2,7 +2,8 @@ QCC_OBJS=qccmain.o qcc_cmdlib.o qcc_pr_comp.o qcc_pr_lex.o comprout.o hash.o qcd
|
||||||
GTKGUI_OBJS=qcc_gtk.o qccguistuff.c
|
GTKGUI_OBJS=qcc_gtk.o qccguistuff.c
|
||||||
|
|
||||||
CC=gcc -Wall -DQCCONLY
|
CC=gcc -Wall -DQCCONLY
|
||||||
DO_CC=$(CC) $(BASE_CFLAGS) -DUSEGUI -o $@ -c $< $(CFLAGS) `pkg-config --cflags gtk+-2.0`
|
|
||||||
|
DO_CC=$(CC) $(BASE_CFLAGS) -DUSEGUI -o $@ -c $< $(CFLAGS)
|
||||||
|
|
||||||
all: qcc
|
all: qcc
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ qccguistuff.o: qccguistuff.c qcc.h
|
||||||
$(DO_CC)
|
$(DO_CC)
|
||||||
|
|
||||||
qcc_gtk.o: qcc_gtk.c qcc.h
|
qcc_gtk.o: qcc_gtk.c qcc.h
|
||||||
$(DO_CC)
|
$(DO_CC) `pkg-config --cflags gtk+-2.0`
|
||||||
|
|
||||||
gtkgui: $(QCC_OBJS) $(GTKGUI_OBJS)
|
gtkgui: $(QCC_OBJS) $(GTKGUI_OBJS)
|
||||||
$(CC) $(BASE_CFLAGS) -DQCCONLY -DUSEGUI -o fteqccgui.bin -O3 $(GTKGUI_OBJS) $(QCC_OBJS) `pkg-config --libs gtk+-2.0`
|
$(CC) $(BASE_CFLAGS) -DQCCONLY -DUSEGUI -o fteqccgui.bin -O3 $(GTKGUI_OBJS) $(QCC_OBJS) `pkg-config --libs gtk+-2.0`
|
|
@ -56,7 +56,7 @@ pbool PreCompile(void)
|
||||||
{
|
{
|
||||||
qccClearHunk();
|
qccClearHunk();
|
||||||
strcpy(qcc_gamedir, "");
|
strcpy(qcc_gamedir, "");
|
||||||
qcchunk = malloc(qcchunksize=32*1024*1024);
|
qcchunk = malloc(qcchunksize=64*1024*1024);
|
||||||
qccalloced=0;
|
qccalloced=0;
|
||||||
|
|
||||||
return !!qcchunk;
|
return !!qcchunk;
|
||||||
|
|
|
@ -1081,7 +1081,7 @@ static void QCC_RemapLockedTemps(int firststatement, int laststatement)
|
||||||
t = functemps;
|
t = functemps;
|
||||||
while(t)
|
while(t)
|
||||||
{
|
{
|
||||||
if (t->scope)
|
if (t->scope || opt_locals_marshalling)
|
||||||
{
|
{
|
||||||
QCC_RemapLockedTemp(t, firststatement, laststatement);
|
QCC_RemapLockedTemp(t, firststatement, laststatement);
|
||||||
t->scope = NULL;
|
t->scope = NULL;
|
||||||
|
@ -6009,7 +6009,12 @@ void QCC_Marshal_Locals(int first, int laststatement)
|
||||||
unsigned int newofs;
|
unsigned int newofs;
|
||||||
|
|
||||||
if (!opt_overlaptemps) //clear these after each function. we arn't overlapping them so why do we need to keep track of them?
|
if (!opt_overlaptemps) //clear these after each function. we arn't overlapping them so why do we need to keep track of them?
|
||||||
|
{
|
||||||
|
temp_t *t;
|
||||||
|
for (t = functemps; t; t = t->next)
|
||||||
|
QCC_FreeOffset(t->ofs, t->size);
|
||||||
functemps = NULL;
|
functemps = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pr.localvars) //nothing to marshal
|
if (!pr.localvars) //nothing to marshal
|
||||||
{
|
{
|
||||||
|
@ -6053,6 +6058,9 @@ void QCC_Marshal_Locals(int first, int laststatement)
|
||||||
if (local->constant)
|
if (local->constant)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (((int*)qcc_pr_globals)[local->ofs])
|
||||||
|
QCC_PR_ParseError(ERR_INTERNAL, "Marshall of a set value");
|
||||||
|
|
||||||
newofs -= local->type->size*local->arraysize;
|
newofs -= local->type->size*local->arraysize;
|
||||||
if (local->arraysize>1)
|
if (local->arraysize>1)
|
||||||
newofs--;
|
newofs--;
|
||||||
|
@ -6787,6 +6795,7 @@ QCC_def_t *QCC_PR_DummyDef(QCC_type_t *type, char *name, QCC_def_t *scope, int a
|
||||||
case ev_integer:
|
case ev_integer:
|
||||||
case ev_struct:
|
case ev_struct:
|
||||||
case ev_union:
|
case ev_union:
|
||||||
|
case ev_variant: //for lack of any better alternative
|
||||||
sprintf(newname, "%s%s.%s", name, array, parttype->name);
|
sprintf(newname, "%s%s.%s", name, array, parttype->name);
|
||||||
QCC_PR_DummyDef(parttype, newname, scope, 1, ofs + type->size*a + parttype->ofs, false);
|
QCC_PR_DummyDef(parttype, newname, scope, 1, ofs + type->size*a + parttype->ofs, false);
|
||||||
break;
|
break;
|
||||||
|
@ -7109,6 +7118,7 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope,
|
||||||
case ev_field:
|
case ev_field:
|
||||||
case ev_pointer:
|
case ev_pointer:
|
||||||
case ev_integer:
|
case ev_integer:
|
||||||
|
case ev_variant:
|
||||||
if (*name)
|
if (*name)
|
||||||
sprintf(newname, "%s%s.%s", name, array, parttype->name);
|
sprintf(newname, "%s%s.%s", name, array, parttype->name);
|
||||||
else
|
else
|
||||||
|
@ -7458,7 +7468,7 @@ void QCC_PR_ParseDefs (char *classname)
|
||||||
else if (QCC_PR_CheckKeyword(keyword_const, "const"))
|
else if (QCC_PR_CheckKeyword(keyword_const, "const"))
|
||||||
isconstant = true;
|
isconstant = true;
|
||||||
else if (QCC_PR_CheckKeyword(keyword_var, "var"))
|
else if (QCC_PR_CheckKeyword(keyword_var, "var"))
|
||||||
isvar = false;
|
isvar = true;
|
||||||
else if (QCC_PR_CheckKeyword(keyword_noref, "noref"))
|
else if (QCC_PR_CheckKeyword(keyword_noref, "noref"))
|
||||||
noref=true;
|
noref=true;
|
||||||
else if (QCC_PR_CheckKeyword(keyword_nosave, "nosave"))
|
else if (QCC_PR_CheckKeyword(keyword_nosave, "nosave"))
|
||||||
|
|
|
@ -525,7 +525,8 @@ pbool QCC_PR_Precompiler(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp(directive, "include", 7))
|
else if (!strncmp(directive, "include", 7))
|
||||||
{
|
{
|
||||||
|
int rellen;
|
||||||
char sm;
|
char sm;
|
||||||
|
|
||||||
pr_file_p=directive+7;
|
pr_file_p=directive+7;
|
||||||
|
@ -555,17 +556,27 @@ pbool QCC_PR_Precompiler(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rellen = a;
|
||||||
|
|
||||||
pr_file_p++;
|
pr_file_p++;
|
||||||
for (;a<1023;a++)
|
for (;a<1023;a++)
|
||||||
{
|
{
|
||||||
if (*pr_file_p == sm)
|
if (*pr_file_p == sm || !*pr_file_p)
|
||||||
break;
|
break;
|
||||||
msg[a] = *pr_file_p++;
|
msg[a] = *pr_file_p++;
|
||||||
}
|
}
|
||||||
msg[a] = '\0';
|
msg[a] = '\0';
|
||||||
|
|
||||||
printf("Including: %s\n", msg);
|
a = 0;
|
||||||
QCC_Include(msg);
|
if (externs->FileSize(msg)<0)
|
||||||
|
{
|
||||||
|
if (externs->FileSize(msg+rellen)>=0)
|
||||||
|
a = rellen;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Including: %s\n", msg+a);
|
||||||
|
QCC_Include(msg+a);
|
||||||
|
|
||||||
pr_file_p++;
|
pr_file_p++;
|
||||||
|
|
||||||
|
@ -1529,7 +1540,7 @@ pbool QCC_PR_SimpleGetToken (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while ( (c = *pr_file_p) > ' ' && c != ',' && c != ';' && c != ')' && c != '(')
|
while ( (c = *pr_file_p) > ' ' && c != ',' && c != ';' && c != ')' && c != '(' && c != ']' && (c != '.' || pr_file_p[1] != '.'))
|
||||||
{
|
{
|
||||||
pr_token[i] = c;
|
pr_token[i] = c;
|
||||||
i++;
|
i++;
|
||||||
|
@ -2786,8 +2797,6 @@ QCC_type_t *QCC_PR_ParseFunctionTypeReacc (int newtype, QCC_type_t *returntype)
|
||||||
char argname[64];
|
char argname[64];
|
||||||
int definenames = !recursivefunctiontype;
|
int definenames = !recursivefunctiontype;
|
||||||
|
|
||||||
pbool usesvariants = false;
|
|
||||||
|
|
||||||
recursivefunctiontype++;
|
recursivefunctiontype++;
|
||||||
|
|
||||||
ftype = QCC_PR_NewType(type_function->name, ev_function);
|
ftype = QCC_PR_NewType(type_function->name, ev_function);
|
||||||
|
|
|
@ -1597,7 +1597,7 @@ static LONG CALLBACK MainWndProc(HWND hWnd,UINT message,
|
||||||
i.pszText = itemtext;
|
i.pszText = itemtext;
|
||||||
i.cchTextMax = sizeof(itemtext)-1;
|
i.cchTextMax = sizeof(itemtext)-1;
|
||||||
if (!TreeView_GetItem(projecttree, &i))
|
if (!TreeView_GetItem(projecttree, &i))
|
||||||
return;
|
return 0;
|
||||||
strcpy(filename, i.pszText);
|
strcpy(filename, i.pszText);
|
||||||
while(item)
|
while(item)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue