Re: [PATCH V4 06/20] tools/rv: Add dot2c

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

 



On Thu, 16 Jun 2022 10:44:48 +0200
Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:

> +    def get_minimun_type(self):
> +        min_type="char"
> +
> +        if self.states.__len__() > 255:
> +            min_type="short"
> +
> +        if self.states.__len__() > 65535:
> +            min_type="int"

Should these be "unsigned"? As char goes from -128 <-> 127
and short goes from -32768 <-> 32767

And are you sure you're not going to have more than 2,147,483,647 states ;-)
(or 4,294,967,296 if it's unsigned).

-- Steve

> +
> +        return min_type
> +



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux