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

uint64 #89

Closed
weusego opened this issue Mar 19, 2022 · 5 comments
Closed

uint64 #89

weusego opened this issue Mar 19, 2022 · 5 comments

Comments

@weusego
Copy link

weusego commented Mar 19, 2022

Hello,

it appears v0.311 silently fails and generates no output at all with

type uint64
constant values > maxint32

@abice
Copy link
Owner

abice commented Mar 19, 2022

Do you have an example for me to use during debugging/testing?

@weusego
Copy link
Author

weusego commented Mar 19, 2022

will isolate the case

@weusego
Copy link
Author

weusego commented Mar 19, 2022

This fails

//go:generate go-enum -f=$GOFILE --ptr --marshal --nocamel --noprefix --prefix Enum64bit_

enum64bit.go

package Enum64bit

/* ENUM(

Unkno= 0
E2P15					= 32768
E2P16					= 65536
E2P17					= 131072
E2P18					= 262144
E2P19					= 524288
E2P20					= 1048576
E2P21					= 2097152
E2P22					= 33554432
E2P23					= 67108864
E2P28					= 536870912
E2P30					= 1073741824
E2P31					= 2147483648
E2P32					= 4294967296
E2P33					= 8454967296

)

*/
type Enum64bit uint64

resulting only in

enum64bit_enum.go

// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:

package Enum64bit

On go 1.18 ubuntu 21.04

@weusego
Copy link
Author

weusego commented Mar 19, 2022

This of course works

//go:generate go-enum -f=$GOFILE --ptr --marshal --nocamel --noprefix --prefix Enum32bit_

package Enum32bit

/* ENUM(

Unkno					= 0
E2P15					= 32768
E2P16					= 65536
E2P17					= 131072
E2P18					= 262144
E2P19					= 524288
E2P20					= 1048576
E2P21					= 2097152
E2P22					= 33554432
E2P23					= 67108864
E2P28					= 536870912
E2P30					= 1073741824

)

*/
type Enum32bit uint32

//E2P31					= 2147483648

But also fails when you add the E2P31 for 2^31

These are constants actually representing a bitset, for which we're using go-enum, because it's so convenient

@abice
Copy link
Owner

abice commented Mar 19, 2022

@weusego Fixed the issue in #90. If you can use it without a release, please do so and provide feedback in case I missed anything.

Thanks!

@abice abice closed this as completed Mar 22, 2022
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

2 participants