File ruby-mysql-2.8.1_gcc4.patch of Package ruby-mysql
mysql.c: In function 'time_inspect':
mysql.c:1719: warning: format '%04d' expects type 'int', but argument 5 has type 'long int'
mysql.c:1719: warning: format '%02d' expects type 'int', but argument 6 has type 'long int'
mysql.c:1719: warning: format '%02d' expects type 'int', but argument 7 has type 'long int'
mysql.c:1719: warning: format '%02d' expects type 'int', but argument 8 has type 'long int'
mysql.c:1719: warning: format '%02d' expects type 'int', but argument 9 has type 'long int'
mysql.c:1719: warning: format '%02d' expects type 'int', but argument 10 has type 'long int'
mysql.c: In function 'time_to_s':
mysql.c:1732: warning: format '%04d' expects type 'int', but argument 5 has type 'long int'
mysql.c:1732: warning: format '%02d' expects type 'int', but argument 6 has type 'long int'
mysql.c:1732: warning: format '%02d' expects type 'int', but argument 7 has type 'long int'
mysql.c:1732: warning: format '%02d' expects type 'int', but argument 8 has type 'long int'
mysql.c:1732: warning: format '%02d' expects type 'int', but argument 9 has type 'long int'
mysql.c:1732: warning: format '%02d' expects type 'int', but argument 10 has type 'long int'
Index: mysql.c
===================================================================
--- mysql.c.orig 2009-02-01 09:43:39.000000000 +0100
+++ mysql.c 2009-03-31 18:19:55.153314000 +0200
@@ -1788,26 +1788,26 @@ static VALUE time_initialize(int argc, V
static VALUE time_inspect(VALUE obj)
{
char buf[36];
- sprintf(buf, "#<Mysql::Time:%04d-%02d-%02d %02d:%02d:%02d>",
- NUM2INT(rb_iv_get(obj, "year")),
- NUM2INT(rb_iv_get(obj, "month")),
- NUM2INT(rb_iv_get(obj, "day")),
- NUM2INT(rb_iv_get(obj, "hour")),
- NUM2INT(rb_iv_get(obj, "minute")),
- NUM2INT(rb_iv_get(obj, "second")));
+ sprintf(buf, "#<Mysql::Time:%04ld-%02ld-%02ld %02ld:%02ld:%02ld>",
+ NUM2LONG(rb_iv_get(obj, "year")),
+ NUM2LONG(rb_iv_get(obj, "month")),
+ NUM2LONG(rb_iv_get(obj, "day")),
+ NUM2LONG(rb_iv_get(obj, "hour")),
+ NUM2LONG(rb_iv_get(obj, "minute")),
+ NUM2LONG(rb_iv_get(obj, "second")));
return rb_str_new2(buf);
}
static VALUE time_to_s(VALUE obj)
{
char buf[20];
- sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d",
- NUM2INT(rb_iv_get(obj, "year")),
- NUM2INT(rb_iv_get(obj, "month")),
- NUM2INT(rb_iv_get(obj, "day")),
- NUM2INT(rb_iv_get(obj, "hour")),
- NUM2INT(rb_iv_get(obj, "minute")),
- NUM2INT(rb_iv_get(obj, "second")));
+ sprintf(buf, "%04ld-%02ld-%02ld %02ld:%02ld:%02ld",
+ NUM2LONG(rb_iv_get(obj, "year")),
+ NUM2LONG(rb_iv_get(obj, "month")),
+ NUM2LONG(rb_iv_get(obj, "day")),
+ NUM2LONG(rb_iv_get(obj, "hour")),
+ NUM2LONG(rb_iv_get(obj, "minute")),
+ NUM2LONG(rb_iv_get(obj, "second")));
return rb_str_new2(buf);
}