diff --git a/ChangeLog b/ChangeLog index cf91f1da..65948c02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-04-14 Benno Schulenberg + * src/{proto.h,cut.c,nano.c,text.c}: Remove the unused parameter + 'file_bot' from copy_from_filestruct(), and rename the other. + 2014-04-13 Benno Schulenberg * proto.h, global.c, rcfile.c: Remove the unused parameter 'menu' from strtosc(). diff --git a/src/cut.c b/src/cut.c index a5b8919d..9ea2321e 100644 --- a/src/cut.c +++ b/src/cut.c @@ -189,10 +189,10 @@ void do_cut_text( if (cutbuffer != NULL) { if (cb_save != NULL) { cb_save->data += cb_save_len; - copy_from_filestruct(cb_save, cutbottom); + copy_from_filestruct(cb_save); cb_save->data -= cb_save_len; } else - copy_from_filestruct(cutbuffer, cutbottom); + copy_from_filestruct(cutbuffer); /* Set the current place we want to where the text from the * cutbuffer ends. */ @@ -269,7 +269,7 @@ void do_uncut_text(void) /* Add a copy of the text in the cutbuffer to the current filestruct * at the current cursor position. */ - copy_from_filestruct(cutbuffer, cutbottom); + copy_from_filestruct(cutbuffer); /* Set the current place we want to where the text from the * cutbuffer ends. */ diff --git a/src/nano.c b/src/nano.c index d436035e..cc59a9b9 100644 --- a/src/nano.c +++ b/src/nano.c @@ -411,10 +411,9 @@ void move_to_filestruct(filestruct **file_top, filestruct **file_bot, new_magicline(); } -/* Copy all the text from the filestruct beginning with file_top and - * ending with file_bot to the current filestruct at the current cursor - * position. */ -void copy_from_filestruct(filestruct *file_top, filestruct *file_bot) +/* Copy all text from the given filestruct to the current filestruct + * at the current cursor position. */ +void copy_from_filestruct(filestruct *somebuffer) { filestruct *top_save; size_t current_x_save = openfile->current_x; @@ -423,7 +422,7 @@ void copy_from_filestruct(filestruct *file_top, filestruct *file_bot) bool right_side_up = FALSE, single_line = FALSE; #endif - assert(file_top != NULL && file_bot != NULL); + assert(somebuffer != NULL); #ifndef NANO_TINY /* Keep track of whether the mark begins inside the partition and @@ -446,9 +445,9 @@ void copy_from_filestruct(filestruct *file_top, filestruct *file_bot) openfile->current_x, openfile->current, openfile->current_x); edittop_inside = (openfile->edittop == openfile->fileage); - /* Put the top and bottom of the filestruct at copies of file_top - * and file_bot. */ - openfile->fileage = copy_filestruct(file_top); + /* Put the top and bottom of the current filestruct at the top and + * bottom of a copy of the passed buffer. */ + openfile->fileage = copy_filestruct(somebuffer); openfile->filebot = openfile->fileage; while (openfile->filebot->next != NULL) openfile->filebot = openfile->filebot->next; diff --git a/src/proto.h b/src/proto.h index c6adf4f0..7dbb90b5 100644 --- a/src/proto.h +++ b/src/proto.h @@ -430,7 +430,7 @@ partition *partition_filestruct(filestruct *top, size_t top_x, void unpartition_filestruct(partition **p); void move_to_filestruct(filestruct **file_top, filestruct **file_bot, filestruct *top, size_t top_x, filestruct *bot, size_t bot_x); -void copy_from_filestruct(filestruct *file_top, filestruct *file_bot); +void copy_from_filestruct(filestruct *somebuffer); openfilestruct *make_new_opennode(void); void splice_opennode(openfilestruct *begin, openfilestruct *newnode, openfilestruct *end); diff --git a/src/text.c b/src/text.c index 665c4837..938671e7 100644 --- a/src/text.c +++ b/src/text.c @@ -378,7 +378,7 @@ void undo_cut(undo *u) else do_gotolinecolumn(u->lineno, u->begin+1, FALSE, FALSE, FALSE, FALSE); - copy_from_filestruct(cutbuffer, cutbottom); + copy_from_filestruct(cutbuffer); free_filestruct(cutbuffer); cutbuffer = NULL; @@ -663,7 +663,7 @@ void do_redo(void) case INSERT: undidmsg = _("text insert"); do_gotolinecolumn(u->lineno, u->begin+1, FALSE, FALSE, FALSE, FALSE); - copy_from_filestruct(u->cutbuffer, u->cutbottom); + copy_from_filestruct(u->cutbuffer); openfile->placewewant = xplustabs(); break; default: @@ -1810,7 +1810,7 @@ void backup_lines(filestruct *first_line, size_t par_len) /* Copy the paragraph back to the current buffer's filestruct from * the justify buffer. */ - copy_from_filestruct(jusbuffer, jusbottom); + copy_from_filestruct(jusbuffer); /* Move upward from the last line of the paragraph to the first * line, putting first_line, edittop, current, and mark_begin at the