summaryrefslogtreecommitdiff
path: root/missing/crypt.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-02 03:05:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-02 03:05:40 +0000
commit80cd6b8757c253b5107710fa3c4f36370d1b9d63 (patch)
tree87e65c10e4435537d9eb379f700ba2c990341829 /missing/crypt.c
parent9334bb3075396512ebca367da63bc22c4ceeea39 (diff)
crypt.c: suppress warnings
* missing/crypt.c (SPE): make unsigned so that literal integers do not exceed 32bit signed integer limit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing/crypt.c')
-rw-r--r--missing/crypt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/missing/crypt.c b/missing/crypt.c
index 269db9ed4c..a6290f5461 100644
--- a/missing/crypt.c
+++ b/missing/crypt.c
@@ -323,7 +323,7 @@ typedef struct {
C_block IE3264[32/CHUNKBITS][1<<CHUNKBITS];
/* Table that combines the S, P, and E operations. */
- long SPE[2][8][64];
+ unsigned long SPE[2][8][64];
/* compressed/interleaved => final permutation table */
C_block CF6464[64/CHUNKBITS][1<<CHUNKBITS];
@@ -505,7 +505,7 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
#if defined(pdp11)
register int j;
#endif
- register long L0, L1, R0, R1, k;
+ register unsigned long L0, L1, R0, R1, k;
register const C_block *kp;
register int ks_inc, loop_count;
C_block B;
@@ -554,7 +554,7 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
loop_count = 8;
do {
-#define SPTAB(t, i) (*(const long *)((const unsigned char *)(t) + (i)*(sizeof(long)/4)))
+#define SPTAB(t, i) (*(const unsigned long *)((const unsigned char *)(t) + (i)*(sizeof(long)/4)))
#if defined(gould)
/* use this if B.b[i] is evaluated just once ... */
#define DOXOR(x,y,i) (x)^=SPTAB(SPE[0][(i)],B.b[(i)]); (y)^=SPTAB(SPE[1][(i)],B.b[(i)]);
@@ -922,7 +922,7 @@ main(void)
printf("};\n\n");
printf("/* Table that combines the S, P, and E operations. */\n");
- printf("static const long SPE[2][8][64] = {\n");
+ printf("static const unsigned long SPE[2][8][64] = {\n");
for (i = 0; i < numberof(SPE); ++i) {
printf("\t{\n");
for (j = 0; j < numberof(SPE[0]); ++j) {
@@ -930,7 +930,7 @@ main(void)
printf("\t\t{");
for (k = 0; k < numberof(SPE[0][0]); ++k) {
if (r == 0) printf("\n\t\t\t");
- printf("%10ld,", SPE[i][j][k]);
+ printf("%#10lx,", SPE[i][j][k]);
if (++r == 4) r = 0;
}
printf("\n\t\t},\n");