Update of /cvsroot/monetdb/sql/src/backends/monet4
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16684/src/backends/monet4
Modified Files:
sql_server.mx
Log Message:
Tyring to fix the code that triggers some of the 120
"conversion from <type1> to <type2>, possible loss of data"
warnings with the Microsoft compiler on Windows (cf.,
http://monetdb.cwi.nl/testing/projects/monetdb/Current/sql/.Mic.32.32.d.1-Windows5.1..2008.08.29_00-09-02/make.out.html
):
use the correct type: BATcount() (now) returns BUN, NOT int
(Check the effect tomorrow at
http://monetdb.cwi.nl/testing/projects/monetdb/Current/sql/.Mic.32.32.d.1-Windows5.1/make.out.html
and
http://monetdb.cwi.nl/testing/projects/monetdb/Current/sql/.Mic.64.64.d.1-Windows5.2/make.out.html
)
Most of the remaining warnings are due to the fact that
member "ival" of struct "symbdata" in src/server/sql_symbol.mx
is defined as "lng" but often used as / assigned to "int"
(without cast or overflow check).
I will try to find a proper solution for this together with
Niels and/or Sjoerd...
U sql_server.mx
Index: sql_server.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_server.mx,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- sql_server.mx 31 Aug 2008 15:53:13 -0000 1.203
+++ sql_server.mx 31 Aug 2008 21:56:25 -0000 1.204
@@ -1000,9 +1000,11 @@
char *s = strip_extra_zeros(val);
char *dot = strchr(s, '.');
int digits = _strlen(s) - 1;
- int scale = digits - (dot-s);
+ int scale = digits - (int)(dot-s);
lng value = 0;
+ assert((lng) GDK_int_min <= (lng) (dot-s) && (lng) (dot-s) <= (lng)
GDK_int_max);
+
if (!dot) {
if (GDK_STRNIL(val)) {
*res = @1_nil;
@@ -1549,7 +1551,7 @@
zero_or_one(ptr ret, BAT* b)
{
ptr p;
- int c = BATcount(b);
+ BUN c = BATcount(b);
int _s = ATOMsize(ATOMtype(b->ttype));
if (c == 0) {
@@ -1559,7 +1561,7 @@
p = BUNtail(bi,BUNfirst(b));
} else {
p = NULL;
- GDKerror("zero_or_one: cardinality violation (%d>1)", c);
+ GDKerror("zero_or_one: cardinality violation (" BUNFMT ">1)",
c);
return GDK_FAIL;
}
if (ATOMextern(b->ttype)) {
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins