File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2
2
#include <Python.h>
3
3
4
4
#include <inttypes.h>
5
+ #include <limits.h>
5
6
#include <stdbool.h>
6
7
7
8
#include "hdrbg.h"
@@ -83,7 +84,7 @@ Uint(PyObject *self, PyObject *args)
83
84
modulus = PyLong_AsUnsignedLongLong (PyTuple_GET_ITEM (args , 0 ));
84
85
if (PyErr_Occurred () != NULL || modulus == 0 || modulus > UINT64_MAX )
85
86
{
86
- return PyErr_Format (PyExc_ValueError , "argument 1 must be an integer in [1, %" PRIu64 " ]" , UINT64_MAX );
87
+ return PyErr_Format (PyExc_ValueError , "argument 1 must be an integer in [1, %llu ]" , UINT64_MAX );
87
88
}
88
89
uint64_t r = hdrbg_uint (NULL , modulus );
89
90
ERR_CHECK ;
@@ -108,9 +109,8 @@ Span(PyObject *self, PyObject *args)
108
109
{
109
110
return PyErr_Format (
110
111
PyExc_ValueError ,
111
- "argument 1 must be less than argument 2; both must be integers in [%" PRId64 ", %" PRId64 "] "
112
- "and fit in the C `long long` type" ,
113
- INT64_MIN , INT64_MAX
112
+ "argument 1 must be less than argument 2; both must be integers in [%lld, %lld]" ,
113
+ INT64_MIN < LLONG_MIN ? LLONG_MIN : INT64_MIN , INT64_MAX
114
114
);
115
115
}
116
116
int64_t r = hdrbg_span (NULL , left , right );
@@ -191,6 +191,10 @@ static PyModuleDef pyhdrbg =
191
191
pyhdrbg_doc ,
192
192
-1 ,
193
193
pyhdrbg_methods ,
194
+ NULL ,
195
+ NULL ,
196
+ NULL ,
197
+ NULL ,
194
198
};
195
199
196
200
You can’t perform that action at this time.
0 commit comments