1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/ossl_pkey_ec.c: parenthesize macro arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-03-06 13:21:31 +00:00
parent 97f07f0968
commit dd9f5e8714
2 changed files with 26 additions and 22 deletions

View file

@ -1,3 +1,7 @@
Sun Mar 6 22:20:59 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl_pkey_ec.c: parenthesize macro arguments.
Sun Mar 6 21:49:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* sample/list.rb (MyElem#initialize): initialize @head

View file

@ -22,70 +22,70 @@ typedef struct {
#define GetPKeyEC(obj, pkey) do { \
GetPKey(obj, pkey); \
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_EC) { \
GetPKey((obj), (pkey)); \
if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_EC) { \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A EC PKEY!"); \
} \
} while (0)
#define SafeGet_ec_group(obj, group) do { \
OSSL_Check_Kind(obj, cEC_GROUP); \
Data_Get_Struct(obj, ossl_ec_group, group); \
OSSL_Check_Kind((obj), cEC_GROUP); \
Data_Get_Struct((obj), ossl_ec_group, (group)); \
} while(0)
#define Get_EC_KEY(obj, key) do { \
EVP_PKEY *pkey; \
GetPKeyEC(obj, pkey); \
key = pkey->pkey.ec; \
GetPKeyEC((obj), pkey); \
(key) = pkey->pkey.ec; \
} while(0)
#define Require_EC_KEY(obj, key) do { \
Get_EC_KEY(obj, key); \
if (key == NULL) \
Get_EC_KEY((obj), (key)); \
if ((key) == NULL) \
rb_raise(eECError, "EC_KEY is not initialized"); \
} while(0)
#define SafeRequire_EC_KEY(obj, key) do { \
OSSL_Check_Kind(obj, cEC); \
Require_EC_KEY(obj, key); \
OSSL_Check_Kind((obj), cEC); \
Require_EC_KEY((obj), (key)); \
} while (0)
#define Get_EC_GROUP(obj, g) do { \
ossl_ec_group *ec_group; \
Data_Get_Struct(obj, ossl_ec_group, ec_group); \
Data_Get_Struct((obj), ossl_ec_group, ec_group); \
if (ec_group == NULL) \
rb_raise(eEC_GROUP, "missing ossl_ec_group structure"); \
g = ec_group->group; \
(g) = ec_group->group; \
} while(0)
#define Require_EC_GROUP(obj, group) do { \
Get_EC_GROUP(obj, group); \
if (group == NULL) \
Get_EC_GROUP((obj), (group)); \
if ((group) == NULL) \
rb_raise(eEC_GROUP, "EC_GROUP is not initialized"); \
} while(0)
#define SafeRequire_EC_GROUP(obj, group) do { \
OSSL_Check_Kind(obj, cEC_GROUP); \
Require_EC_GROUP(obj, group); \
OSSL_Check_Kind((obj), cEC_GROUP); \
Require_EC_GROUP((obj), (group)); \
} while(0)
#define Get_EC_POINT(obj, p) do { \
ossl_ec_point *ec_point; \
Data_Get_Struct(obj, ossl_ec_point, ec_point); \
Data_Get_Struct((obj), ossl_ec_point, ec_point); \
if (ec_point == NULL) \
rb_raise(eEC_POINT, "missing ossl_ec_point structure"); \
p = ec_point->point; \
(p) = ec_point->point; \
} while(0)
#define Require_EC_POINT(obj, point) do { \
Get_EC_POINT(obj, point); \
if (point == NULL) \
Get_EC_POINT((obj), (point)); \
if ((point) == NULL) \
rb_raise(eEC_POINT, "EC_POINT is not initialized"); \
} while(0)
#define SafeRequire_EC_POINT(obj, point) do { \
OSSL_Check_Kind(obj, cEC_POINT); \
Require_EC_POINT(obj, point); \
OSSL_Check_Kind((obj), cEC_POINT); \
Require_EC_POINT((obj), (point)); \
} while(0)
VALUE cEC;