This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use correct signedness in wcsncmp.
- From: Andreas Schwab <schwab at suse dot de>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 07 Apr 2015 11:55:27 +0200
- Subject: Re: [PATCH] Use correct signedness in wcsncmp.
- Authentication-results: sourceware.org; auth=none
- References: <mf0dja$acn$1 at ger dot gmane dot org> <alpine dot DEB dot 2 dot 10 dot 1504021735250 dot 408 at digraph dot polyomino dot org dot uk> <mg06ld$ods$1 at ger dot gmane dot org>
Stefan Liebler <stli@linux.vnet.ibm.com> writes:
> @@ -82,12 +154,12 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char,
> int exp_result)
> {
> size_t i, align_n;
> - char *s1, *s2;
> + CHAR *s1, *s2;
>
> if (n == 0)
> {
> - s1 = (char*)(buf1 + page_size);
> - s2 = (char*)(buf2 + page_size);
> + s1 = (CHAR*)(buf1 + page_size);
> + s2 = (CHAR*)(buf2 + page_size);
Please add a space before '*' and after the cast.
> if (align1 < align_n)
> - s1 -= (align_n - align1);
> + s1 = (CHAR*) (((char*)s1) - (align_n - align1));
Please remove the redundant parens around the cast expression.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."