lkml.org 
[lkml]   [2022]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V4 06/20] tools/rv: Add dot2c
From
On 6/28/22 20:16, Steven Rostedt wrote:
> On Thu, 16 Jun 2022 10:44:48 +0200
> Daniel Bristot de Oliveira <bristot@kernel.org> 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).

Fixed! now I am using the "state_max" as the invalid state, so I can use unsigned.

I also revisited all python code for consistency.

-- Daniel

\
 
 \ /
  Last update: 2022-07-13 20:41    [W:0.052 / U:3.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site