Mercurial > jwe > octave
changeset 20919:cfb58d9805fa
eliminate some type conversion warnings
* oct-rl-edit.h, oct-rl-edit.c (octave_rl_add_defun): Change prototype
to match rl_add_defun.
(octave_rl_ctrl, octave_rl_meta): Return int instead of char.
* oct-rl-hist.c (octave_history_list): Use size_t as needed.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 16 Dec 2015 18:11:39 -0500 |
parents | 6f0bd96f93c0 |
children | 561fd20f121c |
files | liboctave/util/oct-rl-edit.c liboctave/util/oct-rl-edit.h liboctave/util/oct-rl-hist.c |
diffstat | 3 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/oct-rl-edit.c Wed Dec 16 15:00:31 2015 -0800 +++ b/liboctave/util/oct-rl-edit.c Wed Dec 16 18:11:39 2015 -0500 @@ -407,7 +407,7 @@ } void -octave_rl_add_defun (const char *name, rl_fcn_ptr f, char key) +octave_rl_add_defun (const char *name, rl_fcn_ptr f, int key) { rl_add_defun (name, f, key); } @@ -442,13 +442,13 @@ return rl_history_search_backward (count, ignore); } -char +int octave_rl_ctrl (char c) { return CTRL (c); } -char +int octave_rl_meta (char c) { return META (c);
--- a/liboctave/util/oct-rl-edit.h Wed Dec 16 15:00:31 2015 -0800 +++ b/liboctave/util/oct-rl-edit.h Wed Dec 16 18:11:39 2015 -0500 @@ -154,7 +154,7 @@ extern char octave_rl_prompt_end_ignore (void); -extern void octave_rl_add_defun (const char *, rl_fcn_ptr, char); +extern void octave_rl_add_defun (const char *, rl_fcn_ptr, int); extern void octave_rl_set_terminal_name (const char *); @@ -164,9 +164,9 @@ extern int octave_rl_history_search_backward (int, int); -extern char octave_rl_ctrl (char); +extern int octave_rl_ctrl (char); -extern char octave_rl_meta (char); +extern int octave_rl_meta (char); #ifdef __cplusplus }
--- a/liboctave/util/oct-rl-hist.c Wed Dec 16 15:00:31 2015 -0800 +++ b/liboctave/util/oct-rl-hist.c Wed Dec 16 18:11:39 2015 -0500 @@ -279,13 +279,13 @@ beg = (limit < 0 || end < limit) ? 0 : (end - limit); - retval = malloc ((end - beg + 1) * sizeof (char **)); + retval = malloc ((size_t) (end - beg + 1) * sizeof (char **)); k = 0; for (i = beg; i < end; i++) { char *line = hlist[i]->line; - int len = line ? strlen (line) : 0; + size_t len = line ? strlen (line) : 0; char *tmp = malloc (len + 64); if (number_lines)