0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0106: printf formats are not exactly right

Problem:    Printf formats are not exactly right.
Solution:   Adjust signed/unsigned conversions. (Frazer Clews, closes #5456)
This commit is contained in:
Bram Moolenaar
2020-01-08 22:06:14 +01:00
parent c838626fea
commit b16ad96849
5 changed files with 21 additions and 19 deletions

View 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)

View 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) {

View 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++]))

View File

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

View File

@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
106,
/**/
105,
/**/