Skip to content

Commit 6d320fe

Browse files
committed
MaxInt64 -> math.MaxInt64
1 parent 294022b commit 6d320fe

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

ptr.go

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package goquic
22

3-
import "sync"
3+
import (
4+
"sync"
5+
"math"
6+
)
47

58
// Generated by `ptr_gen.py ProofSource ProofVerifier ProofVerifyJob TaskRunner ServerWriter ClientWriter QuicDispatcher QuicServerSession GoQuicAlarm QuicServerStream QuicClientStream`
69
// Do not edit manually!
710

8-
const MaxInt64 = 1<<63 - 1
9-
1011

1112
var proofSourcePtr = &ProofSourcePtr{pool: make(map[int64]*ProofSource)}
1213

@@ -30,7 +31,7 @@ func (p *ProofSourcePtr) Set(pt *ProofSource) int64 {
3031
break
3132
}
3233
p.index += 1
33-
if p.index == MaxInt64 {
34+
if p.index == math.MaxInt64 {
3435
p.index = 0
3536
}
3637
}
@@ -67,7 +68,7 @@ func (p *ProofVerifierPtr) Set(pt *ProofVerifier) int64 {
6768
break
6869
}
6970
p.index += 1
70-
if p.index == MaxInt64 {
71+
if p.index == math.MaxInt64 {
7172
p.index = 0
7273
}
7374
}
@@ -104,7 +105,7 @@ func (p *ProofVerifyJobPtr) Set(pt *ProofVerifyJob) int64 {
104105
break
105106
}
106107
p.index += 1
107-
if p.index == MaxInt64 {
108+
if p.index == math.MaxInt64 {
108109
p.index = 0
109110
}
110111
}
@@ -141,7 +142,7 @@ func (p *TaskRunnerPtr) Set(pt *TaskRunner) int64 {
141142
break
142143
}
143144
p.index += 1
144-
if p.index == MaxInt64 {
145+
if p.index == math.MaxInt64 {
145146
p.index = 0
146147
}
147148
}
@@ -178,7 +179,7 @@ func (p *ServerWriterPtr) Set(pt *ServerWriter) int64 {
178179
break
179180
}
180181
p.index += 1
181-
if p.index == MaxInt64 {
182+
if p.index == math.MaxInt64 {
182183
p.index = 0
183184
}
184185
}
@@ -215,7 +216,7 @@ func (p *ClientWriterPtr) Set(pt *ClientWriter) int64 {
215216
break
216217
}
217218
p.index += 1
218-
if p.index == MaxInt64 {
219+
if p.index == math.MaxInt64 {
219220
p.index = 0
220221
}
221222
}
@@ -252,7 +253,7 @@ func (p *QuicDispatcherPtr) Set(pt *QuicDispatcher) int64 {
252253
break
253254
}
254255
p.index += 1
255-
if p.index == MaxInt64 {
256+
if p.index == math.MaxInt64 {
256257
p.index = 0
257258
}
258259
}
@@ -289,7 +290,7 @@ func (p *QuicServerSessionPtr) Set(pt *QuicServerSession) int64 {
289290
break
290291
}
291292
p.index += 1
292-
if p.index == MaxInt64 {
293+
if p.index == math.MaxInt64 {
293294
p.index = 0
294295
}
295296
}
@@ -326,7 +327,7 @@ func (p *GoQuicAlarmPtr) Set(pt *GoQuicAlarm) int64 {
326327
break
327328
}
328329
p.index += 1
329-
if p.index == MaxInt64 {
330+
if p.index == math.MaxInt64 {
330331
p.index = 0
331332
}
332333
}
@@ -363,7 +364,7 @@ func (p *QuicServerStreamPtr) Set(pt *QuicServerStream) int64 {
363364
break
364365
}
365366
p.index += 1
366-
if p.index == MaxInt64 {
367+
if p.index == math.MaxInt64 {
367368
p.index = 0
368369
}
369370
}
@@ -400,7 +401,7 @@ func (p *QuicClientStreamPtr) Set(pt *QuicClientStream) int64 {
400401
break
401402
}
402403
p.index += 1
403-
if p.index == MaxInt64 {
404+
if p.index == math.MaxInt64 {
404405
p.index = 0
405406
}
406407
}

ptr_gen.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
HEADER = Template('''\
88
package goquic
99
10-
import "sync"
10+
import (
11+
"sync"
12+
"math"
13+
)
1114
1215
// Generated by `ptr_gen.py ${args}`
1316
// Do not edit manually!
1417
15-
const MaxInt64 = 1<<63 - 1
16-
1718
1819
''')
1920

@@ -40,7 +41,7 @@
4041
break
4142
}
4243
p.index += 1
43-
if p.index == MaxInt64 {
44+
if p.index == math.MaxInt64 {
4445
p.index = 0
4546
}
4647
}

0 commit comments

Comments
 (0)