Fixing a few compiler warnings.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4672 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-03-24 13:35:50 +00:00
parent 3de6c5798b
commit 55a0d76c66
4 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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. */

View File

@ -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. */

View File

@ -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