summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-12 13:44:37 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-12 13:44:37 +0000
commit241216295911bd7cf2008efd534e583678fa9569 (patch)
tree964e72da1d2a46394de0adb309f2fe22f55bbf06 /ext
parent61c216748c5742ca837c7b50cafb4f2c50b607b1 (diff)
* ext/openssl: suppress warnings.
* ext/openssl/ossl.h (OSSL_Debug): don't use gcc extention for variadic macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/openssl/extconf.rb2
-rw-r--r--ext/openssl/ossl.h4
-rw-r--r--ext/openssl/ossl_bn.c62
-rw-r--r--ext/openssl/ossl_config.c6
-rw-r--r--ext/openssl/ossl_pkey_dh.c8
-rw-r--r--ext/openssl/ossl_pkey_dsa.c10
-rw-r--r--ext/openssl/ossl_pkey_rsa.c16
7 files changed, 54 insertions, 54 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 457a17de0f..6b83489642 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -99,7 +99,7 @@ have_func("OPENSSL_cleanse")
unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TLSEXT_HOST_NAME")
end
-if try_compile("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
+if try_compile("#define FOO(...) foo(__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
$defs.push("-DHAVE_VA_ARGS_MACRO")
end
if have_header("openssl/engine.h")
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 9734249db1..e40c93b608 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -163,10 +163,10 @@ VALUE ossl_to_der_if_possible(VALUE);
extern VALUE dOSSL;
#if defined(HAVE_VA_ARGS_MACRO)
-#define OSSL_Debug(fmt, ...) do { \
+#define OSSL_Debug(...) do { \
if (dOSSL == Qtrue) { \
fprintf(stderr, "OSSL_DEBUG: "); \
- fprintf(stderr, fmt, ##__VA_ARGS__); \
+ fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, " [%s:%d]\n", __FILE__, __LINE__); \
} \
} while (0)
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index 794c97774f..6db9670bb7 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -272,9 +272,9 @@ ossl_bn_coerce(VALUE self, VALUE other)
} \
return Qfalse; \
}
-BIGNUM_BOOL1(is_zero);
-BIGNUM_BOOL1(is_one);
-BIGNUM_BOOL1(is_odd);
+BIGNUM_BOOL1(is_zero)
+BIGNUM_BOOL1(is_one)
+BIGNUM_BOOL1(is_odd)
#define BIGNUM_1c(func) \
/* \
@@ -298,7 +298,7 @@ BIGNUM_BOOL1(is_odd);
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_1c(sqr);
+BIGNUM_1c(sqr)
#define BIGNUM_2(func) \
/* \
@@ -322,8 +322,8 @@ BIGNUM_1c(sqr);
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_2(add);
-BIGNUM_2(sub);
+BIGNUM_2(add)
+BIGNUM_2(sub)
#define BIGNUM_2c(func) \
/* \
@@ -347,12 +347,12 @@ BIGNUM_2(sub);
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_2c(mul);
-BIGNUM_2c(mod);
-BIGNUM_2c(exp);
-BIGNUM_2c(gcd);
-BIGNUM_2c(mod_sqr);
-BIGNUM_2c(mod_inverse);
+BIGNUM_2c(mul)
+BIGNUM_2c(mod)
+BIGNUM_2c(exp)
+BIGNUM_2c(gcd)
+BIGNUM_2c(mod_sqr)
+BIGNUM_2c(mod_inverse)
/*
* call-seq:
@@ -407,10 +407,10 @@ ossl_bn_div(VALUE self, VALUE other)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_3c(mod_add);
-BIGNUM_3c(mod_sub);
-BIGNUM_3c(mod_mul);
-BIGNUM_3c(mod_exp);
+BIGNUM_3c(mod_add)
+BIGNUM_3c(mod_sub)
+BIGNUM_3c(mod_mul)
+BIGNUM_3c(mod_exp)
#define BIGNUM_BIT(func) \
/* \
@@ -428,9 +428,9 @@ BIGNUM_3c(mod_exp);
} \
return self; \
}
-BIGNUM_BIT(set_bit);
-BIGNUM_BIT(clear_bit);
-BIGNUM_BIT(mask_bits);
+BIGNUM_BIT(set_bit)
+BIGNUM_BIT(clear_bit)
+BIGNUM_BIT(mask_bits)
/*
* call-seq:
@@ -474,8 +474,8 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-BIGNUM_SHIFT(lshift);
-BIGNUM_SHIFT(rshift);
+BIGNUM_SHIFT(lshift)
+BIGNUM_SHIFT(rshift)
#define BIGNUM_SELF_SHIFT(func) \
/* \
@@ -494,8 +494,8 @@ BIGNUM_SHIFT(rshift);
ossl_raise(eBNError, NULL); \
return self; \
}
-BIGNUM_SELF_SHIFT(lshift);
-BIGNUM_SELF_SHIFT(rshift);
+BIGNUM_SELF_SHIFT(lshift)
+BIGNUM_SELF_SHIFT(rshift)
#define BIGNUM_RAND(func) \
/* \
@@ -528,8 +528,8 @@ BIGNUM_SELF_SHIFT(rshift);
WrapBN(klass, obj, result); \
return obj; \
}
-BIGNUM_RAND(rand);
-BIGNUM_RAND(pseudo_rand);
+BIGNUM_RAND(rand)
+BIGNUM_RAND(pseudo_rand)
#define BIGNUM_RAND_RANGE(func) \
/* \
@@ -552,8 +552,8 @@ BIGNUM_RAND(pseudo_rand);
WrapBN(klass, obj, result); \
return obj; \
}
-BIGNUM_RAND_RANGE(rand);
-BIGNUM_RAND_RANGE(pseudo_rand);
+BIGNUM_RAND_RANGE(rand)
+BIGNUM_RAND_RANGE(pseudo_rand)
/*
* call-seq:
@@ -608,8 +608,8 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
GetBN(self, bn); \
return INT2FIX(BN_##func(bn)); \
}
-BIGNUM_NUM(num_bytes);
-BIGNUM_NUM(num_bits);
+BIGNUM_NUM(num_bytes)
+BIGNUM_NUM(num_bits)
static VALUE
ossl_bn_copy(VALUE self, VALUE other)
@@ -642,8 +642,8 @@ ossl_bn_copy(VALUE self, VALUE other)
GetBN(self, bn1); \
return INT2FIX(BN_##func(bn1, bn2)); \
}
-BIGNUM_CMP(cmp);
-BIGNUM_CMP(ucmp);
+BIGNUM_CMP(cmp)
+BIGNUM_CMP(ucmp)
static VALUE
ossl_bn_eql(VALUE self, VALUE other)
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index cfc650d69a..e0c714977d 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -300,7 +300,7 @@ get_conf_section(CONF_VALUE *cv, VALUE ary)
rb_ary_push(ary, rb_str_new2(cv->section));
}
-static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE);
+static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE)
static VALUE
ossl_config_get_sections(VALUE self)
@@ -338,7 +338,7 @@ dump_conf_value(CONF_VALUE *cv, VALUE str)
rb_str_cat2(str, "\n");
}
-static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE);
+static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE)
static VALUE
dump_conf(CONF *conf)
@@ -382,7 +382,7 @@ each_conf_value(CONF_VALUE *cv, void* dummy)
}
}
-static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*);
+static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*)
static VALUE
ossl_config_each(VALUE self)
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 4e58a95bf0..768cda86b7 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -415,10 +415,10 @@ ossl_dh_compute_key(VALUE self, VALUE pub)
return str;
}
-OSSL_PKEY_BN(dh, p);
-OSSL_PKEY_BN(dh, g);
-OSSL_PKEY_BN(dh, pub_key);
-OSSL_PKEY_BN(dh, priv_key);
+OSSL_PKEY_BN(dh, p)
+OSSL_PKEY_BN(dh, g)
+OSSL_PKEY_BN(dh, pub_key)
+OSSL_PKEY_BN(dh, priv_key)
/*
* -----BEGIN DH PARAMETERS-----
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index ebde0bbfbd..d39933b754 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -433,11 +433,11 @@ ossl_dsa_verify(VALUE self, VALUE digest, VALUE sig)
return Qfalse;
}
-OSSL_PKEY_BN(dsa, p);
-OSSL_PKEY_BN(dsa, q);
-OSSL_PKEY_BN(dsa, g);
-OSSL_PKEY_BN(dsa, pub_key);
-OSSL_PKEY_BN(dsa, priv_key);
+OSSL_PKEY_BN(dsa, p)
+OSSL_PKEY_BN(dsa, q)
+OSSL_PKEY_BN(dsa, g)
+OSSL_PKEY_BN(dsa, pub_key)
+OSSL_PKEY_BN(dsa, priv_key)
/*
* INIT
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 52f5555f97..80665cddbd 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -519,14 +519,14 @@ ossl_rsa_blinding_off(VALUE self)
}
*/
-OSSL_PKEY_BN(rsa, n);
-OSSL_PKEY_BN(rsa, e);
-OSSL_PKEY_BN(rsa, d);
-OSSL_PKEY_BN(rsa, p);
-OSSL_PKEY_BN(rsa, q);
-OSSL_PKEY_BN(rsa, dmp1);
-OSSL_PKEY_BN(rsa, dmq1);
-OSSL_PKEY_BN(rsa, iqmp);
+OSSL_PKEY_BN(rsa, n)
+OSSL_PKEY_BN(rsa, e)
+OSSL_PKEY_BN(rsa, d)
+OSSL_PKEY_BN(rsa, p)
+OSSL_PKEY_BN(rsa, q)
+OSSL_PKEY_BN(rsa, dmp1)
+OSSL_PKEY_BN(rsa, dmq1)
+OSSL_PKEY_BN(rsa, iqmp)
/*
* INIT