diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-23 17:34:55 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-23 17:34:55 +0000 |
commit | c34db589139980914f0b05d27b2499ac5bec615a (patch) | |
tree | 35dca0b96c3e330eb7ef06c83ed2f7703c4e6d37 /ext/date/date_core.c | |
parent | 5c0a69a6211c76d0e34be9adb24e89ee539f4cba (diff) | |
download | ruby-c34db589139980914f0b05d27b2499ac5bec615a.tar.gz |
* ext/date/date_core.c (leap_p): surpress warning: parentheses.
* ext/date/date_core.c (date_s__parse_internal): remove unused
variable "str".
* ext/date/date_parse.c (parse_ddd_cb): use RSTRING_LENINT.
* ext/date/date_strftime.c (date_strftime_with_tmx): remove unused
variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r-- | ext/date/date_core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 52a1b38eae..9a240a0106 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -440,7 +440,7 @@ static const int monthtab[2][13] = { inline static int leap_p(int y) { - return MOD(y, 4) == 0 && y % 100 != 0 || MOD(y, 400) == 0; + return (MOD(y, 4) == 0 && y % 100 != 0) || (MOD(y, 400) == 0); } static int @@ -1434,14 +1434,12 @@ static VALUE date_s__parse_internal(int argc, VALUE *argv, VALUE klass) { VALUE vstr, vcomp, hash; - const char *str; rb_scan_args(argc, argv, "11", &vstr, &vcomp); StringValue(vstr); if (!rb_enc_str_asciicompat_p(vstr)) rb_raise(rb_eArgError, "string should have ASCII compatible encoding"); - str = RSTRING_PTR(vstr); if (argc < 2) vcomp = Qtrue; |