* PATCH: remove readline warnings
@ 2005-08-05 1:10 Ben Elliston
2005-08-05 1:25 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Ben Elliston @ 2005-08-05 1:10 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 3193 bytes --]
This patch removes a handful of warnings when compiling readline.
Okay for mainline?
2005-08-05 Ben Elliston <bje@au.ibm.com>
* bind.c (bool_to_int): Make value parameter const.
* mbutil.c (_rl_get_char_len): Make src parameter const.
Remove cast on src when calling mbrlen.
(_rl_adjust_point): Make string parameter const.
* rlmbutil.h (_rl_get_char_len): Update prototype.
(_rl_adjust_point): Likewise.
* util.c (_rl_stricmp): Make all parameters const.
Index: bind.c
===================================================================
RCS file: /home/bje/src-cvs/src/readline/bind.c,v
retrieving revision 1.6
diff -u -p -r1.6 bind.c
--- bind.c 27 Jan 2004 22:25:15 -0000 1.6
+++ bind.c 5 Aug 2005 01:02:55 -0000
@@ -1373,7 +1373,7 @@ find_string_var (name)
values result in 0 (false). */
static int
bool_to_int (value)
- char *value;
+ const char *value;
{
return (value == 0 || *value == '\0' ||
(_rl_stricmp (value, "on") == 0) ||
Index: mbutil.c
===================================================================
RCS file: /home/bje/src-cvs/src/readline/mbutil.c,v
retrieving revision 1.4
diff -u -p -r1.4 mbutil.c
--- mbutil.c 27 Jan 2004 22:25:15 -0000 1.4
+++ mbutil.c 5 Aug 2005 01:02:55 -0000
@@ -196,12 +196,12 @@ _rl_find_prev_mbchar_internal (string, s
if it couldn't parse a complete multibyte character. */
int
_rl_get_char_len (src, ps)
- char *src;
+ const char *src;
mbstate_t *ps;
{
size_t tmp;
- tmp = mbrlen((const char *)src, (size_t)strlen (src), ps);
+ tmp = mbrlen(src, (size_t) strlen (src), ps);
if (tmp == (size_t)(-2))
{
/* shorted to compose multibyte char */
@@ -256,7 +256,7 @@ _rl_compare_chars (buf1, pos1, ps1, buf2
it returns -1 */
int
_rl_adjust_point(string, point, ps)
- char *string;
+ const char *string;
int point;
mbstate_t *ps;
{
Index: rlmbutil.h
===================================================================
RCS file: /home/bje/src-cvs/src/readline/rlmbutil.h,v
retrieving revision 1.5
diff -u -p -r1.5 rlmbutil.h
--- rlmbutil.h 17 Dec 2003 20:13:54 -0000 1.5
+++ rlmbutil.h 5 Aug 2005 01:02:55 -0000
@@ -83,8 +83,8 @@ extern int _rl_find_next_mbchar PARAMS((
#ifdef HANDLE_MULTIBYTE
extern int _rl_compare_chars PARAMS((char *, int, mbstate_t *, char *, int,
mbstate_t *));
-extern int _rl_get_char_len PARAMS((char *, mbstate_t *));
-extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *));
+extern int _rl_get_char_len PARAMS((const char *, mbstate_t *));
+extern int _rl_adjust_point PARAMS((const char *, int, mbstate_t *));
extern int _rl_read_mbchar PARAMS((char *, int));
extern int _rl_read_mbstring PARAMS((int, char *, int));
Index: util.c
===================================================================
RCS file: /home/bje/src-cvs/src/readline/util.c,v
retrieving revision 1.4
diff -u -p -r1.4 util.c
--- util.c 8 Dec 2002 22:31:37 -0000 1.4
+++ util.c 5 Aug 2005 01:02:55 -0000
@@ -283,7 +283,7 @@ _rl_strnicmp (string1, string2, count)
/* strcmp (), but caseless. */
int
_rl_stricmp (string1, string2)
- char *string1, *string2;
+ const char *string1, *string2;
{
register char ch1, ch2;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH: remove readline warnings
2005-08-05 1:10 PATCH: remove readline warnings Ben Elliston
@ 2005-08-05 1:25 ` Daniel Jacobowitz
2005-08-05 1:32 ` Ben Elliston
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-08-05 1:25 UTC (permalink / raw)
To: Ben Elliston; +Cc: gdb-patches
On Fri, Aug 05, 2005 at 11:08:59AM +1000, Ben Elliston wrote:
> This patch removes a handful of warnings when compiling readline.
> Okay for mainline?
Not right away. Could you check first whether these warnings are
present in the latest release of readline, and if so talk to Chet about
fixing them?
Don't want local patches to readline for something this minor.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH: remove readline warnings
2005-08-05 1:25 ` Daniel Jacobowitz
@ 2005-08-05 1:32 ` Ben Elliston
2005-08-05 2:27 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Ben Elliston @ 2005-08-05 1:32 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 261 bytes --]
Hi Daniel,
> Don't want local patches to readline for something this minor.
I thought that local modifications might have been more appropriate, since the
version in the src tree is now over three years old and there hasn't been a recent
import.
Thanks, Ben
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH: remove readline warnings
2005-08-05 1:32 ` Ben Elliston
@ 2005-08-05 2:27 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-08-05 2:27 UTC (permalink / raw)
To: Ben Elliston; +Cc: gdb-patches
On Fri, Aug 05, 2005 at 11:32:16AM +1000, Ben Elliston wrote:
> Hi Daniel,
>
> > Don't want local patches to readline for something this minor.
>
> I thought that local modifications might have been more appropriate, since the
> version in the src tree is now over three years old and there hasn't been a recent
> import.
Yes, I know the import is overdue. I don't want to make it any harder,
though.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-08-05 2:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-05 1:10 PATCH: remove readline warnings Ben Elliston
2005-08-05 1:25 ` Daniel Jacobowitz
2005-08-05 1:32 ` Ben Elliston
2005-08-05 2:27 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox