Not bothering to set things to NULL when they will be initialized right away,

nor bothering with a separate initialization function when it's used only once.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5365 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-08-16 15:21:32 +00:00
parent 149b1fe439
commit 8925eabd5e
4 changed files with 6 additions and 20 deletions

View File

@ -11,6 +11,10 @@
* src/help.c (help_line_len): Rename and reorder most of it.
* src/nano.c (make_new_opennode), src/files.c (initialize_buffer):
Remove some duplication in the initialization of a new openfile node.
* src/nano.c (make_new_opennode): Don't bother setting things to NULL
when they will be intialized right away.
* src/files.c (make_new_buffer): Don't bother with a separate function
when it's used only once, right there.
2015-08-13 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_find_bracket): Remove mistaken comparison between

View File

@ -51,15 +51,7 @@ void make_new_buffer(void)
exitfunc->desc = close_tag;
}
/* Initialize the new buffer. */
initialize_buffer();
}
/* Initialize the current entry of the openfile openfilestruct. */
void initialize_buffer(void)
{
assert(openfile != NULL);
/* Start initializing the new buffer. */
openfile->filename = mallocstrcpy(NULL, "");
initialize_buffer_text();

View File

@ -517,16 +517,7 @@ void copy_from_filestruct(filestruct *somebuffer)
/* Create a new openfilestruct node. */
openfilestruct *make_new_opennode(void)
{
openfilestruct *newnode =
(openfilestruct *)nmalloc(sizeof(openfilestruct));
newnode->filename = NULL;
newnode->fileage = NULL;
newnode->filebot = NULL;
newnode->edittop = NULL;
newnode->current = NULL;
return newnode;
return (openfilestruct *)nmalloc(sizeof(openfilestruct));
}
/* Splice a node into an existing openfilestruct. */

View File

@ -274,7 +274,6 @@ void do_uncut_text(void);
/* All functions in files.c. */
void make_new_buffer(void);
void initialize_buffer(void);
void initialize_buffer_text(void);
void open_buffer(const char *filename, bool undoable);
#ifndef DISABLE_SPELLER