This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] readline warning fixes
- From: Elias Athanasopoulos <eathan at otenet dot gr>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 14 Dec 2002 13:53:55 +0200
- Subject: [PATCH] readline warning fixes
Hello!
Some warning fixes to readline. BTW, shouldn't comments end in a
period followed by two spaces?
Regards,
Elias
readline/ChangeLog
2002-12-14 Elias Athanasopoulos <eathan@otenet.gr>
* histexpand.c (get_history_event): Cast const char * to char *
to avoid compiler warnings.
* display.c (_rl_move_cursor_relative): Likewise.
===================================================================
RCS file: /home/anteater/bucvs/src/readline/histexpand.c,v
retrieving revision 1.1
diff -pu -r1.1 /home/anteater/bucvs/src/readline/histexpand.c
--- /home/anteater/bucvs/src/readline/histexpand.c 2002/12/14 11:35:29 1.1
+++ /home/anteater/bucvs/src/readline/histexpand.c 2002/12/14 11:36:59
@@ -209,10 +209,9 @@ get_history_event (string, caller_index,
mbstate_t ps;
memset (&ps, 0, sizeof (mbstate_t));
- /* These produce warnings because we're passing a const string to a
- function that takes a non-const string. */
- _rl_adjust_point (string, i, &ps);
- if ((v = _rl_get_char_len (string + i, &ps)) > 1)
+ /* Cast 'string' to non-const string to avoid compiler warnings. */
+ _rl_adjust_point ((char *) string, i, &ps);
+ if ((v = _rl_get_char_len ((char *) string + i, &ps)) > 1)
{
i += v - 1;
continue;
===================================================================
RCS file: /home/anteater/bucvs/src/readline/display.c,v
retrieving revision 1.1
diff -pu -r1.1 /home/anteater/bucvs/src/readline/display.c
--- /home/anteater/bucvs/src/readline/display.c 2002/12/14 11:38:11 1.1
+++ /home/anteater/bucvs/src/readline/display.c 2002/12/14 11:40:57
@@ -1608,7 +1608,7 @@ _rl_move_cursor_relative (new, data)
}
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- _rl_last_c_pos = _rl_col_width (data, 0, new);
+ _rl_last_c_pos = _rl_col_width ((char *) data, 0, new);
else
_rl_last_c_pos = new;
}