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-d3aeb78583b8master
parent
a0323de1f7
commit
e31677362b
|
@ -1,4 +1,13 @@
|
||||||
CVS code -
|
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:
|
- nano.c:
|
||||||
do_wrap()
|
do_wrap()
|
||||||
- Added case for autoindenting text causing new line (Adam).
|
- Added case for autoindenting text causing new line (Adam).
|
||||||
|
|
34
nano.c
34
nano.c
|
@ -493,16 +493,16 @@ filestruct *make_new_node(filestruct * prevnode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Splice a node into an existing filestruct */
|
/* 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;
|
newnode->next = end;
|
||||||
new->prev = begin;
|
newnode->prev = begin;
|
||||||
begin->next = new;
|
begin->next = newnode;
|
||||||
if (end != NULL)
|
if (end != NULL)
|
||||||
end->prev = new;
|
end->prev = newnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_mark()
|
int do_mark(void)
|
||||||
{
|
{
|
||||||
#ifdef NANO_SMALL
|
#ifdef NANO_SMALL
|
||||||
nano_disabled_msg();
|
nano_disabled_msg();
|
||||||
|
@ -570,11 +570,11 @@ void do_char(char ch)
|
||||||
/* Someone hits return *gasp!* */
|
/* Someone hits return *gasp!* */
|
||||||
int do_enter(filestruct * inptr)
|
int do_enter(filestruct * inptr)
|
||||||
{
|
{
|
||||||
filestruct *new;
|
filestruct *newnode;
|
||||||
char *tmp, *spc;
|
char *tmp, *spc;
|
||||||
int extra = 0;
|
int extra = 0;
|
||||||
|
|
||||||
new = make_new_node(inptr);
|
newnode = make_new_node(inptr);
|
||||||
tmp = ¤t->data[current_x];
|
tmp = ¤t->data[current_x];
|
||||||
current_x = 0;
|
current_x = 0;
|
||||||
|
|
||||||
|
@ -588,25 +588,25 @@ int do_enter(filestruct * inptr)
|
||||||
current_x++;
|
current_x++;
|
||||||
totsize++;
|
totsize++;
|
||||||
}
|
}
|
||||||
new->data = nmalloc(strlen(tmp) + extra + 1);
|
newnode->data = nmalloc(strlen(tmp) + extra + 1);
|
||||||
strncpy(new->data, current->data, extra);
|
strncpy(newnode->data, current->data, extra);
|
||||||
strcpy(&new->data[extra], tmp);
|
strcpy(&newnode->data[extra], tmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
new->data = nmalloc(strlen(tmp) + 1);
|
newnode->data = nmalloc(strlen(tmp) + 1);
|
||||||
strcpy(new->data, tmp);
|
strcpy(newnode->data, tmp);
|
||||||
}
|
}
|
||||||
*tmp = 0;
|
*tmp = 0;
|
||||||
|
|
||||||
if (inptr->next == NULL) {
|
if (inptr->next == NULL) {
|
||||||
filebot = new;
|
filebot = newnode;
|
||||||
editbot = new;
|
editbot = newnode;
|
||||||
}
|
}
|
||||||
splice_node(inptr, new, inptr->next);
|
splice_node(inptr, newnode, inptr->next);
|
||||||
|
|
||||||
totsize++;
|
totsize++;
|
||||||
renumber(current);
|
renumber(current);
|
||||||
current = new;
|
current = newnode;
|
||||||
align(¤t->data);
|
align(¤t->data);
|
||||||
|
|
||||||
/* The logic here is as follows:
|
/* The logic here is as follows:
|
||||||
|
|
4
proto.h
4
proto.h
|
@ -130,7 +130,7 @@ void *nrealloc(void *ptr, size_t howmuch);
|
||||||
void die(char *msg, ...);
|
void die(char *msg, ...);
|
||||||
void new_file(void);
|
void new_file(void);
|
||||||
void new_magicline(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 null_at(char *data, int index);
|
||||||
void page_up_center(void);
|
void page_up_center(void);
|
||||||
void blank_edit(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_delete(void), do_backspace(void), do_tab(void), do_justify(void);
|
||||||
int do_first_line(void), do_last_line(void);
|
int do_first_line(void), do_last_line(void);
|
||||||
int do_replace(void), do_help(void), do_enter_void(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
|
#ifndef DISABLE_BROWSER
|
||||||
char *do_browser(char *path);
|
char *do_browser(char *path);
|
||||||
|
|
2
search.c
2
search.c
|
@ -44,7 +44,7 @@ void regexp_init(const char *regexp)
|
||||||
SET(REGEXP_COMPILED);
|
SET(REGEXP_COMPILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void regexp_cleanup()
|
void regexp_cleanup(void)
|
||||||
{
|
{
|
||||||
UNSET(REGEXP_COMPILED);
|
UNSET(REGEXP_COMPILED);
|
||||||
regfree(&search_regexp);
|
regfree(&search_regexp);
|
||||||
|
|
6
winio.c
6
winio.c
|
@ -1505,7 +1505,7 @@ void do_credits(void)
|
||||||
}
|
}
|
||||||
#endif
|
#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 */
|
/* This is taken right from aumix. Don't sue me */
|
||||||
|
@ -1513,10 +1513,10 @@ int keypad_on(WINDOW * win, int new)
|
||||||
int old;
|
int old;
|
||||||
|
|
||||||
old = win->_use_keypad;
|
old = win->_use_keypad;
|
||||||
keypad(win, new);
|
keypad(win, newval);
|
||||||
return old;
|
return old;
|
||||||
#else
|
#else
|
||||||
keypad(win, new);
|
keypad(win, newval);
|
||||||
return 1;
|
return 1;
|
||||||
#endif /* HAVE_USEKEYPAD */
|
#endif /* HAVE_USEKEYPAD */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue