From 408a903c99f602ae2cd14f8074fa54736ea88b45 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 20 Feb 2011 10:59:48 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ ext/openssl/ossl_cipher.c | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05051696ad..c2655d79f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Feb 20 19:59:32 2011 Tanaka Akira + + * ext/openssl/ossl_cipher.c: parenthesize macro arguments. + Sun Feb 20 16:26:45 2011 Nobuyoshi Nakada * thread.c (exec_recursive): prevent temporary objects from GC. diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c index c164b8b0a3..84b51a0101 100644 --- a/ext/openssl/ossl_cipher.c +++ b/ext/openssl/ossl_cipher.c @@ -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) /*