]> git.wh0rd.org Git - nano.git/commitdiff
in edit_draw(), fix potential warnings when assigning -1 to paintlen by
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 21 Nov 2006 17:05:04 +0000 (17:05 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 21 Nov 2006 17:05:04 +0000 (17:05 +0000)
using if/else clauses instead of "?" operators

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3964 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/winio.c

index 6a3c009eb7b56a47bc337db3fa53f9408efbe8aa..2f6c6094e1c10746cc8c71e5f217601076df3db7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ CVS code -
          consistency. (DLR)
        - Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and
          NANO_.*METAKEY, for consistency. (DLR)
+- winio.c:
+  edit_draw()
+       - Fix potential warnings when assigning -1 to paintlen by using
+         if/else clauses instead of "?" operators. (DLR)
 - BUGS:
        - Miscellaneous cosmetic fixes. (DLR)
 
index a3194557dbb44e61cc45f7bb11fdd5bb0f98e62c..b9a055dd265b12a1ba9fb16e5818b723b09380f6 100644 (file)
@@ -2513,9 +2513,12 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
                     * expanded location of the end of the match minus
                     * the expanded location of the beginning of the
                     * page. */
-                   paintlen = (end_line != fileptr) ? -1 :
-                       actual_x(converted, strnlenpt(fileptr->data,
-                       endmatch.rm_eo) - start);
+                   if (end_line != fileptr)
+                       paintlen = -1;
+                   else
+                       paintlen = actual_x(converted,
+                               strnlenpt(fileptr->data,
+                               endmatch.rm_eo) - start);
 
                    mvwaddnstr(edit, line, 0, converted, paintlen);
 
@@ -2639,8 +2642,11 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
             * Otherwise, paintlen is the expanded location of the end
             * of the mark minus the expanded location of the beginning
             * of the mark. */
-           paintlen = (bot_x >= endpos) ? -1 : strnlenpt(fileptr->data,
-               bot_x) - (x_start + start);
+           if (bot_x >= endpos)
+               paintlen = -1;
+           else
+               paintlen = strnlenpt(fileptr->data, bot_x) - (x_start +
+                       start);
 
            /* If x_start is before the beginning of the page, shift
             * paintlen x_start characters to compensate, and put