Changeset: 052b88fe849d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=052b88fe849d
Modified Files:
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/MAL-signatures_none.stable.out
clients/Tests/exports.stable.out
monetdb5/modules/kernel/mmath.c
monetdb5/modules/kernel/mmath.h
monetdb5/modules/kernel/mmath.mal
Branch: Oct2014
Log Message:
mmath.rand with arg needs to ignore the arg, not use it as seed.
diffs (100 lines):
diff --git a/clients/Tests/MAL-signatures_all.stable.out
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -40272,7 +40272,7 @@ comment The pow(x,y) function returns t
command mmath.pow(x:flt,y:flt):flt
address MATHbinary_POWflt;
command mmath.rand{unsafe}(v:int):int
-address MATHrandintseed;
+address MATHrandintarg;
comment return a random number
command mmath.rand{unsafe}():int
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -40189,7 +40189,7 @@ comment The pow(x,y) function returns t
command mmath.pow(x:flt,y:flt):flt
address MATHbinary_POWflt;
command mmath.rand{unsafe}(v:int):int
-address MATHrandintseed;
+address MATHrandintarg;
comment return a random number
command mmath.rand{unsafe}():int
diff --git a/clients/Tests/MAL-signatures_geom.stable.out
b/clients/Tests/MAL-signatures_geom.stable.out
--- a/clients/Tests/MAL-signatures_geom.stable.out
+++ b/clients/Tests/MAL-signatures_geom.stable.out
@@ -40165,7 +40165,7 @@ comment The pow(x,y) function returns t
command mmath.pow(x:flt,y:flt):flt
address MATHbinary_POWflt;
command mmath.rand{unsafe}(v:int):int
-address MATHrandintseed;
+address MATHrandintarg;
comment return a random number
command mmath.rand{unsafe}():int
diff --git a/clients/Tests/MAL-signatures_none.stable.out
b/clients/Tests/MAL-signatures_none.stable.out
--- a/clients/Tests/MAL-signatures_none.stable.out
+++ b/clients/Tests/MAL-signatures_none.stable.out
@@ -39978,7 +39978,7 @@ comment The pow(x,y) function returns t
command mmath.pow(x:flt,y:flt):flt
address MATHbinary_POWflt;
command mmath.rand{unsafe}(v:int):int
-address MATHrandintseed;
+address MATHrandintarg;
comment return a random number
command mmath.rand{unsafe}():int
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1483,7 +1483,7 @@ str MATHbinary_ROUNDdbl(dbl *res, const
str MATHbinary_ROUNDflt(flt *res, const flt *a, const int *b);
str MATHpi(dbl *pi);
str MATHrandint(int *res);
-str MATHrandintseed(int *res, const int *seed);
+str MATHrandintarg(int *res, const int *dummy);
str MATHsqlrandint(int *res, const int *seed);
str MATHsrandint(void *ret, const int *seed);
str MATHunary_ACOSdbl(dbl *res, const dbl *a);
diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c
--- a/monetdb5/modules/kernel/mmath.c
+++ b/monetdb5/modules/kernel/mmath.c
@@ -291,10 +291,10 @@ MATHrandint(int *res)
}
str
-MATHrandintseed(int *res, const int *seed)
+MATHrandintarg(int *res, const int *dummy)
{
+ (void) dummy;
/* coverity[dont_call] */
- srand(*seed);
*res = rand();
return MAL_SUCCEED;
}
diff --git a/monetdb5/modules/kernel/mmath.h b/monetdb5/modules/kernel/mmath.h
--- a/monetdb5/modules/kernel/mmath.h
+++ b/monetdb5/modules/kernel/mmath.h
@@ -88,7 +88,7 @@ mmath_export str MATHunary_ISNAN(bit *re
mmath_export str MATHunary_ISINF(int *res, const dbl *a);
mmath_export str MATHunary_FINITE(bit *res, const dbl *a);
mmath_export str MATHrandint(int *res);
-mmath_export str MATHrandintseed(int *res, const int *seed);
+mmath_export str MATHrandintarg(int *res, const int *dummy);
mmath_export str MATHsrandint(void *ret, const int *seed);
mmath_export str MATHsqlrandint(int *res, const int *seed);
mmath_export str MATHpi(dbl *pi);
diff --git a/monetdb5/modules/kernel/mmath.mal
b/monetdb5/modules/kernel/mmath.mal
--- a/monetdb5/modules/kernel/mmath.mal
+++ b/monetdb5/modules/kernel/mmath.mal
@@ -200,7 +200,7 @@ address MATHrandint
comment "return a random number";
command rand{unsafe} (v:int) :int
-address MATHrandintseed
+address MATHrandintarg
comment "return a random number";
command srand(seed:int) :void
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list