Commit b2cd248d authored by Chris Allegretta's avatar Chris Allegretta
Browse files

const char * fixes and defined(NCURSES_MOUSE_VERSION) additions to winio.c funcs that need them

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1451 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 31 additions and 24 deletions
+31 -24
...@@ -13,6 +13,10 @@ CVS code ...@@ -13,6 +13,10 @@ CVS code
__ identifier (Jordi). __ identifier (Jordi).
- Memory leak fixes for files.c:do_insertfile(),do_browser(), - Memory leak fixes for files.c:do_insertfile(),do_browser(),
nano.c:do_spell(), and search.c:do_replace() (David Benbennick). nano.c:do_spell(), and search.c:do_replace() (David Benbennick).
- Change various const char *s to char *s because Irix curses
waddnstr() complains about const char's, I imagine this is a
common System V curses issue.
- files.c: - files.c:
cwd_tab_completion() cwd_tab_completion()
- Memory leak fix (David Benbennick). - Memory leak fix (David Benbennick).
...@@ -46,6 +50,9 @@ CVS code ...@@ -46,6 +50,9 @@ CVS code
- Only goto_abort() if we *didnt* abort the command, making - Only goto_abort() if we *didnt* abort the command, making
the function seem horribly misnamed ;-) (David Benbennick). the function seem horribly misnamed ;-) (David Benbennick).
- winio.c: - winio.c:
do_yesno(), do_help()
- Add defined(NCURSES_MOUSE_VERSION) to macro so systems that
don't understand MEVENT will compile.
nanogetstr() nanogetstr()
- Remove unnecessary reset of x since it is now handled - Remove unnecessary reset of x since it is now handled
elsewhere (David Lawrence Ramsey). elsewhere (David Lawrence Ramsey).
......
...@@ -163,9 +163,9 @@ int length_of_list(const shortcut *s) ...@@ -163,9 +163,9 @@ int length_of_list(const shortcut *s)
} }
/* Initialize a struct *without* our lovely braces =( */ /* Initialize a struct *without* our lovely braces =( */
void sc_init_one(shortcut **shortcutage, int key, const char *desc, void sc_init_one(shortcut **shortcutage, int key, char *desc,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
const char *help, char *help,
#endif #endif
int alt, int misc1, int misc2, int view, int (*func) (void)) int alt, int misc1, int misc2, int view, int (*func) (void))
{ {
...@@ -316,7 +316,7 @@ void free_shortcutage(shortcut **shortcutage) ...@@ -316,7 +316,7 @@ void free_shortcutage(shortcut **shortcutage)
void shortcut_init(int unjustify) void shortcut_init(int unjustify)
{ {
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
const char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg =
"", *nano_goto_msg = "", *nano_justify_msg = "", *nano_goto_msg = "", *nano_justify_msg =
"", *nano_replace_msg = "", *nano_insert_msg = "", *nano_replace_msg = "", *nano_insert_msg =
"", *nano_whereis_msg = "", *nano_prevpage_msg = "", *nano_whereis_msg = "", *nano_prevpage_msg =
...@@ -337,11 +337,11 @@ void shortcut_init(int unjustify) ...@@ -337,11 +337,11 @@ void shortcut_init(int unjustify)
"", *nano_backup_msg = "", *nano_editstr_msg = ""; "", *nano_backup_msg = "", *nano_editstr_msg = "";
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
const char *nano_openprev_msg = "", *nano_opennext_msg = char *nano_openprev_msg = "", *nano_opennext_msg =
"", *nano_multibuffer_msg = ""; "", *nano_multibuffer_msg = "";
#endif #endif
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
const char *nano_regexp_msg = "", *nano_bracket_msg = ""; char *nano_regexp_msg = "", *nano_bracket_msg = "";
#endif #endif
nano_help_msg = _("Invoke the help menu"); nano_help_msg = _("Invoke the help menu");
......
...@@ -150,9 +150,9 @@ typedef struct shortcut { ...@@ -150,9 +150,9 @@ typedef struct shortcut {
int misc2; int misc2;
int viewok; /* is this function legal in view mode? */ int viewok; /* is this function legal in view mode? */
int (*func) (void); /* Function to call when we catch this key */ int (*func) (void); /* Function to call when we catch this key */
const char *desc; /* Description, e.g. "Page Up" */ char *desc; /* Description, e.g. "Page Up" */
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
const char *help; /* Help file entry text */ char *help; /* Help file entry text */
#endif #endif
struct shortcut *next; struct shortcut *next;
} shortcut; } shortcut;
......
...@@ -200,9 +200,9 @@ char *do_browse_from(const char *inpath); ...@@ -200,9 +200,9 @@ char *do_browse_from(const char *inpath);
/* Public functions in global.c */ /* Public functions in global.c */
int length_of_list(const shortcut *s); int length_of_list(const shortcut *s);
void sc_init_one(shortcut **shortcutage, int key, const char *desc, void sc_init_one(shortcut **shortcutage, int key, char *desc,
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
const char *help, char *help,
#endif #endif
int alt, int misc1, int misc2, int view, int (*func) (void)); int alt, int misc1, int misc2, int view, int (*func) (void));
#ifndef NANO_SMALL #ifndef NANO_SMALL
...@@ -429,8 +429,8 @@ void blank_edit(void); ...@@ -429,8 +429,8 @@ void blank_edit(void);
void blank_statusbar(void); void blank_statusbar(void);
void blank_statusbar_refresh(void); void blank_statusbar_refresh(void);
void check_statblank(void); void check_statblank(void);
void nanoget_repaint(const char *buf, const char *inputbuf, int x); void nanoget_repaint(char *buf, char *inputbuf, int x);
int nanogetstr(int allowtabs, const char *buf, const char *def, int nanogetstr(int allowtabs, char *buf, const char *def,
#ifndef NANO_SMALL #ifndef NANO_SMALL
historyheadtype *history_list, historyheadtype *history_list,
#endif #endif
...@@ -440,9 +440,9 @@ int nanogetstr(int allowtabs, const char *buf, const char *def, ...@@ -440,9 +440,9 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
#endif #endif
, int resetpos); , int resetpos);
void set_modified(void); void set_modified(void);
void titlebar(const char *path); void titlebar(char *path);
void bottombars(const shortcut *s); void bottombars(const shortcut *s);
void onekey(const char *keystroke, const char *desc, int len); void onekey(char *keystroke, char *desc, int len);
#ifndef NDEBUG #ifndef NDEBUG
int check_linenumbers(const filestruct *fileptr); int check_linenumbers(const filestruct *fileptr);
#endif #endif
......
...@@ -166,7 +166,7 @@ void check_statblank(void) ...@@ -166,7 +166,7 @@ void check_statblank(void)
* *
* Note that we must turn on A_REVERSE here, since do_help() turns it * Note that we must turn on A_REVERSE here, since do_help() turns it
* off! */ * off! */
void nanoget_repaint(const char *buf, const char *inputbuf, int x) void nanoget_repaint(char *buf, char *inputbuf, int x)
{ {
int len = strlen(buf) + 2; int len = strlen(buf) + 2;
int wid = COLS - len; int wid = COLS - len;
...@@ -186,7 +186,7 @@ void nanoget_repaint(const char *buf, const char *inputbuf, int x) ...@@ -186,7 +186,7 @@ void nanoget_repaint(const char *buf, const char *inputbuf, int x)
/* Get the input from the kb; this should only be called from /* Get the input from the kb; this should only be called from
* statusq(). */ * statusq(). */
int nanogetstr(int allowtabs, const char *buf, const char *def, int nanogetstr(int allowtabs, char *buf, const char *def,
#ifndef NANO_SMALL #ifndef NANO_SMALL
historyheadtype *history_list, historyheadtype *history_list,
#endif #endif
...@@ -509,10 +509,10 @@ void set_modified(void) ...@@ -509,10 +509,10 @@ void set_modified(void)
} }
} }
void titlebar(const char *path) void titlebar(char *path)
{ {
int namelen, space; int namelen, space;
const char *what = path; char *what = path;
if (path == NULL) if (path == NULL)
what = filename; what = filename;
...@@ -613,7 +613,7 @@ void bottombars(const shortcut *s) ...@@ -613,7 +613,7 @@ void bottombars(const shortcut *s)
* keystroke is e.g. "^G" and desc is e.g. "Get Help". * keystroke is e.g. "^G" and desc is e.g. "Get Help".
* We are careful to write exactly len characters, even if len is * We are careful to write exactly len characters, even if len is
* very small and keystroke and desc are long. */ * very small and keystroke and desc are long. */
void onekey(const char *keystroke, const char *desc, int len) void onekey(char *keystroke, char *desc, int len)
{ {
wattron(bottomwin, A_REVERSE); wattron(bottomwin, A_REVERSE);
...@@ -1279,13 +1279,13 @@ int do_yesno(int all, int leavecursor, const char *msg, ...) ...@@ -1279,13 +1279,13 @@ int do_yesno(int all, int leavecursor, const char *msg, ...)
do { do {
int kbinput = wgetch(edit); int kbinput = wgetch(edit);
#ifndef DISABLE_MOUSE #if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
MEVENT mevent; MEVENT mevent;
#endif #endif
if (kbinput == NANO_CONTROL_C) if (kbinput == NANO_CONTROL_C)
ok = -1; ok = -1;
#ifndef DISABLE_MOUSE #if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
/* Look ma! We get to duplicate lots of code from do_mouse!! */ /* Look ma! We get to duplicate lots of code from do_mouse!! */
else if (kbinput == KEY_MOUSE && getmouse(&mevent) != ERR && else if (kbinput == KEY_MOUSE && getmouse(&mevent) != ERR &&
wenclose(bottomwin, mevent.y, mevent.x) && wenclose(bottomwin, mevent.y, mevent.x) &&
...@@ -1517,7 +1517,7 @@ int do_help(void) ...@@ -1517,7 +1517,7 @@ int do_help(void)
bottombars(help_list); bottombars(help_list);
do { do {
const char *ptr = help_text; char *ptr = help_text;
switch (kbinput) { switch (kbinput) {
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION) #if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
...@@ -1726,10 +1726,10 @@ void do_credits(void) ...@@ -1726,10 +1726,10 @@ void do_credits(void)
{ {
int i, j = 0, k, place = 0, start_x; int i, j = 0, k, place = 0, start_x;
const char *what; char *what;
const char *xlcredits[XLCREDIT_LEN]; char *xlcredits[XLCREDIT_LEN];
const char *credits[CREDIT_LEN] = { char *credits[CREDIT_LEN] = {
"0", /* "The nano text editor" */ "0", /* "The nano text editor" */
"1", /* "version" */ "1", /* "version" */
VERSION, VERSION,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment