* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
-#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0)
+#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
#define count_mbytes(buffer,length,state) mblen(buffer,length)
#define check_mbytes(wch,buffer,length,state) \
(int) mbtowc(&wch, buffer, length)
#define count_mbytes(buffer,length,state) mblen(buffer,length)
#define check_mbytes(wch,buffer,length,state) \
(int) mbtowc(&wch, buffer, length)
- rc = check_mbytes(wch, src + j, len - j, state);
+ rc = (size_t) check_mbytes(wch, src + j, len - j, state);
(void) initscr(); /* initialize the curses library */
keypad(stdscr, TRUE); /* enable keyboard mapping */
(void) initscr(); /* initialize the curses library */
keypad(stdscr, TRUE); /* enable keyboard mapping */
- * This uses functions that are "unsafe", but it seems to work on SunOS and
- * Linux. Usually: the "unsafe" refers to the functions that POSIX lists
- * which may be called from a signal handler. Those do not include buffered
- * I/O, which is used for instance in wrefresh(). To be really portable, you
- * should use the KEY_RESIZE return (which relies on ncurses' sigwinch
- * handler).
+ * This uses functions that are "unsafe", but it seems to work on SunOS.
+ * Usually: the "unsafe" refers to the functions that POSIX lists which may be
+ * called from a signal handler. Those do not include buffered I/O, which is
+ * used for instance in wrefresh(). To be really portable, you should use the
+ * KEY_RESIZE return (which relies on ncurses' sigwinch handler).
*
* The 'wrefresh(curscr)' is needed to force the refresh to start from the top
* of the screen -- some xterms mangle the bitmap while resizing.
*
* The 'wrefresh(curscr)' is needed to force the refresh to start from the top
* of the screen -- some xterms mangle the bitmap while resizing.
if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) {
resize_term(size.ws_row, size.ws_col);
if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) {
resize_term(size.ws_row, size.ws_col);
#if CAN_RESIZE
sprintf(temp, "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
#if CAN_RESIZE
sprintf(temp, "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
- i = strlen(temp);
- if ((i + 7) < (int) sizeof(temp))
- sprintf(temp + i, "view %.*s", (int) (sizeof(temp) - 7 - i), fname);
+ i = (int) strlen(temp);
+ if ((i + 7) < (int) sizeof(temp)) {
+ sprintf(temp + i, "view %.*s",
+ (int) (sizeof(temp) - 7 - (size_t) i),
+ fname);
+ }
#else
(void) tag;
sprintf(temp, "view %.*s", (int) sizeof(temp) - 7, fname);
#else
(void) tag;
sprintf(temp, "view %.*s", (int) sizeof(temp) - 7, fname);
clrtoeol();
this_time = time((time_t *) 0);
strcpy(temp, ctime(&this_time));
clrtoeol();
this_time = time((time_t *) 0);
strcpy(temp, ctime(&this_time));