Skip to content

Commit

Permalink
allow use in 32 bits architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
dalzilio committed Jan 12, 2025
1 parent 92c34e6 commit 40f31fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ func (p *parser) parseTR() error {
if err != nil {
return fmt.Errorf(" in timing interval, %s at %s", tok.s, tok.pos.String())
}
if (v1 < 0) || (v1 >= math.MaxUint32) {
return fmt.Errorf(" coefficient in time interval must be positive and less than 2^32, %s at %s", tok.s, tok.pos.String())
if (v1 < 0) || (v1 >= math.MaxInt32) {
return fmt.Errorf(" coefficient in time interval must be positive and less than 2^31, %s at %s", tok.s, tok.pos.String())
}
tgc.Left.Value = v1
if arr[2] == "w" {
Expand All @@ -180,8 +180,8 @@ func (p *parser) parseTR() error {
if (err != nil) || (v2 < v1) {
return fmt.Errorf(" in timing interval, %s at %s", tok.s, tok.pos.String())
}
if (v2 < 0) || (v2 >= math.MaxUint32) {
return fmt.Errorf(" coefficient in time interval must be positive and less than 2^32, %s at %s", tok.s, tok.pos.String())
if (v2 < 0) || (v2 >= math.MaxInt32) {
return fmt.Errorf(" coefficient in time interval must be positive and less than 2^31, %s at %s", tok.s, tok.pos.String())
}
tgc.Right.Value = v2
if arr[3] == "[" {
Expand Down
4 changes: 2 additions & 2 deletions unique.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func (m Marking) Unique() (Handle, error) {
if v.Mult < 0 {
return Handle(unique.Make("")), fmt.Errorf("negative multiplicity")
}
if v.Mult > math.MaxUint32 {
return Handle(unique.Make("")), fmt.Errorf("negative multiplicity")
if v.Mult >= math.MaxInt32 {
return Handle(unique.Make("")), fmt.Errorf("multiplicity over MaxInt32")
}
binary.BigEndian.PutUint32(arr, uint32(v.Pl))
buf.Write(arr)
Expand Down

0 comments on commit 40f31fb

Please sign in to comment.