mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
cksum,df,digest: prefer signed types
* src/cksum.c (main): * src/df.c (decode_output_arg): * src/digest.c (valid_digits): Prefer idx_t to unsigned types when the value is an index into an array.
This commit is contained in:
1 parent
73a813e484
commit
89f7d44912
3 files changed
+3
-3
No files matched your search
+1
-1
@@ -109,7 +109,7 @@ main (void)
|
||||
uint32_t crc = 0;
|
||||
|
||||
crc = (crc << 8) ^ crctab[0][((crc >> 24) ^ (i & 0xFF)) & 0xFF];
|
||||
for (unsigned int offset = 1; offset < 8; offset++)
|
||||
for (idx_t offset = 1; offset < 8; offset++)
|
||||
{
|
||||
crc = (crc << 8) ^ crctab[0][((crc >> 24) ^ 0x00) & 0xFF];
|
||||
crctab[offset][i] = crc;
|
||||
|
||||
@@ -443,7 +443,7 @@ decode_output_arg (char const *arg)
|
||||
|
||||
/* process S. */
|
||||
display_field_t field = INVALID_FIELD;
|
||||
for (unsigned int i = 0; i < ARRAY_CARDINALITY (field_data); i++)
|
||||
for (idx_t i = 0; i < ARRAY_CARDINALITY (field_data); i++)
|
||||
{
|
||||
if (STREQ (field_data[i].arg, s))
|
||||
{
|
||||
|
||||
+1
-1
@@ -658,7 +658,7 @@ valid_digits (unsigned char const *s, size_t len)
|
||||
#endif
|
||||
if (len == digest_hex_bytes)
|
||||
{
|
||||
for (unsigned int i = 0; i < digest_hex_bytes; i++)
|
||||
for (idx_t i = 0; i < digest_hex_bytes; i++)
|
||||
{
|
||||
if (!isxdigit (*s))
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user