From: Simon Glass Date: Mon, 2 Oct 2023 01:13:10 +0000 (-0600) Subject: cli: Use unsigned int instead of unsigned long X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=fedd372976f499afb71f854f401cf3a4432ab8ec;p=u-boot.git cli: Use unsigned int instead of unsigned long The index values are not very large so it makes no sense to use a long integer. Change these to uint instead. Signed-off-by: Simon Glass --- diff --git a/common/cli_readline.c b/common/cli_readline.c index 687e239bfa..f863404110 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -171,7 +171,7 @@ static char *hist_next(void) void cread_print_hist_list(void) { int i; - unsigned long n; + uint n; n = hist_num - hist_max; @@ -211,10 +211,10 @@ void cread_print_hist_list(void) } \ } -static void cread_add_char(char ichar, int insert, unsigned long *num, - unsigned long *eol_num, char *buf, unsigned long len) +static void cread_add_char(char ichar, int insert, uint *num, + uint *eol_num, char *buf, uint len) { - unsigned long wlen; + uint wlen; /* room ??? */ if (insert || *num == *eol_num) { @@ -245,8 +245,7 @@ static void cread_add_char(char ichar, int insert, unsigned long *num, } static void cread_add_str(char *str, int strsize, int insert, - unsigned long *num, unsigned long *eol_num, - char *buf, unsigned long len) + uint *num, uint *eol_num, char *buf, uint len) { while (strsize--) { cread_add_char(*str, insert, num, eol_num, buf, len); @@ -258,9 +257,9 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len, int timeout) { struct cli_ch_state s_cch, *cch = &s_cch; - unsigned long num = 0; - unsigned long eol_num = 0; - unsigned long wlen; + uint num = 0; + uint eol_num = 0; + uint wlen; char ichar; int insert = 1; int init_len = strlen(buf);