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
master
Chris Allegretta 2001-03-18 16:59:34 +00:00
parent a0323de1f7
commit e31677362b
5 changed files with 32 additions and 23 deletions

View File

@ -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).

34
nano.c
View File

@ -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 = &current->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(&current->data);
/* The logic here is as follows:

View File

@ -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);

View File

@ -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);

View File

@ -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 */