Changeset: e49dd3653633 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e49dd3653633
Modified Files:
        monetdb5/modules/mosaic/mosaic_prefix.c
Branch: mosaic
Log Message:

correct C
- casting int to float and back to int might "silence" compiler,
  but does not prevent potential loss of data and is hence incorrect
- cure problem rather than treat symptom
- use correct type(s) instead of excessive casting
- no need to cast variable/values to their own type


diffs (48 lines):

diff --git a/monetdb5/modules/mosaic/mosaic_prefix.c 
b/monetdb5/modules/mosaic/mosaic_prefix.c
--- a/monetdb5/modules/mosaic/mosaic_prefix.c
+++ b/monetdb5/modules/mosaic/mosaic_prefix.c
@@ -641,7 +641,7 @@ MOSdecompress_prefix(Client cntxt, MOSta
 #define  subselect_prefix(TPE, TPE2) \
 {      TPE2 *dst =  (TPE2*)  (((char*) blk) + MosaicBlkSize);\
        TPE2 mask = *dst++;\
-       TPE2  val  =  (TPE) *dst++,v;\
+       TPE2  val = *dst++,v;\
        TPE2 m;\
        BitVector base;\
        int residu;\
@@ -771,7 +771,7 @@ MOSsubselect_prefix(Client cntxt,  MOSta
 {      TPE low,hgh;\
     TPE2 *dst =  (TPE2*)  (((char*) blk) + MosaicBlkSize);\
     TPE2 mask = *dst++;\
-    TPE2  val  = (TPE2)((TPE) *dst++),v;\
+    TPE2  val = *dst++,v;\
     TPE2 m;\
     BitVector base;\
     int residu;\
@@ -861,7 +861,7 @@ MOSthetasubselect_prefix(Client cntxt,  
 {      TPE *r;\
     TPE2 *dst =  (TPE2*)  (((char*) blk) + MosaicBlkSize);\
     TPE2 mask = *dst++;\
-    TPE2  val  =  (TPE) *dst++,v;\
+    TPE2  val = *dst++,v;\
     TPE2 m;\
     BitVector base;\
     int residu;\
@@ -972,7 +972,7 @@ break;
 {   TPE *w;\
        TPE2 *dst =  (TPE2*)  (((char*) blk) + MosaicBlkSize);\
        TPE2 mask = *dst++;\
-       TPE2  val  =  (TPE2) *dst++,v;\
+       TPE2  val = *dst++,v;\
        TPE2 m;\
        BitVector base;\
        int residu;\
@@ -1015,7 +1015,7 @@ MOSsubjoin_prefix(Client cntxt,  MOStask
 {   lng *w;
        ulng *dst =  (ulng*)  (((char*) blk) + MosaicBlkSize);
        ulng mask = *dst++;
-       ulng  val  =  (ulng) *dst++,v;
+       ulng  val = *dst++,v;
        ulng m;
        BitVector base;
        int residu;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to