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:
parent
c4cc4d31e6
commit
408a903c99
2 changed files with 11 additions and 7 deletions
|
@ -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>
|
Sun Feb 20 16:26:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* thread.c (exec_recursive): prevent temporary objects from GC.
|
* thread.c (exec_recursive): prevent temporary objects from GC.
|
||||||
|
|
|
@ -11,23 +11,23 @@
|
||||||
#include "ossl.h"
|
#include "ossl.h"
|
||||||
|
|
||||||
#define WrapCipher(obj, klass, ctx) \
|
#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) \
|
#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) \
|
#define AllocCipher(obj, ctx) \
|
||||||
memset(DATA_PTR(obj) = (ctx) = ALLOC(EVP_CIPHER_CTX), 0, sizeof(EVP_CIPHER_CTX))
|
memset(DATA_PTR(obj) = (ctx) = ALLOC(EVP_CIPHER_CTX), 0, sizeof(EVP_CIPHER_CTX))
|
||||||
#define GetCipherInit(obj, ctx) do { \
|
#define GetCipherInit(obj, ctx) do { \
|
||||||
Data_Get_Struct(obj, EVP_CIPHER_CTX, ctx); \
|
Data_Get_Struct((obj), EVP_CIPHER_CTX, (ctx)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define GetCipher(obj, ctx) do { \
|
#define GetCipher(obj, ctx) do { \
|
||||||
GetCipherInit(obj, ctx); \
|
GetCipherInit((obj), (ctx)); \
|
||||||
if (!ctx) { \
|
if (!(ctx)) { \
|
||||||
ossl_raise(rb_eRuntimeError, "Cipher not inititalized!"); \
|
ossl_raise(rb_eRuntimeError, "Cipher not inititalized!"); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define SafeGetCipher(obj, ctx) do { \
|
#define SafeGetCipher(obj, ctx) do { \
|
||||||
OSSL_Check_Kind(obj, cCipher); \
|
OSSL_Check_Kind((obj), cCipher); \
|
||||||
GetCipher(obj, ctx); \
|
GetCipher((obj), (ctx)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue