diff --git a/ChangeLog b/ChangeLog index b72847f246576209bc1546532977cfadfeda742b..f4f9d25c8c138d28f5845dc89c9ecb005fff971a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ * configure.ac, m4/ax_check_compile_flag.m4 - Start building with warnings enabled by default, to help prevent issues from silently creeping in. Patch by Mike Frysinger. + * src/{nano,move,winio}.c - Fix a few compiler warnings. 2014-03-23 Benno Schulenberg <bensberg@justemail.net> * src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a diff --git a/src/move.c b/src/move.c index c87872ea2f8a8c080c83e348dbb1a41469e3cb2d..77695b920f98e4e54f52222ffd462d5f9f8ecfdc 100644 --- a/src/move.c +++ b/src/move.c @@ -79,8 +79,8 @@ void do_page_up(void) if (ISSET(SOFTWRAP) && openfile->current) { skipped += strlenpt(openfile->current->data) / COLS; #ifdef DEBUG - fprintf(stderr, "do_page_up: i = %d, skipped = %d based on line %ld len %d\n", i, (unsigned long) skipped, -openfile->current->lineno, strlenpt(openfile->current->data)); + fprintf(stderr, "do_page_up: i = %d, skipped = %d based on line %lu len %d\n", + i, skipped, (unsigned long) openfile->current->lineno, strlenpt(openfile->current->data)); #endif } } @@ -89,7 +89,8 @@ openfile->current->lineno, strlenpt(openfile->current->data)); openfile->placewewant); #ifdef DEBUG - fprintf(stderr, "do_page_up: openfile->current->lineno = %lu, skipped = %d\n", (unsigned long) openfile->current->lineno, skipped); + fprintf(stderr, "do_page_up: openfile->current->lineno = %lu, skipped = %d\n", + (unsigned long) openfile->current->lineno, skipped); #endif /* Scroll the edit window up a page. */ diff --git a/src/nano.c b/src/nano.c index fc4a183996cb66937e4341ef73654bc46e9791f7..b297f906b390c5c7bce2b4fc74443f92bc95629e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2576,7 +2576,7 @@ int main(int argc, char **argv) #if !defined(NANO_TINY) && defined(ENABLE_NANORC) /* If whitespace wasn't specified, set its default value. */ - if (whitespace == NULL) + if (whitespace == NULL) { if (using_utf8()) { whitespace = mallocstrcpy(NULL, "»·"); whitespace_len[0] = 2; @@ -2586,6 +2586,7 @@ int main(int argc, char **argv) whitespace_len[0] = 1; whitespace_len[1] = 1; } + } #endif /* If tabsize wasn't specified, set its default value. */ diff --git a/src/winio.c b/src/winio.c index c33af652eec0d810916acad5571f0f059bba0503..00a384fe3c4d1a38514677bc31615b6c6fa1d158 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2971,7 +2971,7 @@ void compute_maxrows(void) maxrows += editwinrows - n; #ifdef DEBUG - fprintf(stderr, "compute_maxrows(): maxrows = %ld\n", maxrows); + fprintf(stderr, "compute_maxrows(): maxrows = %i\n", maxrows); #endif } @@ -3105,8 +3105,8 @@ void edit_redraw(filestruct *old_current, size_t pww_save) openfile->edittop->lineno + maxrows) { #ifdef DEBUG - fprintf(stderr, "edit_redraw(): line %lu was offscreen, oldcurrent = %lu edittop = %lu", openfile->current->lineno, - old_current->lineno, openfile->edittop->lineno); + fprintf(stderr, "edit_redraw(): line %d was offscreen, oldcurrent = %d edittop = %d", + openfile->current->lineno, old_current->lineno, openfile->edittop->lineno); #endif #ifndef NANO_TINY