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

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-02-20 10:59:48 +00:00
parent c4cc4d31e6
commit 408a903c99
2 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,7 @@
Sun Feb 20 19:59:32 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl_cipher.c: parenthesize macro arguments.
Sun Feb 20 16:26:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread.c (exec_recursive): prevent temporary objects from GC.

View file

@ -11,23 +11,23 @@
#include "ossl.h"
#define WrapCipher(obj, klass, ctx) \
obj = Data_Wrap_Struct(klass, 0, ossl_cipher_free, ctx)
(obj) = Data_Wrap_Struct((klass), 0, ossl_cipher_free, (ctx))
#define MakeCipher(obj, klass, ctx) \
obj = Data_Make_Struct(klass, EVP_CIPHER_CTX, 0, ossl_cipher_free, ctx)
(obj) = Data_Make_Struct((klass), EVP_CIPHER_CTX, 0, ossl_cipher_free, (ctx))
#define AllocCipher(obj, ctx) \
memset(DATA_PTR(obj) = (ctx) = ALLOC(EVP_CIPHER_CTX), 0, sizeof(EVP_CIPHER_CTX))
#define GetCipherInit(obj, ctx) do { \
Data_Get_Struct(obj, EVP_CIPHER_CTX, ctx); \
Data_Get_Struct((obj), EVP_CIPHER_CTX, (ctx)); \
} while (0)
#define GetCipher(obj, ctx) do { \
GetCipherInit(obj, ctx); \
if (!ctx) { \
GetCipherInit((obj), (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "Cipher not inititalized!"); \
} \
} while (0)
#define SafeGetCipher(obj, ctx) do { \
OSSL_Check_Kind(obj, cCipher); \
GetCipher(obj, ctx); \
OSSL_Check_Kind((obj), cCipher); \
GetCipher((obj), (ctx)); \
} while (0)
/*