~mdw
/
catacomb-python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e8cd4ca
)
rand.c: Some gratuitous reformatting.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 15 Nov 2019 18:28:35 +0000
(18:28 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 25 Nov 2019 17:43:08 +0000
(17:43 +0000)
rand.c
patch
|
blob
|
blame
|
history
diff --git
a/rand.c
b/rand.c
index
675bf70
..
6c6abdb
100644
(file)
--- a/
rand.c
+++ b/
rand.c
@@
-103,15
+103,12
@@
static PyObject *grmeth_range(PyObject *me, PyObject *arg)
if (grand_check(me)) return (0);
if (PyInt_Check(m)) {
long mm = PyInt_AS_LONG(m);
if (grand_check(me)) return (0);
if (PyInt_Check(m)) {
long mm = PyInt_AS_LONG(m);
- if (mm <= 0)
- goto notpos;
- if (mm <= 0xffffffff)
+ if (mm <= 0) goto notpos;
+ else if (mm <= 0xffffffff)
return (PyInt_FromLong(grand_range(GRAND_R(me), mm)));
}
return (PyInt_FromLong(grand_range(GRAND_R(me), mm)));
}
- if ((x = getmp(m)) == 0)
- goto end;
- if (!MP_POSP(x))
- goto notpos;
+ if ((x = getmp(m)) == 0) goto end;
+ if (!MP_POSP(x)) goto notpos;
y = mprand_range(MP_NEW, x, GRAND_R(me), 0);
MP_DROP(x);
return (mp_pywrap(y));
y = mprand_range(MP_NEW, x, GRAND_R(me), 0);
MP_DROP(x);
return (mp_pywrap(y));