Skip to content

Commit

Permalink
cancel subversion backfire. sorry
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Mar 7, 2011
1 parent fc634cc commit 1df4259
Show file tree
Hide file tree
Showing 63 changed files with 1,828 additions and 711 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
/ext/-test-/*/Makefile
/ext/-test-/*/extconf.h
/ext/-test-/*/mkmf.log
/ext/-test-/*/*/Makefile
/ext/-test-/*/*/extconf.h
/ext/-test-/*/*/mkmf.log

# /ext/bigdecimal/
/ext/bigdecimal/*.def
Expand Down Expand Up @@ -446,6 +449,11 @@
/ext/zlib/zlib.a
/ext/zlib/conftest.dSYM

# /ext/date/
/ext/date/Makefile
/ext/date/extconf.h
/ext/date/mkmf.log

# /lib/rexml/

# /spec/
Expand Down
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6573,6 +6573,7 @@ For the changes before 1.9.3, see doc/ChangeLog-1.9.3
For the changes before 1.8.0, see doc/ChangeLog-1.8.0

Local variables:
coding: us-ascii
add-log-time-format: (lambda ()
(let* ((time (current-time))
(system-time-locale "C")
Expand Down
6 changes: 1 addition & 5 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ with all sufficient information, see the ChangeLog file.
* String#unpack supports endian modifiers
* new method:
* String#prepend
* String#byteslice

* Time
* extended method:
Expand Down Expand Up @@ -153,8 +154,3 @@ with all sufficient information, see the ChangeLog file.
* Kernel#respond_to?

See above.

* REXML::Document#encoding, REXML::XMLDecl#encoding,
REXML::Output#encoding and REXML::Source#encoding

Return an Encoding object not encoding name as a String.
2 changes: 1 addition & 1 deletion bin/gem
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'

required_version = Gem::Requirement.new ">= 1.8.6"
required_version = Gem::Requirement.new ">= 1.8.7"

unless required_version.satisfied_by? Gem.ruby_version then
abort "Expected Ruby Version #{required_version}, is #{Gem.ruby_version}"
Expand Down
10 changes: 5 additions & 5 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,14 +988,14 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
* <i>obj</i>'s ancestors.
*
* class Klass
* def kMethod()
* def klass_method()
* end
* end
* k = Klass.new
* k.methods[0..9] #=> [:kMethod, :freeze, :nil?, :is_a?,
* # :class, :instance_variable_set,
* # :methods, :extend, :__send__, :instance_eval]
* k.methods.length #=> 42
* k.methods[0..9] #=> [:klass_method, :nil?, :===,
* # :==~, :!, :eql?
* # :hash, :<=>, :class, :singleton_class]
* k.methods.length #=> 57
*/

VALUE
Expand Down
1 change: 0 additions & 1 deletion eval_jump.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ void
rb_exec_end_proc(void)
{
struct end_proc_data *volatile link;
struct end_proc_data *tmp;
int status;
volatile int safe = rb_safe_level();

Expand Down
8 changes: 4 additions & 4 deletions ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2237,11 +2237,11 @@ static int gnAlloc=0; /* Memory allocation counter */
VP_EXPORT void *
VpMemAlloc(size_t mb)
{
void *p = xmalloc((unsigned int)mb);
if(!p) {
VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1);
void *p = xmalloc(mb);
if (!p) {
VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1);
}
memset(p,0,mb);
memset(p, 0, mb);
#ifdef BIGDECIMAL_DEBUG
gnAlloc++; /* Count allocation call */
#endif /* BIGDECIMAL_DEBUG */
Expand Down
2 changes: 1 addition & 1 deletion ext/openssl/ossl_cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
* keeping this behaviour for backward compatibility.
*/
const char *cname = rb_class2name(rb_obj_class(self));
rb_warn("argumtents for %s#encrypt and %s#decrypt were deprecated; "
rb_warn("arguments for %s#encrypt and %s#decrypt were deprecated; "
"use %s#pkcs5_keyivgen to derive key and IV",
cname, cname, cname);
StringValue(pass);
Expand Down
8 changes: 4 additions & 4 deletions ext/openssl/ossl_ns_spki.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include "ossl.h"

#define WrapSPKI(klass, obj, spki) do { \
if (!spki) { \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
obj = Data_Wrap_Struct(klass, 0, NETSCAPE_SPKI_free, spki); \
(obj) = Data_Wrap_Struct((klass), 0, NETSCAPE_SPKI_free, (spki)); \
} while (0)
#define GetSPKI(obj, spki) do { \
Data_Get_Struct(obj, NETSCAPE_SPKI, spki); \
if (!spki) { \
Data_Get_Struct((obj), NETSCAPE_SPKI, (spki)); \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
} while (0)
Expand Down
48 changes: 24 additions & 24 deletions ext/openssl/ossl_ocsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@
#if defined(OSSL_OCSP_ENABLED)

#define WrapOCSPReq(klass, obj, req) do { \
if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_REQUEST_free, req); \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
(obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \
} while (0)
#define GetOCSPReq(obj, req) do { \
Data_Get_Struct(obj, OCSP_REQUEST, req); \
if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
Data_Get_Struct((obj), OCSP_REQUEST, (req)); \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
} while (0)
#define SafeGetOCSPReq(obj, req) do { \
OSSL_Check_Kind(obj, cOCSPReq); \
GetOCSPReq(obj, req); \
OSSL_Check_Kind((obj), cOCSPReq); \
GetOCSPReq((obj), (req)); \
} while (0)

#define WrapOCSPRes(klass, obj, res) do { \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_RESPONSE_free, res); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
(obj) = Data_Wrap_Struct((klass), 0, OCSP_RESPONSE_free, (res)); \
} while (0)
#define GetOCSPRes(obj, res) do { \
Data_Get_Struct(obj, OCSP_RESPONSE, res); \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
Data_Get_Struct((obj), OCSP_RESPONSE, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
#define SafeGetOCSPRes(obj, res) do { \
OSSL_Check_Kind(obj, cOCSPRes); \
GetOCSPRes(obj, res); \
OSSL_Check_Kind((obj), cOCSPRes); \
GetOCSPRes((obj), (res)); \
} while (0)

#define WrapOCSPBasicRes(klass, obj, res) do { \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_BASICRESP_free, res); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
(obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \
} while (0)
#define GetOCSPBasicRes(obj, res) do { \
Data_Get_Struct(obj, OCSP_BASICRESP, res); \
if(!res) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
#define SafeGetOCSPBasicRes(obj, res) do { \
OSSL_Check_Kind(obj, cOCSPBasicRes); \
GetOCSPBasicRes(obj, res); \
OSSL_Check_Kind((obj), cOCSPBasicRes); \
GetOCSPBasicRes((obj), (res)); \
} while (0)

#define WrapOCSPCertId(klass, obj, cid) do { \
if(!cid) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
obj = Data_Wrap_Struct(klass, 0, OCSP_CERTID_free, cid); \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
(obj) = Data_Wrap_Struct((klass), 0, OCSP_CERTID_free, (cid)); \
} while (0)
#define GetOCSPCertId(obj, cid) do { \
Data_Get_Struct(obj, OCSP_CERTID, cid); \
if(!cid) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
Data_Get_Struct((obj), OCSP_CERTID, (cid)); \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0)
#define SafeGetOCSPCertId(obj, cid) do { \
OSSL_Check_Kind(obj, cOCSPCertId); \
GetOCSPCertId(obj, cid); \
OSSL_Check_Kind((obj), cOCSPCertId); \
GetOCSPCertId((obj), (cid)); \
} while (0)

VALUE mOCSP;
Expand Down
12 changes: 6 additions & 6 deletions ext/openssl/ossl_pkcs12.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
#include "ossl.h"

#define WrapPKCS12(klass, obj, p12) do { \
if(!p12) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
obj = Data_Wrap_Struct(klass, 0, PKCS12_free, p12); \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
(obj) = Data_Wrap_Struct((klass), 0, PKCS12_free, (p12)); \
} while (0)

#define GetPKCS12(obj, p12) do { \
Data_Get_Struct(obj, PKCS12, p12); \
if(!p12) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
Data_Get_Struct((obj), PKCS12, (p12)); \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
} while (0)

#define SafeGetPKCS12(obj, p12) do { \
OSSL_Check_Kind(obj, cPKCS12); \
GetPKCS12(obj, p12); \
OSSL_Check_Kind((obj), cPKCS12); \
GetPKCS12((obj), (p12)); \
} while (0)

#define ossl_pkcs12_set_key(o,v) rb_iv_set((o), "@key", (v))
Expand Down
38 changes: 19 additions & 19 deletions ext/openssl/ossl_pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,57 @@
#include "ossl.h"

#define WrapPKCS7(klass, obj, pkcs7) do { \
if (!pkcs7) { \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
obj = Data_Wrap_Struct(klass, 0, PKCS7_free, pkcs7); \
(obj) = Data_Wrap_Struct((klass), 0, PKCS7_free, (pkcs7)); \
} while (0)
#define GetPKCS7(obj, pkcs7) do { \
Data_Get_Struct(obj, PKCS7, pkcs7); \
if (!pkcs7) { \
Data_Get_Struct((obj), PKCS7, (pkcs7)); \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
} while (0)
#define SafeGetPKCS7(obj, pkcs7) do { \
OSSL_Check_Kind(obj, cPKCS7); \
GetPKCS7(obj, pkcs7); \
OSSL_Check_Kind((obj), cPKCS7); \
GetPKCS7((obj), (pkcs7)); \
} while (0)

#define WrapPKCS7si(klass, obj, p7si) do { \
if (!p7si) { \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
obj = Data_Wrap_Struct(klass, 0, PKCS7_SIGNER_INFO_free, p7si); \
(obj) = Data_Wrap_Struct((klass), 0, PKCS7_SIGNER_INFO_free, (p7si)); \
} while (0)
#define GetPKCS7si(obj, p7si) do { \
Data_Get_Struct(obj, PKCS7_SIGNER_INFO, p7si); \
if (!p7si) { \
Data_Get_Struct((obj), PKCS7_SIGNER_INFO, (p7si)); \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
} while (0)
#define SafeGetPKCS7si(obj, p7si) do { \
OSSL_Check_Kind(obj, cPKCS7Signer); \
GetPKCS7si(obj, p7si); \
OSSL_Check_Kind((obj), cPKCS7Signer); \
GetPKCS7si((obj), (p7si)); \
} while (0)

#define WrapPKCS7ri(klass, obj, p7ri) do { \
if (!p7ri) { \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
obj = Data_Wrap_Struct(klass, 0, PKCS7_RECIP_INFO_free, p7ri); \
(obj) = Data_Wrap_Struct((klass), 0, PKCS7_RECIP_INFO_free, (p7ri)); \
} while (0)
#define GetPKCS7ri(obj, p7ri) do { \
Data_Get_Struct(obj, PKCS7_RECIP_INFO, p7ri); \
if (!p7ri) { \
Data_Get_Struct((obj), PKCS7_RECIP_INFO, (p7ri)); \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
} while (0)
#define SafeGetPKCS7ri(obj, p7ri) do { \
OSSL_Check_Kind(obj, cPKCS7Recipient); \
GetPKCS7ri(obj, p7ri); \
OSSL_Check_Kind((obj), cPKCS7Recipient); \
GetPKCS7ri((obj), (p7ri)); \
} while (0)

#define numberof(ary) (int)(sizeof(ary)/sizeof(ary[0]))
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))

#define ossl_pkcs7_set_data(o,v) rb_iv_set((o), "@data", (v))
#define ossl_pkcs7_get_data(o) rb_iv_get((o), "@data")
Expand Down
16 changes: 8 additions & 8 deletions ext/openssl/ossl_pkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ extern ID id_private_q;
#define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue)

#define WrapPKey(klass, obj, pkey) do { \
if (!pkey) { \
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
} \
obj = Data_Wrap_Struct(klass, 0, EVP_PKEY_free, pkey); \
(obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \
OSSL_PKEY_SET_PUBLIC(obj); \
} while (0)
#define GetPKey(obj, pkey) do {\
Data_Get_Struct(obj, EVP_PKEY, pkey);\
if (!pkey) { \
Data_Get_Struct((obj), EVP_PKEY, (pkey));\
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
} \
} while (0)
#define SafeGetPKey(obj, pkey) do { \
OSSL_Check_Kind(obj, cPKey); \
GetPKey(obj, pkey); \
OSSL_Check_Kind((obj), cPKey); \
GetPKey((obj), (pkey)); \
} while (0)

void ossl_generate_cb(int, int, void *);
Expand Down Expand Up @@ -134,8 +134,8 @@ static VALUE ossl_##keytype##_set_##name(VALUE self, VALUE bignum) \

#define DEF_OSSL_PKEY_BN(class, keytype, name) \
do { \
rb_define_method(class, #name, ossl_##keytype##_get_##name, 0); \
rb_define_method(class, #name "=", ossl_##keytype##_set_##name, 1);\
rb_define_method((class), #name, ossl_##keytype##_get_##name, 0); \
rb_define_method((class), #name "=", ossl_##keytype##_set_##name, 1);\
} while (0)

#endif /* _OSSL_PKEY_H_ */
4 changes: 2 additions & 2 deletions ext/openssl/ossl_pkey_dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "ossl.h"

#define GetPKeyDH(obj, pkey) do { \
GetPKey(obj, pkey); \
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DH) { /* PARANOIA? */ \
GetPKey((obj), (pkey)); \
if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_DH) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A DH!") ; \
} \
} while (0)
Expand Down
4 changes: 2 additions & 2 deletions ext/openssl/ossl_pkey_dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "ossl.h"

#define GetPKeyDSA(obj, pkey) do { \
GetPKey(obj, pkey); \
if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DSA) { /* PARANOIA? */ \
GetPKey((obj), (pkey)); \
if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_DSA) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A DSA!"); \
} \
} while (0)
Expand Down
8 changes: 8 additions & 0 deletions golf_prelude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,11 @@ def #{meth}(*args, &block)
alias old_inspect inspect
alias inspect old_to_s
end

class Symbol
def call(*args, &block)
proc do |recv|
recv.__send__(self, *args, &block)
end
end
end
Loading

0 comments on commit 1df4259

Please sign in to comment.