aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGOTOU Yuuzou <gotoyuzo@notwork.org>2001-12-21 19:17:56 +0000
committerGOTOU Yuuzou <gotoyuzo@notwork.org>2001-12-21 19:17:56 +0000
commit7834c618c13594d96826b6ef728d908cb77002f0 (patch)
treeb852462833799f636a9e501ad643a4ce9a87bfb3
parent28e4b12c6ab858dc0e973b623d15d50a5ab043ae (diff)
downloadruby-openssl-history-7834c618c13594d96826b6ef728d908cb77002f0.tar.gz
* fixed unusual usage of ## preprocessing sequence.
-rw-r--r--ossl_bn.c28
-rw-r--r--ossl_cipher.c6
-rw-r--r--ossl_config.c2
-rw-r--r--ossl_digest.c2
-rw-r--r--ossl_pkcs7.c2
5 files changed, 20 insertions, 20 deletions
diff --git a/ossl_bn.c b/ossl_bn.c
index fc51cdf..02aae14 100644
--- a/ossl_bn.c
+++ b/ossl_bn.c
@@ -177,13 +177,13 @@ ossl_bn_to_i(VALUE self)
#define BIGNUM_BOOL1(func) \
static VALUE \
- ossl_bn_##func##(VALUE self) \
+ ossl_bn_##func(VALUE self) \
{ \
ossl_bn *bnp = NULL; \
\
GetBN(self, bnp); \
\
- if (BN_##func##(bnp->bignum) == 1) \
+ if (BN_##func(bnp->bignum) == 1) \
return Qtrue; \
\
return Qfalse; \
@@ -194,7 +194,7 @@ BIGNUM_BOOL1(is_odd);
#define BIGNUM_1c(func) \
static VALUE \
- ossl_bn_##func##(VALUE self) \
+ ossl_bn_##func(VALUE self) \
{ \
ossl_bn *bnp = NULL; \
BIGNUM *result = NULL; \
@@ -207,7 +207,7 @@ BIGNUM_BOOL1(is_odd);
rb_raise(eBNError, "%s", ossl_error()); \
\
BN_CTX_init(&ctx); \
- if (BN_##func##(result, bnp->bignum, &ctx) != 1) \
+ if (BN_##func(result, bnp->bignum, &ctx) != 1) \
rb_raise(eBNError, "%s", ossl_error()); \
\
obj = ossl_bn_new(result); \
@@ -219,7 +219,7 @@ BIGNUM_1c(sqr);
#define BIGNUM_2(func) \
static VALUE \
- ossl_bn_##func##(VALUE self, VALUE other) \
+ ossl_bn_##func(VALUE self, VALUE other) \
{ \
ossl_bn *bn1p = NULL; \
ossl_bn *bn2p = NULL; \
@@ -234,7 +234,7 @@ BIGNUM_1c(sqr);
if (!(result = BN_new())) \
rb_raise(eBNError, "%s", ossl_error()); \
\
- if (BN_##func##(result, bn1p->bignum, bn2p->bignum) != 1) \
+ if (BN_##func(result, bn1p->bignum, bn2p->bignum) != 1) \
rb_raise(eBNError, "%s", ossl_error()); \
\
obj = ossl_bn_new(result); \
@@ -247,7 +247,7 @@ BIGNUM_2(sub);
#define BIGNUM_2c(func) \
static VALUE \
- ossl_bn_##func##(VALUE self, VALUE other) \
+ ossl_bn_##func(VALUE self, VALUE other) \
{ \
ossl_bn *bn1p = NULL, *bn2p = NULL; \
BIGNUM *result = NULL; \
@@ -263,7 +263,7 @@ BIGNUM_2(sub);
rb_raise(eBNError, "%s", ossl_error()); \
\
BN_CTX_init(&ctx); \
- if (BN_##func##(result, bn1p->bignum, bn2p->bignum, &ctx) != 1) \
+ if (BN_##func(result, bn1p->bignum, bn2p->bignum, &ctx) != 1) \
rb_raise(eBNError, "%s", ossl_error()); \
\
obj = ossl_bn_new(result); \
@@ -332,7 +332,7 @@ ossl_bn_mod_inverse(VALUE self, VALUE other)
#define BIGNUM_3c(func) \
static VALUE \
- ossl_bn_##func##(VALUE self, VALUE other1, VALUE other2) \
+ ossl_bn_##func(VALUE self, VALUE other1, VALUE other2) \
{ \
ossl_bn *bn1p = NULL, *bn2p = NULL, *bn3p = NULL; \
BIGNUM *result = NULL; \
@@ -350,7 +350,7 @@ ossl_bn_mod_inverse(VALUE self, VALUE other)
rb_raise(eBNError, "%s", ossl_error()); \
\
BN_CTX_init(&ctx); \
- if (BN_##func##(result, bn1p->bignum, bn2p->bignum, bn3p->bignum, &ctx) != 1) \
+ if (BN_##func(result, bn1p->bignum, bn2p->bignum, bn3p->bignum, &ctx) != 1) \
rb_raise(eBNError, "%s", ossl_error()); \
\
obj = ossl_bn_new(result); \
@@ -363,13 +363,13 @@ BIGNUM_3c(mod_exp);
#define BIGNUM_BIT_SETCLEAR(func) \
static VALUE \
- ossl_bn_##func##(VALUE self, VALUE bit) \
+ ossl_bn_##func(VALUE self, VALUE bit) \
{ \
ossl_bn *bnp = NULL; \
\
GetBN(self, bnp); \
\
- if (BN_##func##(bnp->bignum, NUM2INT(bit)) != 1) \
+ if (BN_##func(bnp->bignum, NUM2INT(bit)) != 1) \
rb_raise(eBNError, "%s", ossl_error()); \
\
return self; \
@@ -405,7 +405,7 @@ ossl_bn_mask_bits(VALUE self, VALUE bit)
#define BIGNUM_SHIFT(func) \
static VALUE \
- ossl_bn_##func##(VALUE self, VALUE bits) \
+ ossl_bn_##func(VALUE self, VALUE bits) \
{ \
ossl_bn *bnp = NULL; \
BIGNUM *result = NULL; \
@@ -416,7 +416,7 @@ ossl_bn_mask_bits(VALUE self, VALUE bit)
if (!(result = BN_new())) \
rb_raise(eBNError, "%s", ossl_error()); \
\
- if (BN_##func##(result, bnp->bignum, NUM2INT(bits)) != 1) \
+ if (BN_##func(result, bnp->bignum, NUM2INT(bits)) != 1) \
rb_raise(eBNError, "%s", ossl_error()); \
\
obj = ossl_bn_new(result); \
diff --git a/ossl_cipher.c b/ossl_cipher.c
index fa1b899..882149c 100644
--- a/ossl_cipher.c
+++ b/ossl_cipher.c
@@ -540,7 +540,7 @@ Init_ossl_cipher(VALUE module)
/*
* Constants
*/
-#define DefCipherConst(x) rb_define_const(module, #x, INT2FIX(##x))
+#define DefCipherConst(x) rb_define_const(module, #x, INT2FIX(x))
DefCipherConst(ECB);
DefCipherConst(EDE);
@@ -555,8 +555,8 @@ Init_ossl_cipher(VALUE module)
* automation for classes creation and initialize method binding
*/
#define DefCipher(name, func) \
- c##name## = rb_define_class_under(module, #name, cCipher); \
- rb_define_method(c##name##, "initialize", ossl_##func##_initialize, -1)
+ c##name = rb_define_class_under(module, #name, cCipher); \
+ rb_define_method(c##name, "initialize", ossl_##func##_initialize, -1)
/*
* create classes and bind initialize method
diff --git a/ossl_config.c b/ossl_config.c
index 3ae9545..6713a93 100644
--- a/ossl_config.c
+++ b/ossl_config.c
@@ -76,7 +76,7 @@ static VALUE
ossl_config_initialize(int argc, VALUE* argv, VALUE self)
{
ossl_config *configp = NULL;
- int err_line = 0;
+ long err_line = 0;
VALUE path;
GetConfig(self, configp);
diff --git a/ossl_digest.c b/ossl_digest.c
index 948a6db..05d8a18 100644
--- a/ossl_digest.c
+++ b/ossl_digest.c
@@ -203,7 +203,7 @@ ossl_digest_hexdigest(VALUE self)
if (!(digestp->md = OPENSSL_malloc(sizeof(EVP_MD_CTX)))) { \
rb_raise(eDigestError, "Cannot allocate memory for new digest"); \
} \
- EVP_DigestInit(digestp->md, EVP_##dgst##()); \
+ EVP_DigestInit(digestp->md, EVP_##dgst()); \
\
if (rb_scan_args(argc, argv, "01", &data) == 1) { \
Check_Type(data, T_STRING); \
diff --git a/ossl_pkcs7.c b/ossl_pkcs7.c
index fe12a93..5ce9d47 100644
--- a/ossl_pkcs7.c
+++ b/ossl_pkcs7.c
@@ -28,7 +28,7 @@
if (!p7sip->signer) rb_raise(ePKCS7Error, "not initialized!");\
}
-#define DefPKCS7Const(x) rb_define_const(mPKCS7, #x, INT2FIX(##x))
+#define DefPKCS7Const(x) rb_define_const(mPKCS7, #x, INT2FIX(x))
/*
* Constants