tweaks: frob four comments, and rewrap two lines

master
Benno Schulenberg 2017-12-24 11:53:38 +01:00
parent 184bb11fd9
commit 23d66949e1
2 changed files with 11 additions and 15 deletions

View File

@ -607,8 +607,8 @@ void new_magicline(void);
void remove_magicline(void); void remove_magicline(void);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
void mark_order(const filestruct **top, size_t *top_x, const filestruct void mark_order(const filestruct **top, size_t *top_x,
**bot, size_t *bot_x, bool *right_side_up); const filestruct **bot, size_t *bot_x, bool *right_side_up);
void get_range(const filestruct **top, const filestruct **bot); void get_range(const filestruct **top, const filestruct **bot);
#endif #endif
size_t get_totsize(const filestruct *begin, const filestruct *end); size_t get_totsize(const filestruct *begin, const filestruct *end);

View File

@ -348,8 +348,7 @@ void nperror(const char *s)
} }
/* This is a wrapper for the malloc() function that properly handles /* This is a wrapper for the malloc() function that properly handles
* things when we run out of memory. Thanks, BG, many people have been * things when we run out of memory. */
* asking for this... */
void *nmalloc(size_t howmuch) void *nmalloc(size_t howmuch)
{ {
void *r = malloc(howmuch); void *r = malloc(howmuch);
@ -479,7 +478,7 @@ size_t strlenpt(const char *text)
return span; return span;
} }
/* Append a new magicline to filebot. */ /* Append a new magicline to the end of the buffer. */
void new_magicline(void) void new_magicline(void)
{ {
openfile->filebot->next = make_new_node(openfile->filebot); openfile->filebot->next = make_new_node(openfile->filebot);
@ -489,9 +488,8 @@ void new_magicline(void)
} }
#if !defined(NANO_TINY) || defined(ENABLE_HELP) #if !defined(NANO_TINY) || defined(ENABLE_HELP)
/* Remove the magicline from filebot, if there is one and it isn't the /* Remove the magicline from the end of the buffer, if there is one and
* only line in the file. Assume that edittop and current are not at * it isn't the only line in the file. */
* filebot. */
void remove_magicline(void) void remove_magicline(void)
{ {
if (openfile->filebot->data[0] == '\0' && if (openfile->filebot->data[0] == '\0' &&
@ -505,13 +503,11 @@ void remove_magicline(void)
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
/* Set top_x and bot_x to the top and bottom x-coordinates of the mark, /* Set (top, top_x) and (bot, bot_x) to the start and end "coordinates" of
* respectively, based on the locations of top and bot. If * the marked region. If right_side_up isn't NULL, set it to TRUE when the
* right_side_up isn't NULL, set it to TRUE if the mark begins with * mark is at the top of the marked region, and to FALSE otherwise. */
* (mark_begin, mark_begin_x) and ends with (current, current_x), or void mark_order(const filestruct **top, size_t *top_x,
* FALSE otherwise. */ const filestruct **bot, size_t *bot_x, bool *right_side_up)
void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x, bool *right_side_up)
{ {
if ((openfile->current->lineno == openfile->mark->lineno && if ((openfile->current->lineno == openfile->mark->lineno &&
openfile->current_x > openfile->mark_x) || openfile->current_x > openfile->mark_x) ||