diff options
author | Simon Glass <sjg@chromium.org> | 2023-10-01 19:13:10 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-11 15:43:54 -0400 |
commit | fedd372976f499afb71f854f401cf3a4432ab8ec (patch) | |
tree | b3ca8425fd426bffb4c3a05b907595a932f6a854 | |
parent | dcc18ce0dbaf93d82ef7f0c6fe625c42313eca32 (diff) | |
download | u-boot-fedd372976f499afb71f854f401cf3a4432ab8ec.tar.gz u-boot-fedd372976f499afb71f854f401cf3a4432ab8ec.tar.bz2 u-boot-fedd372976f499afb71f854f401cf3a4432ab8ec.zip |
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 <sjg@chromium.org>
-rw-r--r-- | common/cli_readline.c | 17 |
1 files changed, 8 insertions, 9 deletions
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); |