1
0
Fork 0
forked from fte/fteqw

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:
Spoike 2005-05-04 14:45:00 +00:00
parent a2cb6abac0
commit 8eaac6ced3
5 changed files with 33 additions and 13 deletions

View file

@ -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
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
@ -44,7 +45,7 @@ qccguistuff.o: qccguistuff.c qcc.h
$(DO_CC)
qcc_gtk.o: qcc_gtk.c qcc.h
$(DO_CC)
$(DO_CC) `pkg-config --cflags gtk+-2.0`
gtkgui: $(QCC_OBJS) $(GTKGUI_OBJS)
$(CC) $(BASE_CFLAGS) -DQCCONLY -DUSEGUI -o fteqccgui.bin -O3 $(GTKGUI_OBJS) $(QCC_OBJS) `pkg-config --libs gtk+-2.0`

View file

@ -56,7 +56,7 @@ pbool PreCompile(void)
{
qccClearHunk();
strcpy(qcc_gamedir, "");
qcchunk = malloc(qcchunksize=32*1024*1024);
qcchunk = malloc(qcchunksize=64*1024*1024);
qccalloced=0;
return !!qcchunk;

View file

@ -1081,7 +1081,7 @@ static void QCC_RemapLockedTemps(int firststatement, int laststatement)
t = functemps;
while(t)
{
if (t->scope)
if (t->scope || opt_locals_marshalling)
{
QCC_RemapLockedTemp(t, firststatement, laststatement);
t->scope = NULL;
@ -6009,7 +6009,12 @@ void QCC_Marshal_Locals(int first, int laststatement)
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?
{
temp_t *t;
for (t = functemps; t; t = t->next)
QCC_FreeOffset(t->ofs, t->size);
functemps = NULL;
}
if (!pr.localvars) //nothing to marshal
{
@ -6053,6 +6058,9 @@ void QCC_Marshal_Locals(int first, int laststatement)
if (local->constant)
continue;
if (((int*)qcc_pr_globals)[local->ofs])
QCC_PR_ParseError(ERR_INTERNAL, "Marshall of a set value");
newofs -= local->type->size*local->arraysize;
if (local->arraysize>1)
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_struct:
case ev_union:
case ev_variant: //for lack of any better alternative
sprintf(newname, "%s%s.%s", name, array, parttype->name);
QCC_PR_DummyDef(parttype, newname, scope, 1, ofs + type->size*a + parttype->ofs, false);
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_pointer:
case ev_integer:
case ev_variant:
if (*name)
sprintf(newname, "%s%s.%s", name, array, parttype->name);
else
@ -7458,7 +7468,7 @@ void QCC_PR_ParseDefs (char *classname)
else if (QCC_PR_CheckKeyword(keyword_const, "const"))
isconstant = true;
else if (QCC_PR_CheckKeyword(keyword_var, "var"))
isvar = false;
isvar = true;
else if (QCC_PR_CheckKeyword(keyword_noref, "noref"))
noref=true;
else if (QCC_PR_CheckKeyword(keyword_nosave, "nosave"))

View file

@ -526,6 +526,7 @@ pbool QCC_PR_Precompiler(void)
}
else if (!strncmp(directive, "include", 7))
{
int rellen;
char sm;
pr_file_p=directive+7;
@ -555,17 +556,27 @@ pbool QCC_PR_Precompiler(void)
}
}
rellen = a;
pr_file_p++;
for (;a<1023;a++)
{
if (*pr_file_p == sm)
if (*pr_file_p == sm || !*pr_file_p)
break;
msg[a] = *pr_file_p++;
}
msg[a] = '\0';
printf("Including: %s\n", msg);
QCC_Include(msg);
a = 0;
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++;
@ -1529,7 +1540,7 @@ pbool QCC_PR_SimpleGetToken (void)
}
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;
i++;
@ -2786,8 +2797,6 @@ QCC_type_t *QCC_PR_ParseFunctionTypeReacc (int newtype, QCC_type_t *returntype)
char argname[64];
int definenames = !recursivefunctiontype;
pbool usesvariants = false;
recursivefunctiontype++;
ftype = QCC_PR_NewType(type_function->name, ev_function);

View file

@ -1597,7 +1597,7 @@ static LONG CALLBACK MainWndProc(HWND hWnd,UINT message,
i.pszText = itemtext;
i.cchTextMax = sizeof(itemtext)-1;
if (!TreeView_GetItem(projecttree, &i))
return;
return 0;
strcpy(filename, i.pszText);
while(item)
{