aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-01 03:50:17 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-01 04:21:39 +0530
commitef159b99850553841ab6d3842e8c7fa6c2096685 (patch)
treed20f089bb446ffd74ce9bc066249a0bf871fe7a0 /src/nnn.c
parentf8d2be504a19a5721579e95555d84689b9463969 (diff)
downloadnnn-ef159b99850553841ab6d3842e8c7fa6c2096685.tar.gz
Fix clang-tidy warnings
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 3104f26..a616bdf 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2138,7 +2138,7 @@ static int xstrverscasecmp(const char * const s1, const char * const s2)
state += (c1 == '0') + (xisdigit(c1) != 0);
}
- state = result_type[state * 3 + (((c2 == '0') + (xisdigit(c2) != 0)))];
+ state = (uchar)result_type[state * 3 + (((c2 == '0') + (xisdigit(c2) != 0)))];
switch (state) {
case VCMP:
@@ -2609,7 +2609,8 @@ static int filterentries(char *path, char *lastname)
/* toggle string or regex filter */
if (*ch == FILTER) {
- wln[0] = ln[0] = (ln[0] == FILTER) ? RFILTER : FILTER;
+ ln[0] = (ln[0] == FILTER) ? RFILTER : FILTER;
+ wln[0] = (uchar)ln[0];
cfg.regex ^= 1;
filterfn = (filterfn == &visible_str) ? &visible_re : &visible_str;
showfilter(ln);
@@ -2998,7 +2999,7 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, uchar *items)
while (*ptr && i < maxitems) {
if (ptr == nextkey) {
- kvarr[i].key = *ptr;
+ kvarr[i].key = (uchar)*ptr;
if (*++ptr != ':')
return FALSE;
if (*++ptr == '\0')
@@ -6733,7 +6734,7 @@ int main(int argc, char *argv[])
if (middle_click_env[0] == '^' && middle_click_env[1])
middle_click_key = CONTROL(middle_click_env[1]);
else
- middle_click_key = middle_click_env[0];
+ middle_click_key = (uchar)middle_click_env[0];
#endif
const char* const env_opts = xgetenv(env_cfg[NNN_OPTS], NULL);
int env_opts_id = env_opts ? (int)strlen(env_opts) : -1;
@@ -6834,7 +6835,7 @@ int main(int argc, char *argv[])
break;
case 'T':
if (env_opts_id < 0)
- sort = optarg[0];
+ sort = (uchar)optarg[0];
break;
case 'V':
fprintf(stdout, "%s\n", VERSION);