texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * info/window.h (LINE_MAP): use long for nline fi


From: Patrice Dumas
Subject: branch master updated: * info/window.h (LINE_MAP): use long for nline field to be consistent with the remaining line numbers that are unsigned.
Date: Thu, 10 Oct 2024 02:47:15 -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 a2acb29d28 * info/window.h (LINE_MAP): use long for nline field to be 
consistent with the remaining line numbers that are unsigned.
a2acb29d28 is described below

commit a2acb29d2864827d9581bd223356e0a07d04fdb7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Oct 10 08:47:06 2024 +0200

    * info/window.h (LINE_MAP): use long for nline field to be consistent
    with the remaining line numbers that are unsigned.
    
    * info/window.c (set_window_pagetop, window_line_of_point)
    (line_map_init, window_compute_line_map): replace some int by long
    for consistency across functions, structure fields and variables
    types.
---
 ChangeLog     | 10 ++++++++++
 info/window.c | 12 ++++++------
 info/window.h |  5 +++--
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b7f968be7b..3756334bfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-10-10  Patrice Dumas  <pertusus@free.fr>
+
+       * info/window.h (LINE_MAP): use long for nline field to be consistent
+       with the remaining line numbers that are unsigned.
+
+       * info/window.c (set_window_pagetop, window_line_of_point)
+       (line_map_init, window_compute_line_map): replace some int by long
+       for consistency across functions, structure fields and variables
+       types.
+
 2024-10-09  Patrice Dumas  <pertusus@free.fr>
 
        Remove N_CannotGC, it is checked but never set
diff --git a/info/window.c b/info/window.c
index 24b029cefc..8e63776bb4 100644
--- a/info/window.c
+++ b/info/window.c
@@ -721,7 +721,7 @@ window_log_to_phys_line (WINDOW *window, long ln)
 void
 set_window_pagetop (WINDOW *window, int desired_top)
 {
-  int point_line, old_pagetop;
+  long point_line, old_pagetop;
 
   if (desired_top < 0)
     desired_top = 0;
@@ -816,10 +816,10 @@ window_adjust_pagetop (WINDOW *window)
 }
 
 /* Return the index of the line containing point. */
-int
+long
 window_line_of_point (WINDOW *window)
 {
-  register int i, start = 0;
+  register long i, start = 0;
 
   if (!window->line_starts)
     calculate_line_starts (window);
@@ -1247,7 +1247,7 @@ calculate_line_starts (WINDOW *win)
 
 
 static void
-line_map_init (LINE_MAP *map, NODE *node, int line)
+line_map_init (LINE_MAP *map, NODE *node, long line)
 {
   map->node = node;
   map->nline = line;
@@ -1280,7 +1280,7 @@ window_line_map_init (WINDOW *win)
 void
 window_compute_line_map (WINDOW *win)
 {
-  int line = window_line_of_point (win);
+  long line = window_line_of_point (win);
   mbi_iterator_t iter;
   int delim = 0;
   char *endp;
@@ -1338,4 +1338,4 @@ window_point_to_column (WINDOW *win, long point, long *np)
     *np = win->line_map.map[i];
   return i;
 }
-      
+
diff --git a/info/window.h b/info/window.h
index f4573692d7..ea3afa1fe6 100644
--- a/info/window.h
+++ b/info/window.h
@@ -38,7 +38,8 @@
 typedef struct line_map_struct
 {
   NODE *node;      /* Node to which this line pertains */
-  size_t nline;    /* Line number for which the map is computed. */
+  long nline;      /* Line number for which the map is computed.
+                      Should not be negative. */
   size_t size;     /* Number of elements map can accomodate */
   size_t used;     /* Number of used map slots */
   long *map;       /* The map itself */
@@ -217,7 +218,7 @@ void unmessage_in_echo_area (void);
 void window_clear_echo_area (void);
 
 /* Return the index of the line containing point. */
-int window_line_of_point (WINDOW *window);
+long window_line_of_point (WINDOW *window);
 
 /* Get and return the printed column offset of the cursor in this window. */
 long window_get_cursor_column (WINDOW *window);



reply via email to

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