3 Commits

Author SHA1 Message Date
124b7550ab Move definition on Parameters earlier in global.h
We typedef int * to Parmeters in global.h, but not at the same time as
the other typedefs.  This causes problems when we add a function
declaration for write_scrap().

This also highlights a random `1` being passed as the parameter in one
call to write_scrap().  This is obviously wrong, but the purpose of this
fix is to remove warnings - not do a deep dive into what the code is
doing.
2024-03-15 08:51:38 +00:00
cbcfc68afa Correct prototype of write_tex().
In a reverse of write_html(), write_tex() is declared with three
parameters, but only called with two.

Removing the third parameter is fine as it is unused.
2024-03-15 08:40:54 +00:00
a44adf4baf Correct calls to write_html()
write_html() is declared as taking two parameters, but the call to it
passes three.

We fix this by dropping the third parameter, which was labelled 'DUMMY'
anyway.
2024-03-15 08:33:40 +00:00

10
nuweb.w
View File

@@ -1378,7 +1378,7 @@ is forced when generating HTML.
int saved_number_flag = number_flag; int saved_number_flag = number_flag;
number_flag = TRUE; number_flag = TRUE;
collect_numbers(aux_name); collect_numbers(aux_name);
write_html(source_name, tex_name, 0/*Dummy */); write_html(source_name, tex_name);
number_flag = saved_number_flag; number_flag = saved_number_flag;
} }
else { else {
@@ -1814,7 +1814,7 @@ Fragment parameters were added on later in nuweb's development.
There still is not, for example, an index of fragment parameters. There still is not, for example, an index of fragment parameters.
We need a data type to keep track of fragment parameters. We need a data type to keep track of fragment parameters.
@o global.h -cc -d @d Type decl...
@{typedef int *Parameters; @{typedef int *Parameters;
@| Parameters @} @| Parameters @}
@@ -2055,10 +2055,9 @@ static void write_ArglistElement();
The routine \verb|write_tex| takes two file names as parameters: the The routine \verb|write_tex| takes two file names as parameters: the
name of the web source file and the name of the \verb|.tex| output file. name of the web source file and the name of the \verb|.tex| output file.
@o latex.c -cc -d @o latex.c -cc -d
@{void write_tex(file_name, tex_name, sector) @{void write_tex(file_name, tex_name)
char *file_name; char *file_name;
char *tex_name; char *tex_name;
unsigned char sector;
{ {
FILE *tex_file = fopen(tex_name, "w"); FILE *tex_file = fopen(tex_name, "w");
if (tex_file) { if (tex_file) {
@@ -5000,7 +4999,8 @@ comment_ArglistElement(FILE * file, Arglist * args, int quote)
@d Include an embedded scrap in comment @d Include an embedded scrap in comment
@{Embed_Node * e = (Embed_Node *)q; @{Embed_Node * e = (Embed_Node *)q;
fputc('{', file); fputc('{', file);
write_scraps(file, "", e->defs, -1, "", 0, 0, 0, 0, e->args, 0, 1, ""); write_scraps(file, "", e->defs, -1, "", 0, 0, 0, 0, e->args, 0,
(Parameters)1, "");
fputc('}', file);@} fputc('}', file);@}
@d Include a fragment use in comment @d Include a fragment use in comment