summaryrefslogtreecommitdiffstats
path: root/Modules/rotormodule.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-07-10 22:41:30 (GMT)
committerTim Peters <tim.peters@gmail.com>2000-07-10 22:41:30 (GMT)
commitdc0c031ad8018bce613b21405fcb58b0bdda60dc (patch)
tree08a4a519dae2d07e7b56aa36f4442dd2617bccaa /Modules/rotormodule.c
parent194e43e9533b0441b4f5d680f1d0c77e20297a34 (diff)
downloadcpython-dc0c031ad8018bce613b21405fcb58b0bdda60dc.zip
cpython-dc0c031ad8018bce613b21405fcb58b0bdda60dc.tar.gz
cpython-dc0c031ad8018bce613b21405fcb58b0bdda60dc.tar.bz2
Now that prototypes are in scope, the compiler gives legit wngs
about int size mismatches at two calls to s_rand. Stuffed in casts to make the code do what it did before but w/o warnings -- although unclear that's correct!
Diffstat (limited to 'Modules/rotormodule.c')
-rw-r--r--Modules/rotormodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/rotormodule.c b/Modules/rotormodule.c
index 6960acf..70ba032 100644
--- a/Modules/rotormodule.c
+++ b/Modules/rotormodule.c
@@ -330,8 +330,8 @@ RTR_init(Rotorobj *r)
RTR_e_rotors(r);
RTR_d_rotors(r);
for (i = 0; i < r->rotors; i++) {
- r->positions[i] = (unsigned char) r_rand(r,r->size);
- r->advances[i] = (1+(2*(r_rand(r,r->size/2))));
+ r->positions[i] = (unsigned char) r_rand(r, (short)r->size);
+ r->advances[i] = (1+(2*(r_rand(r, (short)(r->size/2)))));
RTR_permute_rotor(r,
&(r->e_rotor[(i*r->size)]),
&(r->d_rotor[(i*r->size)]));