From 3e1425e27ff449d34e6702db4d9cb05488da4ec3 Mon Sep 17 00:00:00 2001 From: Matthew Gretton-Dann Date: Fri, 15 Mar 2024 08:51:38 +0000 Subject: [PATCH] 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. --- nuweb.w | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nuweb.w b/nuweb.w index af0b6b4..7a69795 100644 --- a/nuweb.w +++ b/nuweb.w @@ -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. We need a data type to keep track of fragment parameters. -@o global.h -cc -d +@d Type decl... @{typedef int *Parameters; @| Parameters @} @@ -4999,7 +4999,8 @@ comment_ArglistElement(FILE * file, Arglist * args, int quote) @d Include an embedded scrap in comment @{Embed_Node * e = (Embed_Node *)q; 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);@} @d Include a fragment use in comment