diff options
author | Oliver Kiddle <opk@zsh.org> | 2022-12-16 23:22:33 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2022-12-16 23:28:10 +0100 |
commit | a73c705b0c864a9ce042fca6e72e0c92d4ad8237 (patch) | |
tree | 6ea60926217bfc66140a8f60bbc8c37f36396ea2 /Src/sort.c | |
parent | 7fb6c133bfdf445b4478897adc142ed7d07b5fd6 (diff) | |
download | zsh-a73c705b0c864a9ce042fca6e72e0c92d4ad8237.tar.gz zsh-a73c705b0c864a9ce042fca6e72e0c92d4ad8237.zip |
51212: remove STOUC() macro
This served as a workaround for ancient compilers where casts to
unsigned char were broken.
Diffstat (limited to 'Src/sort.c')
-rw-r--r-- | Src/sort.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/sort.c b/Src/sort.c index 26949ad9c..ce2b4bbc3 100644 --- a/Src/sort.c +++ b/Src/sort.c @@ -138,7 +138,7 @@ eltpcmp(const void *a, const void *b) int mul = 0; for (; *as == *bs && *as; as++, bs++); #ifndef HAVE_STRCOLL - cmp = (int)STOUC(*as) - (int)STOUC(*bs); + cmp = (int) (unsigned char) *as - (int) (unsigned char) *bs; #endif if (sortnumeric < 0) { if (*as == '-' && idigit(as[1]) && idigit(*bs)) { @@ -159,7 +159,7 @@ eltpcmp(const void *a, const void *b) bs++; for (; idigit(*as) && *as == *bs; as++, bs++); if (idigit(*as) || idigit(*bs)) { - cmp = mul * ((int)STOUC(*as) - (int)STOUC(*bs)); + cmp = mul * ((int) (unsigned char) *as - (int) (unsigned char) *bs); while (idigit(*as) && idigit(*bs)) as++, bs++; if (idigit(*as) && !idigit(*bs)) |