make some narrowing of integers explicit

this does specifically *not* cover about a bazillion warnings about
size_t being shrunk to uint - these make no sense given the expected
data set size.
This commit is contained in:
Oswald Buddenhagen 2019-07-28 22:10:21 +02:00
parent 4d7e169e57
commit cc176df2c3
4 changed files with 6 additions and 6 deletions

View File

@ -2377,7 +2377,7 @@ imap_open_store_ssl_bail( imap_store_t *ctx )
static void
imap_open_store_bail( imap_store_t *ctx, int failed )
{
((imap_store_conf_t *)ctx->gen.conf)->server->failed = failed;
((imap_store_conf_t *)ctx->gen.conf)->server->failed = (char)failed;
ctx->callbacks.imap_open( DRV_STORE_BAD, ctx->callback_aux );
}

View File

@ -1017,7 +1017,7 @@ maildir_scan( maildir_store_t *ctx, msg_t_array_alloc_t *msglist )
entry->base = nfstrdup( e->d_name );
entry->msgid = 0;
entry->uid = uid;
entry->recent = i;
entry->recent = (uchar)i;
entry->size = 0;
entry->tuid[0] = 0;
}

View File

@ -957,11 +957,11 @@ load_state( sync_vars_t *svars )
break;
case '*':
debug( "flags now %u\n", t3 );
srec->flags = t3;
srec->flags = (uchar)t3;
break;
case '~':
debug( "status now %#x\n", t3 );
srec->status = t3;
srec->status = (uchar)t3;
break;
default:
error( "Error: unrecognized journal entry at %s:%d\n", svars->jname, line );
@ -1895,7 +1895,7 @@ msgs_copied( sync_vars_t *svars, int t )
}
for (uint i = 0; i < TUIDL; i++) {
uchar c = arc4_getbyte() & 0x3f;
srec->tuid[i] = c < 26 ? c + 'A' : c < 52 ? c + 'a' - 26 : c < 62 ? c + '0' - 52 : c == 62 ? '+' : '/';
srec->tuid[i] = (char)(c < 26 ? c + 'A' : c < 52 ? c + 'a' - 26 : c < 62 ? c + '0' - 52 : c == 62 ? '+' : '/');
}
jFprintf( svars, "# %u %u %." stringify(TUIDL) "s\n", srec->uid[M], srec->uid[S], srec->tuid );
debug( "%sing message %u, TUID %." stringify(TUIDL) "s\n", str_hl[t], tmsg->uid, srec->tuid );

View File

@ -592,7 +592,7 @@ arc4_init( void )
close( fd );
for (i = 0; i < 256; i++)
rs.s[i] = i;
rs.s[i] = (uchar)i;
for (i = j = 0; i < 256; i++) {
si = rs.s[i];
j += si + dat[i & 127];