Commit 8925eabd authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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
parent 149b1fe4
Showing with 6 additions and 20 deletions
+6 -20
......@@ -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
......
......@@ -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();
......
......@@ -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. */
......
......@@ -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
......
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