From: Chris Allegretta Date: Sun, 18 Mar 2001 16:59:34 +0000 (+0000) Subject: Added void to argless functions decls, changed new to newnode in functions with ... X-Git-Tag: v1.0.0~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e31677362be833332eed3dd3dbf02e62891d823f;p=nano.git Added void to argless functions decls, changed new to newnode in functions with 'new' variable git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@566 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 5e25e188..0ab3e1e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ CVS code - +- General + - Added void to functions declared as () args, nano.c:do_mark() + and search.c:regexp_cleanup(). (Christian Weisgerber). + - Changed internal variables called "new" to "newnode" to avoid + the "new" C++ reserved word, even though there is likely no way + nano will EVER be compilable with a C++ compiler. (suggested by + Rocco Corsi). + +1.0-test prerelease - 03/17/2001 - nano.c: do_wrap() - Added case for autoindenting text causing new line (Adam). diff --git a/nano.c b/nano.c index 10374d93..1c475a07 100644 --- a/nano.c +++ b/nano.c @@ -493,16 +493,16 @@ filestruct *make_new_node(filestruct * prevnode) } /* Splice a node into an existing filestruct */ -void splice_node(filestruct * begin, filestruct * new, filestruct * end) +void splice_node(filestruct * begin, filestruct * newnode, filestruct * end) { - new->next = end; - new->prev = begin; - begin->next = new; + newnode->next = end; + newnode->prev = begin; + begin->next = newnode; if (end != NULL) - end->prev = new; + end->prev = newnode; } -int do_mark() +int do_mark(void) { #ifdef NANO_SMALL nano_disabled_msg(); @@ -570,11 +570,11 @@ void do_char(char ch) /* Someone hits return *gasp!* */ int do_enter(filestruct * inptr) { - filestruct *new; + filestruct *newnode; char *tmp, *spc; int extra = 0; - new = make_new_node(inptr); + newnode = make_new_node(inptr); tmp = ¤t->data[current_x]; current_x = 0; @@ -588,25 +588,25 @@ int do_enter(filestruct * inptr) current_x++; totsize++; } - new->data = nmalloc(strlen(tmp) + extra + 1); - strncpy(new->data, current->data, extra); - strcpy(&new->data[extra], tmp); + newnode->data = nmalloc(strlen(tmp) + extra + 1); + strncpy(newnode->data, current->data, extra); + strcpy(&newnode->data[extra], tmp); } } else { - new->data = nmalloc(strlen(tmp) + 1); - strcpy(new->data, tmp); + newnode->data = nmalloc(strlen(tmp) + 1); + strcpy(newnode->data, tmp); } *tmp = 0; if (inptr->next == NULL) { - filebot = new; - editbot = new; + filebot = newnode; + editbot = newnode; } - splice_node(inptr, new, inptr->next); + splice_node(inptr, newnode, inptr->next); totsize++; renumber(current); - current = new; + current = newnode; align(¤t->data); /* The logic here is as follows: diff --git a/proto.h b/proto.h index 0c6b03c1..68634d3f 100644 --- a/proto.h +++ b/proto.h @@ -130,7 +130,7 @@ void *nrealloc(void *ptr, size_t howmuch); void die(char *msg, ...); void new_file(void); void new_magicline(void); -void splice_node(filestruct *begin, filestruct *new, filestruct *end); +void splice_node(filestruct *begin, filestruct *newnode, filestruct *end); void null_at(char *data, int index); void page_up_center(void); void blank_edit(void); @@ -152,7 +152,7 @@ int do_home(void), do_end(void), total_refresh(void), do_mark(void); int do_delete(void), do_backspace(void), do_tab(void), do_justify(void); int do_first_line(void), do_last_line(void); int do_replace(void), do_help(void), do_enter_void(void); -int keypad_on(WINDOW * win, int new); +int keypad_on(WINDOW * win, int newval); #ifndef DISABLE_BROWSER char *do_browser(char *path); diff --git a/search.c b/search.c index 041e7740..97f1ece7 100644 --- a/search.c +++ b/search.c @@ -44,7 +44,7 @@ void regexp_init(const char *regexp) SET(REGEXP_COMPILED); } -void regexp_cleanup() +void regexp_cleanup(void) { UNSET(REGEXP_COMPILED); regfree(&search_regexp); diff --git a/winio.c b/winio.c index eda1cc9a..f64ee17b 100644 --- a/winio.c +++ b/winio.c @@ -1505,7 +1505,7 @@ void do_credits(void) } #endif -int keypad_on(WINDOW * win, int new) +int keypad_on(WINDOW * win, int newval) { /* This is taken right from aumix. Don't sue me */ @@ -1513,10 +1513,10 @@ int keypad_on(WINDOW * win, int new) int old; old = win->_use_keypad; - keypad(win, new); + keypad(win, newval); return old; #else - keypad(win, new); + keypad(win, newval); return 1; #endif /* HAVE_USEKEYPAD */