tweaks: compile a parameter unconditionally

Straightforward code is more important than the tiniest possible binary.

Also adjust some comments and rename a variable.
master
Benno Schulenberg 2016-08-02 17:26:25 +02:00
parent a7ae1766c0
commit f6dd0ad18a
3 changed files with 11 additions and 28 deletions

View File

@ -609,53 +609,40 @@ void die(const char *msg, ...)
delete_lockfile(openfile->lock_filename);
#endif
/* Save the current file buffer if it's been modified. */
/* If the current file buffer was modified, save it. */
if (openfile && openfile->modified) {
/* If we've partitioned the filestruct, unpartition it now. */
/* If the filestruct is partitioned, unpartition it first. */
if (filepart != NULL)
unpartition_filestruct(&filepart);
die_save_file(openfile->filename
#ifndef NANO_TINY
, openfile->current_stat
#endif
);
die_save_file(openfile->filename, openfile->current_stat);
}
#ifndef DISABLE_MULTIBUFFER
/* Save all of the other modified file buffers, if any. */
if (openfile != NULL) {
openfilestruct *tmp = openfile;
openfilestruct *firstone = openfile;
while (tmp != openfile->next) {
while (openfile->next != firstone) {
openfile = openfile->next;
#ifndef NANO_TINY
if (ISSET(LOCKING) && openfile->lock_filename)
delete_lockfile(openfile->lock_filename);
#endif
/* Save the current file buffer if it's been modified. */
if (openfile->modified)
die_save_file(openfile->filename
#ifndef NANO_TINY
, openfile->current_stat
#endif
);
die_save_file(openfile->filename, openfile->current_stat);
}
}
#endif
/* Get out. */
/* Abandon the building. */
exit(1);
}
/* Save the current file under the name specified in die_filename, which
* is modified to be unique if necessary. */
void die_save_file(const char *die_filename
#ifndef NANO_TINY
, struct stat *die_stat
#endif
)
void die_save_file(const char *die_filename, struct stat *die_stat)
{
char *targetname;
bool failed = TRUE;

View File

@ -393,6 +393,8 @@ typedef struct openfilestruct {
/* The file's y-coordinate position. */
bool modified;
/* Whether the file has been modified. */
struct stat *current_stat;
/* The file's current stat information. */
#ifndef NANO_TINY
bool mark_set;
/* Whether the mark is on in this file. */
@ -402,8 +404,6 @@ typedef struct openfilestruct {
/* The file's mark's x-coordinate position, if any. */
file_format fmt;
/* The file's format. */
struct stat *current_stat;
/* The file's current stat information. */
undo *undotop;
/* The top of the undo list. */
undo *current_undo;

View File

@ -442,11 +442,7 @@ void say_there_is_no_help(void);
#endif
void finish(void);
void die(const char *msg, ...);
void die_save_file(const char *die_filename
#ifndef NANO_TINY
, struct stat *die_stat
#endif
);
void die_save_file(const char *die_filename, struct stat *die_stat);
void window_init(void);
#ifndef DISABLE_MOUSE
void disable_mouse_support(void);