+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entries_read));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->entries_read = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->entries_read = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }