Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractType.unitSize value is a string instead of an int #102

Open
ghost opened this issue May 11, 2017 · 2 comments
Open

AbstractType.unitSize value is a string instead of an int #102

ghost opened this issue May 11, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented May 11, 2017

The available values of AbstractType.unitSize are :
UNITSIZE_1 = '1'
UNITSIZE_4 = '4'
UNITSIZE_8 = '8'
UNITSIZE_16 = '16'
UNITSIZE_32 = '32'
UNITSIZE_64 = '64'

Why aren't they int values?
UNITSIZE_1 = 1
UNITSIZE_4 = 4
UNITSIZE_8 = 8
UNITSIZE_16 = 16
UNITSIZE_32 = 32
UNITSIZE_64 = 64

Comparing int values is faster than str.
Furthermore, in splitStatic() of Inference/Vocabulary/Format.py the docstring tells that unitSize parameter is an int.
And in RelationFinder._generateDataValues() we can see the conversion from int to str then from str to int to get the good unitSize...

@Sygus
Copy link
Member

Sygus commented May 11, 2017

I agree with this proposition. I will provide a PR.

Sygus pushed a commit that referenced this issue Dec 29, 2022
Resolve "doc (dsl) minor fix on Preset class"

Closes #102

See merge request ANS015/netzob!287
Sygus pushed a commit that referenced this issue Dec 30, 2022
Resolve "doc (dsl) minor fix on Preset class"

Closes #102

See merge request ANS015/netzob!287
@Sygus Sygus closed this as completed in 112bcf9 Jan 3, 2023
@Sygus
Copy link
Member

Sygus commented Jan 8, 2023


@Sygus Sygus reopened this Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant