This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use correct signedness in wcsncmp.


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]