Removed static buffer in gen_idf
This commit is contained in:
parent
b3233bcaa0
commit
d9bd02fda6
|
@ -47,11 +47,12 @@ gen_idf()
|
||||||
anonymous name.
|
anonymous name.
|
||||||
*/
|
*/
|
||||||
static int name_cnt;
|
static int name_cnt;
|
||||||
char buff[100];
|
char *s = Malloc(strlen(dot.tk_file) + 50);
|
||||||
|
|
||||||
sprint(buff, "#%d in %s, line %u",
|
sprint(s, "#%d in %s, line %u",
|
||||||
++name_cnt, dot.tk_file, dot.tk_line);
|
++name_cnt, dot.tk_file, dot.tk_line);
|
||||||
return str2idf(buff, 1);
|
s = Realloc(s, strlen(s)+1);
|
||||||
|
return str2idf(s, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -41,12 +41,13 @@ gen_anon_idf()
|
||||||
anonymous name.
|
anonymous name.
|
||||||
*/
|
*/
|
||||||
static int name_cnt;
|
static int name_cnt;
|
||||||
char buff[512];
|
char *s = Malloc(strlen(FileName)+50);
|
||||||
char *sprint();
|
char *sprint();
|
||||||
|
|
||||||
sprint(buff, "#%d in %s, line %u",
|
sprint(s, "#%d in %s, line %u",
|
||||||
++name_cnt, FileName, LineNumber);
|
++name_cnt, FileName, LineNumber);
|
||||||
return str2idf(buff, 1);
|
s = Realloc(s, strlen(s)+1);
|
||||||
|
return str2idf(s, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
not_declared(what, id, where)
|
not_declared(what, id, where)
|
||||||
|
|
|
@ -17,11 +17,12 @@ gen_anon_idf()
|
||||||
anonymous name.
|
anonymous name.
|
||||||
*/
|
*/
|
||||||
static int name_cnt;
|
static int name_cnt;
|
||||||
char buff[100];
|
char *s = Malloc(strlen(FileName) + 50);
|
||||||
char *sprint();
|
char *sprint();
|
||||||
|
|
||||||
sprint(buff, "#%d in %s, line %u", ++name_cnt, FileName, LineNumber);
|
sprint(s, "#%d in %s, line %u", ++name_cnt, FileName, LineNumber);
|
||||||
return str2idf(buff, 1);
|
s = Realloc(s, strlen(s)+1);
|
||||||
|
return str2idf(s, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
not_declared(what, id, where)
|
not_declared(what, id, where)
|
||||||
|
|
Loading…
Reference in a new issue