[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Fix compiler warnings
From: |
Gavin D. Smith |
Subject: |
branch master updated: Fix compiler warnings |
Date: |
Wed, 19 Oct 2022 11:07:00 -0400 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new e981d12e58 Fix compiler warnings
e981d12e58 is described below
commit e981d12e586d1b57be35a319da203bab630de0d3
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Oct 19 16:06:52 2022 +0100
Fix compiler warnings
* tp/Texinfo/XS/parsetexi/context_stack.c
(current_context, current_region),
* tp/Texinfo/XS/parsetexi/end_line.c
(end_line_starting_block, end_line_misc_line, end_line),
* tp/Texinfo/XS/parsetexi/handle_commands.c
(handle_other_command, handle_line_command),
* tp/Texinfo/XS/parsetexi/input.c
(convert_to_utf8, input_push_file)
* tp/Texinfo/XS/parsetexi/parser.c:
(isolate_last_space_internal, process_remaining_on_line):
Fix warnings re declaration before statement, unused variables,
unused labels.
---
ChangeLog | 18 ++++++++++++++++++
tp/Texinfo/XS/parsetexi/context_stack.c | 8 ++++----
tp/Texinfo/XS/parsetexi/end_line.c | 13 ++++++-------
tp/Texinfo/XS/parsetexi/handle_commands.c | 4 ++--
tp/Texinfo/XS/parsetexi/input.c | 3 +--
tp/Texinfo/XS/parsetexi/parser.c | 15 +++++++--------
6 files changed, 38 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 278de8abae..3d1f59925f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2022-10-19 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Fix compiler warnings
+
+ * tp/Texinfo/XS/parsetexi/context_stack.c
+ (current_context, current_region),
+ * tp/Texinfo/XS/parsetexi/end_line.c
+ (end_line_starting_block, end_line_misc_line, end_line),
+ * tp/Texinfo/XS/parsetexi/handle_commands.c
+ (handle_other_command, handle_line_command),
+ * tp/Texinfo/XS/parsetexi/input.c
+ (convert_to_utf8, input_push_file)
+ * tp/Texinfo/XS/parsetexi/parser.c:
+ (isolate_last_space_internal, process_remaining_on_line):
+
+ Fix warnings re declaration before statement, unused variables,
+ unused labels.
+
2022-10-19 Gavin Smith <gavinsmith0123@gmail.com>
Address some compiler warnings
diff --git a/tp/Texinfo/XS/parsetexi/context_stack.c
b/tp/Texinfo/XS/parsetexi/context_stack.c
index 79e31e9e93..0ecd1dec6e 100644
--- a/tp/Texinfo/XS/parsetexi/context_stack.c
+++ b/tp/Texinfo/XS/parsetexi/context_stack.c
@@ -72,10 +72,10 @@ current_context (void)
enum command_id
current_context_command (void)
{
+ int i;
+
if (top == 0)
return CM_NONE;
-
- int i;
for (i = top -1; i >= 0; i--)
{
if (commands_stack[i] != CM_NONE)
@@ -145,10 +145,10 @@ current_region (void)
int
in_preformatted_context_not_menu()
{
+ int i;
+
if (top == 0)
return 0;
-
- int i;
for (i = top -1; i >= 0; i--)
{
enum context ct;
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c
b/tp/Texinfo/XS/parsetexi/end_line.c
index a62c6df5bd..9e2304066f 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -1123,10 +1123,11 @@ end_line_starting_block (ELEMENT *current)
if (current->args.number > 0
&& current->args.list[0]->contents.number > 0)
{
+ ELEMENT *g;
if (current->args.list[0]->contents.number > 1)
command_error (current, "superfluous argument to @%s",
command_name(current->cmd));
- ELEMENT *g = current->args.list[0]->contents.list[0];
+ g = current->args.list[0]->contents.list[0];
/* Check if @enumerate specification is either a single
letter or a string of digits. */
if (g->text.end == 1
@@ -1299,7 +1300,6 @@ end_line_misc_line (ELEMENT *current)
{
enum command_id cmd;
int arg_type;
- enum context c;
ELEMENT *misc_cmd;
char *end_command = 0;
enum command_id end_id;
@@ -1410,10 +1410,10 @@ end_line_misc_line (ELEMENT *current)
else if (current->cmd == CM_include)
{
int status;
- char *fullpath;
+ char *fullpath, *sys_filename;
debug ("Include %s", text);
- char *sys_filename = encode_file_name (text);
+ sys_filename = encode_file_name (text);
fullpath = locate_include_file (sys_filename);
if (!fullpath)
@@ -1655,7 +1655,6 @@ end_line_misc_line (ELEMENT *current)
{
while (p1 > texi_line && isspace ((unsigned char) p1[-1]))
p1--;
- c = *p1;
*p1 = '\0';
}
command_error (current, "bad argument to @%s: %s",
@@ -1693,9 +1692,9 @@ end_line_misc_line (ELEMENT *current)
/* Copy the first 'node_content' array, to avoid the complication
of it being referenced in two different places.
This might be better with a separate function. */
+ int i;
label = new_element (0);
- int i;
for (i = 0; i<nodes_manuals[0]->node_content->contents.number;
i++)
@@ -2063,9 +2062,9 @@ end_line (ELEMENT *current)
current = last_contents_child(current);
else
{
+ ELEMENT *e;
/* This should not happen */
bug ("description or menu comment not in preformatted");
- ELEMENT *e;
e = new_element (ET_preformatted);
add_to_element_contents (current, e);
current = e;
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 3e97d1bc98..94c95eb69f 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -261,7 +261,6 @@ handle_other_command (ELEMENT *current, char **line_inout,
start_empty_line_after_command (current, &line, 0);
}
-funexit:
*line_inout = line;
return current;
}
@@ -553,6 +552,7 @@ handle_line_command (ELEMENT *current, char **line_inout,
char *base_name;
int base_len;
int after_paragraph;
+ char *val;
/* Find the command with "x" stripped from the end, e.g.
deffnx -> deffn. */
@@ -574,7 +574,7 @@ handle_line_command (ELEMENT *current, char **line_inout,
misc->type = ET_def_line;
/* Check txidefnamenospace flag */
- char *val = fetch_value ("txidefnamenospace");
+ val = fetch_value ("txidefnamenospace");
if (val)
add_extra_integer (misc, "omit_def_name_space", 1);
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index afa2b57d9b..a3626bdc10 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -215,7 +215,6 @@ static char *
convert_to_utf8 (char *s)
{
iconv_t our_iconv = (iconv_t) -1;
- enum character_encoding enc;
char *ret;
/* Convert from @documentencoding to UTF-8.
@@ -658,6 +657,7 @@ int
input_push_file (char *filename)
{
FILE *stream = 0;
+ char *p, *q;
if (!strcmp (filename, "-"))
stream = stdin;
@@ -676,7 +676,6 @@ input_push_file (char *filename)
}
/* Strip off a leading directory path. */
- char *p, *q;
p = 0;
q = strchr (filename, '/');
while (q)
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index e77556aa1d..2573560053 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -660,9 +660,10 @@ static void
isolate_last_space_internal (ELEMENT *current)
{
ELEMENT *last_elt;
+ char *text;
last_elt = last_contents_child (current);
- char *text = element_text (last_elt);
+ text = element_text (last_elt);
int text_len = last_elt->text.end;
@@ -1085,7 +1086,6 @@ process_remaining_on_line (ELEMENT **current_inout, char
**line_inout)
char *line_after_command;
int retval = STILL_MORE_TO_PROCESS;
enum command_id end_cmd;
- char *p;
enum command_id cmd = CM_NONE;
/* remains set only if command is unknown, otherwise cmd is used */
@@ -1233,18 +1233,18 @@ process_remaining_on_line (ELEMENT **current_inout,
char **line_inout)
if (is_end_current_command (current, &line, &end_cmd))
{
char *tmp = 0;
+ ELEMENT *popped;
/* check whitespaces at the beginning of the line */
if (strchr (whitespace_chars, *p))
{
- ELEMENT *e;
line_warn ("@end %s should only appear at the "
"beginning of a line", command_name(end_cmd));
}
current = current->parent;
+
/* Remove an ignored block. */
- ELEMENT *popped;
popped = pop_element_from_contents (current);
if (popped->cmd != end_cmd)
fatal ("command mismatch for ignored block");
@@ -1712,15 +1712,14 @@ value_valid:
}
else
{ /* CM_txiinternalvalue */
- ELEMENT *txiinternalvalue_elt;
+ ELEMENT *txiinternalvalue_elt, *txiinternalvalue_arg;
abort_empty_line (¤t, NULL);
txiinternalvalue_elt = new_element (ET_NONE);
txiinternalvalue_elt->cmd = CM_txiinternalvalue;
- /* FIXME or misc_arg?
- * ELEMENT *txiinternalvalue_arg = new_element (ET_misc_arg)
*/;
- ELEMENT *txiinternalvalue_arg = new_element (ET_NONE);
+ /* FIXME or ET_misc_arg? */
+ txiinternalvalue_arg = new_element (ET_NONE);
text_append (&txiinternalvalue_arg->text, flag);
add_to_element_args (txiinternalvalue_elt,
txiinternalvalue_arg);
- branch master updated: Fix compiler warnings,
Gavin D. Smith <=