texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * info/nodes.c (SUBFILE), info/nodes.h (TAG): go


From: Patrice Dumas
Subject: branch master updated: * info/nodes.c (SUBFILE), info/nodes.h (TAG): go back to long type instead of size_t even if the variable should never be negative as it is more robust for comparisons, as discussed in: https://lists.gnu.org/archive/html/bug-texinfo/2024-10/msg00067.html
Date: Tue, 08 Oct 2024 14:23:47 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new cadfbd8b82 * info/nodes.c (SUBFILE), info/nodes.h (TAG): go back to 
long type instead of size_t even if the variable should never be negative as it 
is more robust for comparisons, as discussed in: 
https://lists.gnu.org/archive/html/bug-texinfo/2024-10/msg00067.html
cadfbd8b82 is described below

commit cadfbd8b82ca559c7e0076d70586af27ec563310
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Oct 8 20:23:36 2024 +0200

    * info/nodes.c (SUBFILE), info/nodes.h (TAG): go back to long type
    instead of size_t even if the variable should never be negative as it
    is more robust for comparisons, as discussed in:
    https://lists.gnu.org/archive/html/bug-texinfo/2024-10/msg00067.html
---
 ChangeLog     | 7 +++++++
 info/nodes.c  | 2 +-
 info/nodes.h  | 3 ++-
 info/search.h | 8 ++++++--
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 08c9b1bb07..dc9823d51d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-08  Patrice Dumas  <pertusus@free.fr>
+
+       * info/nodes.c (SUBFILE), info/nodes.h (TAG): go back to long type
+       instead of size_t even if the variable should never be negative as it
+       is more robust for comparisons, as discussed in:
+       https://lists.gnu.org/archive/html/bug-texinfo/2024-10/msg00067.html
+
 2024-10-08  Patrice Dumas  <pertusus@free.fr>
 
        * info/dir.c (add_menu_to_node): call insert_text_into_node with
diff --git a/info/nodes.c b/info/nodes.c
index 2ca983b280..9fdaeee3c1 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -356,7 +356,7 @@ get_tags_of_indirect_tags_table (FILE_BUFFER *file_buffer,
      an intermediate value. */
   typedef struct {
     char *filename;
-    size_t first_byte;
+    long first_byte;          /* Should never be negative */
   } SUBFILE;
 
   SUBFILE **subfiles = NULL;
diff --git a/info/nodes.h b/info/nodes.h
index aee102ff87..8f60e542f9 100644
--- a/info/nodes.h
+++ b/info/nodes.h
@@ -102,7 +102,8 @@ typedef struct {
 typedef struct {
   char *filename;               /* The file where this node can be found. */
   char *nodename;               /* The node pointed to by this tag. */
-  size_t nodestart;             /* The value read from the tag table. */
+  long nodestart;               /* The value read from the tag table.
+                                   Should never be negative */
   long nodestart_adjusted;      /* Where the node or anchor actually is. */
   int flags;                    /* Same as NODE.flags. */
   NODE cache;                   /* Saved information about pointed-to node. */
diff --git a/info/search.h b/info/search.h
index 79f8d0bd42..5b7f76e5a9 100644
--- a/info/search.h
+++ b/info/search.h
@@ -34,8 +34,12 @@
 
 typedef struct {
   char *buffer;                 /* The buffer of text to search. */
-  long start;                   /* Offset of the start of the search. */
-  long end;                     /* Offset of the end of the searh. */
+  long start;                   /* Offset of the start of the search.
+                                   Should never be negative.
+                                 */
+  long end;                     /* Offset of the end of the search.
+                                   Should never be negative.
+                                 */
   int flags;                    /* Flags controlling the type of search. */
 } SEARCH_BINDING;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]