]> granicus.if.org Git - python/commitdiff
Now that prototypes are in scope, the compiler gives legit wngs
authorTim Peters <tim.peters@gmail.com>
Mon, 10 Jul 2000 22:41:30 +0000 (22:41 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 10 Jul 2000 22:41:30 +0000 (22:41 +0000)
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!

Modules/rotormodule.c

index 6960acf1c5c2b69798e3039923ec3c21ff559c49..70ba03287f2ddbbf6d6d098a1a51a32ae4adfd48 100644 (file)
@@ -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)]));