Package: fteqcc
Version: 3343+svn3400-3
Severity: wishlist

Xonotic upstream have told me that Xonotic requires a newer fteqcc.

Version 0.5 used r3955 plus the attached patch. I don't immediately know
what version 0.6 uses; they maintain a "stable branch" of fteqcc, since fteqcc
apparently tends to have giant commits that introduce features, fix bugs
and introduce new bugs all at once.

Note that this newer version will break nexuiz-data (I've filed a bug,
with which I'll block this one when I get bug numbers back).

    S
diff --git a/comprout.c b/comprout.c
index a2a7a3b..2a2f961 100644
--- a/comprout.c
+++ b/comprout.c
@@ -61,7 +61,7 @@ pbool PreCompile(void)
 
 	qccClearHunk();
 	strcpy(qcc_gamedir, "");
-	qcchunk = malloc(qcchunksize=128*1024*1024);
+	qcchunk = malloc(qcchunksize=256*1024*1024);
 	while(!qcchunk && qcchunksize > 8*1024*1024)
 	{
 		qcchunksize /= 2;
diff --git a/qcc_pr_comp.c b/qcc_pr_comp.c
index 9056478..002d804 100644
--- a/qcc_pr_comp.c
+++ b/qcc_pr_comp.c
@@ -1516,16 +1516,16 @@ static void QCC_fprintfLocals(FILE *f, gofs_t paramstart, gofs_t paramend)
 		if (var->ofs >= paramstart && var->ofs < paramend)
 			continue;
 		if (var->arraysize != 1)
-			fprintf(f, "local %s %s[%i];\n", TypeName(var->type), var->name, var->arraysize);
+			fprintf(f, "local %s %s[%i]; /* at %d */\n", TypeName(var->type), var->name, var->arraysize, var->ofs);
 		else
-			fprintf(f, "local %s %s;\n", TypeName(var->type), var->name);
+			fprintf(f, "local %s %s; /* at %d */\n", TypeName(var->type), var->name, var->ofs);
 	}
 
 	for (t = functemps, i = 0; t; t = t->next, i++)
 	{
 		if (t->lastfunc == pr_scope)
 		{
-			fprintf(f, "local %s temp_%i;\n", (t->size == 1)?"float":"vector", i);
+			fprintf(f, "local %s temp_%i; /* at %d */\n", (t->size == 1)?"float":"vector", i, t->ofs);
 		}
 	}
 }
@@ -7092,9 +7092,9 @@ void QCC_WriteAsmFunction(QCC_def_t	*sc, unsigned int firststatement, gofs_t fir
 				break;
 		}
 		if (param)
-			fprintf(asmfile, "%s %s", TypeName(type), param->name);
+			fprintf(asmfile, "%s %s /* at %d */", TypeName(type), param->name, o);
 		else
-			fprintf(asmfile, "%s", TypeName(type));
+			fprintf(asmfile, "%s /* at %d */", TypeName(type), o);
 
 		o += type->size;
 	}
@@ -7911,7 +7911,7 @@ QCC_def_t *QCC_PR_DummyDef(QCC_type_t *type, char *name, QCC_def_t *scope, int a
 			pHash_Add(&globalstable, first->name, first, qccHunkAlloc(sizeof(bucket_t)));
 
 		if (!scope && asmfile)
-			fprintf(asmfile, "%s %s;\n", TypeName(first->type), first->name);
+			fprintf(asmfile, "%s %s; /* at %d */\n", TypeName(first->type), first->name, first->ofs);
 	}
 
 	return first;
diff --git a/qccmain.c b/qccmain.c
index 6c5f2be..e6d5ee5 100644
--- a/qccmain.c
+++ b/qccmain.c
@@ -320,10 +320,14 @@ int	QCC_CopyString (char *str)
 
 	if (opt_noduplicatestrings)
 	{
-		if (!str || !*str)
+		// NULL string is at 0
+		if (!str)
 			return 0;
 
-		for (s = strings; s < strings+strofs; s++)
+		// all others are >= 1
+		// this hack is necessary so if("") stays true, if(string_null)
+		// stays false with this optimization
+		for (s = strings + 1; s < strings+strofs; s++)
 			if (!strcmp(s, str))
 			{
 				optres_noduplicatestrings += strlen(str);
@@ -783,7 +787,7 @@ pbool QCC_WriteData (int crc)
 			dd->s_name = QCC_CopyString (def->name);
 			dd->ofs = G_INT(def->ofs);
 		}
-		else if ((def->scope||def->constant) && (def->type->type != ev_string || opt_constant_names_strings))
+		else if ((def->scope||def->constant) && (def->type->type != ev_string || (strncmp(def->name, "dotranslate_", 12) && opt_constant_names_strings)))
 		{
 			if (opt_constant_names)
 			{

Reply via email to