[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/string: Fix strcmp() and strncmp()



>>> On 04.01.19 at 18:00, <andrew.cooper3@xxxxxxxxxx> wrote:
> The C spec requires that the comarison be done in terms of unsigned char.
> 
> The code style in this file is terrible, but does claim to be Xen BSD style,
> so fix up these functions while rewriting them.

Where have you found this claim? The comment at the bottom has

 * c-file-style: "BSD"
 * c-basic-offset: 8
 * tab-width: 8
 * indent-tabs-mode: t

i.e. clearly not Xen style.

> @@ -139,15 +141,18 @@ int (strcmp)(const char *cs, const char *ct)
>   */
>  int (strncmp)(const char *cs, const char *ct, size_t count)
>  {
> -     register signed char __res = 0;
> +    for ( ; count; count-- )

Odd loop heading when "while (count--)" would do, since "count"
isn't used elsewhere.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.