mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Use explicit casts for conversions losing integer precision
This commit is contained in:
parent
1e63f69520
commit
f5dc8abea4
3 changed files with 4 additions and 4 deletions
|
|
@ -190,7 +190,7 @@ static int rstring_esc(char **dest, int *destlen) {
|
||||||
|
|
||||||
C(rfill1);
|
C(rfill1);
|
||||||
|
|
||||||
#define ap(c) if(*destlen > 1) { *((*dest)++) = c; (*destlen)--; }
|
#define ap(c) if(*destlen > 1) { *((*dest)++) = (char)(c); (*destlen)--; }
|
||||||
switch(*ctx->buf) {
|
switch(*ctx->buf) {
|
||||||
case '"': ap('"'); con(1); break;
|
case '"': ap('"'); con(1); break;
|
||||||
case '\\': ap('\\'); con(1); break;
|
case '\\': ap('\\'); con(1); break;
|
||||||
|
|
@ -459,7 +459,7 @@ static int iteminfo(void) {
|
||||||
} else if(strcmp(ctx->val, "mode") == 0) { /* mode */
|
} else if(strcmp(ctx->val, "mode") == 0) { /* mode */
|
||||||
C(rint64(&iv, UINT16_MAX));
|
C(rint64(&iv, UINT16_MAX));
|
||||||
ctx->buf_dir->flags |= FF_EXT;
|
ctx->buf_dir->flags |= FF_EXT;
|
||||||
ctx->buf_ext->mode = iv;
|
ctx->buf_ext->mode = (unsigned short)iv;
|
||||||
} else if(strcmp(ctx->val, "mtime") == 0) { /* mtime */
|
} else if(strcmp(ctx->val, "mtime") == 0) { /* mtime */
|
||||||
C(rint64(&iv, UINT64_MAX));
|
C(rint64(&iv, UINT64_MAX));
|
||||||
ctx->buf_dir->flags |= FF_EXT;
|
ctx->buf_dir->flags |= FF_EXT;
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ static void stat_to_dir(struct stat *fs) {
|
||||||
buf_dir->asize = fs->st_size;
|
buf_dir->asize = fs->st_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf_ext->mode = fs->st_mode;
|
buf_ext->mode = (unsigned short)fs->st_mode;
|
||||||
buf_ext->mtime = fs->st_mtime;
|
buf_ext->mtime = fs->st_mtime;
|
||||||
buf_ext->uid = (int)fs->st_uid;
|
buf_ext->uid = (int)fs->st_uid;
|
||||||
buf_ext->gid = (int)fs->st_gid;
|
buf_ext->gid = (int)fs->st_gid;
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ void uic_init() {
|
||||||
use_default_colors();
|
use_default_colors();
|
||||||
for(i=0; i<sizeof(colors)/sizeof(*colors)-1; i++) {
|
for(i=0; i<sizeof(colors)/sizeof(*colors)-1; i++) {
|
||||||
j = i*2 + uic_theme;
|
j = i*2 + uic_theme;
|
||||||
init_pair(i+1, color_defs[j].fg, color_defs[j].bg);
|
init_pair((short)i+1, color_defs[j].fg, color_defs[j].bg);
|
||||||
colors[i] = color_defs[j].attr | COLOR_PAIR(i+1);
|
colors[i] = color_defs[j].attr | COLOR_PAIR(i+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue