Skip to content

Commit ac19b92

Browse files
committed
Merge pull request #21 from mingodad/master
Change array declarations from C style to D style to allow compile with ...
2 parents 8a17a78 + 4ff7537 commit ac19b92

29 files changed

+104
-106
lines changed

deimos/openssl/aes.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ nothrow:
7575
/* This should be a hidden type, but EVP requires that the size be known */
7676
struct aes_key_st {
7777
version (AES_LONG) {
78-
c_ulong rd_key[4* (AES_MAXNR + 1)];
78+
c_ulong[4* (AES_MAXNR + 1)] rd_key;
7979
} else {
80-
uint rd_key[4* (AES_MAXNR + 1)];
80+
uint[4* (AES_MAXNR + 1)] rd_key;
8181
}
8282
int rounds;
8383
};
@@ -119,8 +119,8 @@ void AES_ofb128_encrypt(const(ubyte)* in_, ubyte* out_,
119119
ubyte* ivec, int* num);
120120
void AES_ctr128_encrypt(const(ubyte)* in_, ubyte* out_,
121121
size_t length, const(AES_KEY)* key,
122-
ubyte ivec[AES_BLOCK_SIZE],
123-
ubyte ecount_buf[AES_BLOCK_SIZE],
122+
ubyte[AES_BLOCK_SIZE] ivec,
123+
ubyte[AES_BLOCK_SIZE] ecount_buf,
124124
uint* num);
125125
/* NB: the IV is _two_ blocks long */
126126
void AES_ige_encrypt(const(ubyte)* in_, ubyte* out_,

deimos/openssl/asn1t.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ nothrow:
148148
*/
149149
150150
#define ASN1_SEQUENCE(tname) \
151-
static const ASN1_TEMPLATE tname##_seq_tt[]
151+
static const ASN1_TEMPLATE[] tname##_seq_tt
152152
153153
#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
154154
@@ -252,7 +252,7 @@ nothrow:
252252
*/
253253
254254
#define ASN1_CHOICE(tname) \
255-
static const ASN1_TEMPLATE tname##_ch_tt[]
255+
static const ASN1_TEMPLATE[] tname##_ch_tt
256256
257257
#define ASN1_CHOICE_cb(tname, cb) \
258258
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
@@ -392,7 +392,7 @@ nothrow:
392392
/* Macros for the ASN1_ADB structure */
393393
394394
#define ASN1_ADB(name) \
395-
static const ASN1_ADB_TABLE name##_adbtbl[]
395+
static const ASN1_ADB_TABLE[] name##_adbtbl
396396
397397
#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
398398

deimos/openssl/blowfish.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ enum BF_ROUNDS = 16;
100100
enum BF_BLOCK = 8;
101101

102102
struct bf_key_st {
103-
BF_LONG P[BF_ROUNDS+2];
104-
BF_LONG S[4*256];
103+
BF_LONG[BF_ROUNDS+2] P;
104+
BF_LONG[4*256] S;
105105
}
106106
alias bf_key_st BF_KEY;
107107

deimos/openssl/bn.d

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ struct bn_mont_ctx_st
339339
BIGNUM N; /* The modulus */
340340
BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
341341
* (Ni is only stored for bignum algorithm) */
342-
BN_ULONG n0[2];/* least significant word(s) of Ni;
342+
BN_ULONG[2] n0;/* least significant word(s) of Ni;
343343
(type changed with 0.9.9, was "BN_ULONG n0;" before) */
344344
int flags;
345345
};
@@ -670,26 +670,24 @@ alias BN_ucmp BN_GF2m_cmp;
670670
* t^p[0] + t^p[1] + ... + t^p[k]
671671
* where m = p[0] > p[1] > ... > p[k] = 0.
672672
*/
673-
int BN_GF2m_mod_arr(BIGNUM* r, const(BIGNUM)* a, const int p[]);
673+
int BN_GF2m_mod_arr(BIGNUM* r, const(BIGNUM)* a, const int[] p);
674674
/* r = a mod p */
675675
int BN_GF2m_mod_mul_arr(BIGNUM* r, const(BIGNUM)* a, const(BIGNUM)* b,
676-
const int p[], BN_CTX* ctx); /* r = (a* b) mod p */
677-
int BN_GF2m_mod_sqr_arr(BIGNUM* r, const(BIGNUM)* a, const int p[],
676+
const int[] p, BN_CTX* ctx); /* r = (a* b) mod p */
677+
int BN_GF2m_mod_sqr_arr(BIGNUM* r, const(BIGNUM)* a, const int[] p,
678678
BN_CTX* ctx); /* r = (a* a) mod p */
679-
int BN_GF2m_mod_inv_arr(BIGNUM* r, const(BIGNUM)* b, const int p[],
679+
int BN_GF2m_mod_inv_arr(BIGNUM* r, const(BIGNUM)* b, const int[] p,
680680
BN_CTX* ctx); /* r = (1 / b) mod p */
681681
int BN_GF2m_mod_div_arr(BIGNUM* r, const(BIGNUM)* a, const(BIGNUM)* b,
682-
const int p[], BN_CTX* ctx); /* r = (a / b) mod p */
682+
const int[] p, BN_CTX* ctx); /* r = (a / b) mod p */
683683
int BN_GF2m_mod_exp_arr(BIGNUM* r, const(BIGNUM)* a, const(BIGNUM)* b,
684-
const int p[], BN_CTX* ctx); /* r = (a ^ b) mod p */
684+
const int[] p, BN_CTX* ctx); /* r = (a ^ b) mod p */
685685
int BN_GF2m_mod_sqrt_arr(BIGNUM* r, const(BIGNUM)* a,
686-
const int p[], BN_CTX* ctx); /* r = sqrt(a) mod p */
686+
const int[] p, BN_CTX* ctx); /* r = sqrt(a) mod p */
687687
int BN_GF2m_mod_solve_quad_arr(BIGNUM* r, const(BIGNUM)* a,
688-
const int p[], BN_CTX* ctx); /* r^2 + r = a mod p */
689-
int BN_GF2m_poly2arr(const(BIGNUM)* a, int p[], int max);
690-
int BN_GF2m_arr2poly(const int p[], BIGNUM* a);
691-
692-
}
688+
const int[] p, BN_CTX* ctx); /* r^2 + r = a mod p */
689+
int BN_GF2m_poly2arr(const(BIGNUM)* a, int[] p, int max);
690+
int BN_GF2m_arr2poly(const int[] p, BIGNUM* a);
693691

694692
/* faster mod functions for the 'NIST primes'
695693
* 0 <= a < p^2 */

deimos/openssl/camellia.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ void Camellia_ofb128_encrypt(const(ubyte)* in_, ubyte* out_,
120120
ubyte* ivec, int* num);
121121
void Camellia_ctr128_encrypt(const(ubyte)* in_, ubyte* out_,
122122
size_t length, const(CAMELLIA_KEY)* key,
123-
ubyte ivec[CAMELLIA_BLOCK_SIZE],
124-
ubyte ecount_buf[CAMELLIA_BLOCK_SIZE],
123+
ubyte[CAMELLIA_BLOCK_SIZE] ivec,
124+
ubyte[CAMELLIA_BLOCK_SIZE] ecount_buf,
125125
uint* num);

deimos/openssl/cast_.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ enum CAST_BLOCK = 8;
7878
enum CAST_KEY_LENGTH = 16;
7979

8080
struct cast_key_st {
81-
CAST_LONG data[32];
81+
CAST_LONG[32] data;
8282
int short_key; /* Use reduced rounds for short key */
8383
}
8484
alias cast_key_st CAST_KEY;

deimos/openssl/des.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct DES_ks
8383
DES_cblock cblock;
8484
/* make sure things are correct size on machines with
8585
* 8 byte longs */
86-
DES_LONG deslong[2];
86+
DES_LONG[2] deslong;
8787
}
8888
ks_[16] ks;
8989
}
@@ -205,7 +205,7 @@ void DES_ofb_encrypt(const(ubyte)* in_,ubyte* out_,int numbits,
205205
void DES_pcbc_encrypt(const(ubyte)* input,ubyte* output,
206206
c_long length,DES_key_schedule* schedule,DES_cblock* ivec,
207207
int enc);
208-
DES_LONG DES_quad_cksum(const(ubyte)* input,DES_cblock output[],
208+
DES_LONG DES_quad_cksum(const(ubyte)* input,DES_cblock[] output,
209209
c_long length,int out_count,DES_cblock* seed);
210210
int DES_random_key(DES_cblock* ret);
211211
void DES_set_odd_parity(DES_cblock* key);

deimos/openssl/dtls1.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ version(OPENSSL_NO_SCTP) {} else {
124124
struct dtls1_bitmap_st {
125125
c_ulong map; /* track 32 packets on 32-bit systems
126126
and 64 - on 64-bit systems */
127-
ubyte max_seq_num[8]; /* max record number seen so far,
127+
ubyte[8] max_seq_num; /* max record number seen so far,
128128
64-bit value in big-endian
129129
encoding */
130130
}
@@ -187,8 +187,8 @@ alias hm_fragment_st hm_fragment;
187187

188188
struct dtls1_state_st {
189189
uint send_cookie;
190-
ubyte cookie[DTLS1_COOKIE_LENGTH];
191-
ubyte rcvd_cookie[DTLS1_COOKIE_LENGTH];
190+
ubyte[DTLS1_COOKIE_LENGTH] cookie;
191+
ubyte[DTLS1_COOKIE_LENGTH] rcvd_cookie;
192192
uint cookie_len;
193193

194194
/*
@@ -212,7 +212,7 @@ struct dtls1_state_st {
212212
ushort handshake_read_seq;
213213

214214
/* save last sequence number for retransmissions */
215-
ubyte last_write_sequence[8];
215+
ubyte[8] last_write_sequence;
216216

217217
/* Received handshake records (processed and unprocessed) */
218218
record_pqueue unprocessed_rcds;
@@ -249,9 +249,9 @@ struct dtls1_state_st {
249249

250250
/* storage for Alert/Handshake protocol data received but not
251251
* yet processed by ssl3_read_bytes: */
252-
ubyte alert_fragment[DTLS1_AL_HEADER_LENGTH];
252+
ubyte[DTLS1_AL_HEADER_LENGTH] alert_fragment;
253253
uint alert_fragment_len;
254-
ubyte handshake_fragment[DTLS1_HM_HEADER_LENGTH];
254+
ubyte[DTLS1_HM_HEADER_LENGTH] handshake_fragment;
255255
uint handshake_fragment_len;
256256

257257
uint retransmitting;

deimos/openssl/ebcdic.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ alias _openssl_os_toebcdic os_toebcdic;
1010
alias _openssl_ebcdic2ascii ebcdic2ascii;
1111
alias _openssl_ascii2ebcdic ascii2ebcdic;
1212

13-
extern const ubyte _openssl_os_toascii[256];
14-
extern const ubyte _openssl_os_toebcdic[256];
13+
extern const ubyte[256] _openssl_os_toascii;
14+
extern const ubyte[256] _openssl_os_toebcdic;
1515
void* _openssl_ebcdic2ascii(void* dest, const(void)* srce, size_t count);
1616
void* _openssl_ascii2ebcdic(void* dest, const(void)* srce, size_t count);

deimos/openssl/ec.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ int EC_POINTs_make_affine(const(EC_GROUP)* group, size_t num, EC_POINT*[] points
637637
* \param ctx BN_CTX object (optional)
638638
* \return 1 on success and 0 if an error occured
639639
*/
640-
int EC_POINTs_mul(const(EC_GROUP)* group, EC_POINT* r, const(BIGNUM)* n, size_t num, const(EC_POINT)* p[], const(BIGNUM)* m[], BN_CTX* ctx);
640+
int EC_POINTs_mul(const(EC_GROUP)* group, EC_POINT* r, const(BIGNUM)* n, size_t num, const(EC_POINT)*[] p, const(BIGNUM)*[] m, BN_CTX* ctx);
641641

642642
/** Computes r = generator* n + q* m
643643
* \param group underlying EC_GROUP object

0 commit comments

Comments
 (0)