File ruby-mysql-2.7.3_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.in
===================================================================
--- mysql.c.in.orig 2006-12-20 06:31:52.000000000 +0100
+++ mysql.c.in 2007-03-12 01:32:25.229145395 +0100
@@ -1360,6 +1360,7 @@ static VALUE stmt_execute(int argc, VALU
t.day = FIX2INT(RARRAY(a)->ptr[3]);
t.month = FIX2INT(RARRAY(a)->ptr[4]);
t.year = FIX2INT(RARRAY(a)->ptr[5]);
+ t.time_type = MYSQL_TYPE_DATETIME;
*(MYSQL_TIME*)&(s->param.buffer[i]) = t;
} else if (CLASS_OF(argv[i]) == cMysqlTime) {
MYSQL_TIME t;
@@ -1373,6 +1374,7 @@ static VALUE stmt_execute(int argc, VALU
t.day = NUM2INT(rb_iv_get(argv[i], "day"));
t.month = NUM2INT(rb_iv_get(argv[i], "month"));
t.year = NUM2INT(rb_iv_get(argv[i], "year"));
+ t.time_type = MYSQL_TYPE_DATETIME;
*(MYSQL_TIME*)&(s->param.buffer[i]) = t;
} else
rb_raise(rb_eTypeError, "unsupported type: %d", TYPE(argv[i]));
@@ -1708,26 +1710,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);
}