]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0106: printf formats are not exactly right v8.2.0106
authorBram Moolenaar <Bram@vim.org>
Wed, 8 Jan 2020 21:06:14 +0000 (22:06 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 Jan 2020 21:06:14 +0000 (22:06 +0100)
Problem:    Printf formats are not exactly right.
Solution:   Adjust signed/unsigned conversions. (Frazer Clews, closes #5456)

runtime/tools/ccfilter.c
src/libvterm/src/parser.c
src/libvterm/src/pen.c
src/ui.c
src/version.c

index 8539e2a3dcb75738e95be202dcf73c859e89ac5f..43489f16c290f73465e57a0298d5ecc16da2d239 100644 (file)
@@ -184,7 +184,7 @@ int main( int argc, char *argv[] )
          case COMPILER_GCC:
            Severity = 'e';
 #ifdef GOTO_FROM_WHERE_INCLUDED
-           rv = sscanf( Line, "In file included from %[^:]:%u:",
+           rv = sscanf( Line, "In file included from %[^:]:%lu:",
                               FileName, &Row );
            if ( rv == 2 )
              {
@@ -193,11 +193,11 @@ int main( int argc, char *argv[] )
            else
 #endif
              {
-               if ((rv = sscanf( Line, "%[^:]:%u: warning: %[^\n]",
+               if ((rv = sscanf( Line, "%[^:]:%lu: warning: %[^\n]",
                                   FileName, &Row, Reason ))==3) {
                 Severity = 'w';
                } else {
-               rv = sscanf( Line, "%[^:]:%u: %[^\n]",
+               rv = sscanf( Line, "%[^:]:%lu: %[^\n]",
                                   FileName, &Row, Reason );
                }
                ok = ( rv == 3 );
@@ -205,24 +205,24 @@ int main( int argc, char *argv[] )
            Col = (dec_col ? 1 : 0 );
            break;
          case COMPILER_AIX:
-           rv = sscanf( Line, "\"%[^\"]\", line %u.%u: %*s (%c) %[^\n]",
+           rv = sscanf( Line, "\"%[^\"]\", line %lu.%lu: %*s (%c) %[^\n]",
                               FileName, &Row, &Col, &Severity, Reason );
            ok = ( rv == 5 );
            break;
          case COMPILER_HPUX:
-           rv = sscanf( Line, "cc: \"%[^\"]\", line %u: %c%*[^:]: %[^\n]",
+           rv = sscanf( Line, "cc: \"%[^\"]\", line %lu: %c%*[^:]: %[^\n]",
                               FileName, &Row, &Severity, Reason );
            ok = ( rv == 4 );
            Col = (dec_col ? 1 : 0 );
            break;
          case COMPILER_SOLARIS:
-           rv = sscanf( Line, "\"%[^\"]\", line %u: warning: %[^\n]",
+           rv = sscanf( Line, "\"%[^\"]\", line %lu: warning: %[^\n]",
                               FileName, &Row, Reason );
            Severity = 'w';
            ok = ( rv == 3 );
            if ( rv != 3 )
              {
-               rv = sscanf( Line, "\"%[^\"]\", line %u: %[^\n]",
+               rv = sscanf( Line, "\"%[^\"]\", line %lu: %[^\n]",
                                   FileName, &Row, Reason );
                Severity = 'e';
                ok = ( rv == 3 );
@@ -230,18 +230,18 @@ int main( int argc, char *argv[] )
            Col = (dec_col ? 1 : 0 );
            break;
          case COMPILER_ATT:
-           rv   = sscanf( Line, "%c \"%[^\"]\",L%u/C%u%*[^:]:%[^\n]",
+           rv   = sscanf( Line, "%c \"%[^\"]\",L%lu/C%lu%*[^:]:%[^\n]",
                                 &Severity, FileName, &Row, &Col, Reason );
            ok = ( rv == 5 );
 
            if (rv != 5)
-             { rv   = sscanf( Line, "%c \"%[^\"]\",L%u/C%u: %[^\n]",
+             { rv   = sscanf( Line, "%c \"%[^\"]\",L%lu/C%lu: %[^\n]",
                                     &Severity, FileName, &Row, &Col, Reason );
                ok = ( rv == 5 );
              }
 
            if (rv != 5)
-             { rv  = sscanf( Line, "%c \"%[^\"]\",L%u: %[^\n]",
+             { rv  = sscanf( Line, "%c \"%[^\"]\",L%lu: %[^\n]",
                                   &Severity, FileName, &Row, Reason );
                ok = ( rv == 4 );
                Col = (dec_col ? 1 : 0 );
@@ -272,10 +272,10 @@ int main( int argc, char *argv[] )
                  }
                 else
                  {
-                   rv = sscanf( p+2, "%[^:]: %u: %[^\n]",
+                   rv = sscanf( p+2, "%[^:]: %lu: %[^\n]",
                                 FileName, &Row, Reason );
                    if (rv != 3)
-                     rv = sscanf( p+2, "%[^,], line %u: %[^\n]",
+                     rv = sscanf( p+2, "%[^,], line %lu: %[^\n]",
                                   FileName, &Row, Reason );
                    ok = ( rv == 3 );
                  }
@@ -315,10 +315,10 @@ int main( int argc, char *argv[] )
        {
          for (p=Reason; (*p) && (isspace(*p)); p++);
          if ( BasePath[CWDlen] == 0 )
-             printf( "%s:%u:%u:%c:%s\n", FileName, Row, Col, Severity, p );
+             printf( "%s:%lu:%lu:%c:%s\n", FileName, Row, Col, Severity, p );
          else
            {
-             printf( "%s/%s:%u:%u:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p );
+             printf( "%s/%s:%lu:%lu:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p );
            }
        }
       if (!prefetch)
index 7d6d2175df4d1d18de21ce7c5aa7e8029f286c6f..8a06c427b0ba1cba16431f0a057ec5a71a2cef7b 100644 (file)
@@ -65,7 +65,7 @@ static void append_strbuffer(VTerm *vt, const char *str, size_t len)
 {
   if(len > vt->parser.strbuffer_len - vt->parser.strbuffer_cur) {
     len = vt->parser.strbuffer_len - vt->parser.strbuffer_cur;
-    DEBUG_LOG1("Truncating strbuffer preserve to %zd bytes\n", len);
+    DEBUG_LOG1("Truncating strbuffer preserve to %zu bytes\n", len);
   }
 
   if(len > 0) {
index c55f6931f82faca7b5fc323349ab732b12c64060..d34599da11b3bb4236450ba0b2fd6950719f87dc 100644 (file)
@@ -387,7 +387,7 @@ INTERNAL void vterm_state_setpen(VTermState *state, const long args[], int argco
 
     if (!done)
     {
-      DEBUG_LOG1("libvterm: Unhandled CSI SGR %lu\n", arg);
+      DEBUG_LOG1("libvterm: Unhandled CSI SGR %ld\n", arg);
     }
 
     while (CSI_ARG_HAS_MORE(args[argi++]))
index f4f7bcf8376a093e65e47a99ce21eda0b1092852..151857f6f4ae1c7538acfd093f6ec9fd16e64645 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -1168,7 +1168,7 @@ clip_start_selection(int col, int row, int repeated_click)
     cb->prev = cb->start;
 
 #ifdef DEBUG_SELECTION
-    printf("Selection started at (%u,%u)\n", cb->start.lnum, cb->start.col);
+    printf("Selection started at (%ld,%d)\n", cb->start.lnum, cb->start.col);
 #endif
 }
 
@@ -1203,7 +1203,7 @@ clip_process_selection(
        }
 
 #ifdef DEBUG_SELECTION
-       printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
+       printf("Selection ended: (%ld,%d) to (%ld,%d)\n", cb->start.lnum,
                cb->start.col, cb->end.lnum, cb->end.col);
 #endif
        if (clip_isautosel_star()
@@ -1347,7 +1347,7 @@ clip_process_selection(
     cb->prev.col  = col;
 
 #ifdef DEBUG_SELECTION
-       printf("Selection is: (%u,%u) to (%u,%u)\n", cb->start.lnum,
+       printf("Selection is: (%ld,%d) to (%ld,%d)\n", cb->start.lnum,
                cb->start.col, cb->end.lnum, cb->end.col);
 #endif
 }
index 1f54a4ae76179f0ee972a05b315a0d802bbc49a8..af80600c0dc2a8bfaf020850901404fb28763e03 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    106,
 /**/
     105,
 /**/