Re: [libvirt] [PATCH] start using c-ctype functions

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

 



Daniel Veillard <veillard@xxxxxxxxxx> wrote:
> On Thu, May 15, 2008 at 05:56:57PM +0200, Jim Meyering wrote:
>> >From db0ed598dfc045f3937a3629a432d2d703449f50 Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <meyering@xxxxxxxxxx>
>> Date: Wed, 14 May 2008 23:06:15 +0200
>> Subject: [PATCH] start using c-ctype functions
>>
>> Up to now, we've been avoiding ctype functions like isspace, isdigit, etc.
>> Now that we have the c-ctype functions, we can start using them to make
>> the code more readable with changes like these:
>
>   okay in principle, as stated previously
>
>
>> -    SKIP_SPACES;
>> +    SKIP_BLANKS;
> [...]
>> -        SKIP_BLANKS;
>> +        SKIP_BLANKS_AND_EOL;
>
>   i was surprized by the macro renaming initially
>
>> +/* Convert C from hexadecimal character to integer.  */
>> +static int
>> +hextobin (unsigned char c)
>> +{
>> +  switch (c)
>> +    {
>> +    default: return c - '0';
>> +    case 'a': case 'A': return 10;
>> +    case 'b': case 'B': return 11;
>> +    case 'c': case 'C': return 12;
>> +    case 'd': case 'D': return 13;
>> +    case 'e': case 'E': return 14;
>> +    case 'f': case 'F': return 15;
>> +    }
>> +}
>
>   putting the default first feels strange to me, i guess it's the
> first time I see a switch that way.
>
>   Patch looks fine to me :-)

Thanks for the review.
I've just committed that and the double-free fix.

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]