From 55a0d76c6632e90706c6ebd7c01bbe0928a88c96 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 24 Mar 2014 13:35:50 +0000 Subject: [PATCH] Fixing a few compiler warnings. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4672 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/move.c | 7 ++++--- src/nano.c | 3 ++- src/winio.c | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b72847f2..f4f9d25c 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 * src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a diff --git a/src/move.c b/src/move.c index c87872ea..77695b92 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 fc4a1839..b297f906 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 c33af652..00a384fe 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 -- 2.39.5