Changeset: 29a0b3ce1098 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=29a0b3ce1098
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_atoms.c
        gdk/gdk_atoms.h
        monetdb5/mal/mal_atom.c
        monetdb5/modules/atoms/blob.c
        monetdb5/modules/atoms/blob.mal
Branch: default
Log Message:

Cleanup: remove ATOMconvert/atomConvert.


diffs (300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -32209,8 +32209,6 @@ command blob.blob(s:blob):blob
 address BLOBblob_blob;
 comment Noop routine.
 
-command blob.#convert():void 
-address BLOBconvert;
 command blob.#del():void 
 address BLOBdel;
 command blob.#fromstr():void 
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
@@ -1016,7 +1016,6 @@ str BKCunload(bit *res, str *input);
 str BLOB_isnil(bit *retval, blob *val);
 str BLOBblob_blob(blob **d, blob **s);
 str BLOBblob_fromstr(blob **b, str *d);
-void BLOBconvert(blob *b, int direction);
 void BLOBdel(Heap *h, var_t *index);
 str BLOBeoln(char *src, char *end);
 str BLOBfromblob(str *retval, blob **b);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1941,8 +1941,6 @@ gdk_export BAT *BBPquickdesc(bat b, int 
  * @item int
  * @tab ATOMcmp         (int id, ptr val_1, ptr val_2);
  * @item int
- * @tab ATOMconvert     (int id, ptr v, int direction);
- * @item int
  * @tab ATOMfix         (int id, ptr v);
  * @item int
  * @tab ATOMunfix       (int id, ptr v);
@@ -2083,7 +2081,6 @@ typedef struct {
        int (*atomCmp) (const void *v1, const void *v2);
        BUN (*atomHash) (const void *v);
        /* optional functions */
-       void (*atomConvert) (ptr v, int direction);
        int (*atomFix) (const void *atom);
        int (*atomUnfix) (const void *atom);
 
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -103,24 +103,6 @@ lngHash(const lng *v)
 /*
  * @+ Standard Atoms
  */
-static inline void
-shtConvert(sht *s)
-{
-       *s = short_int_SWAP(*s);
-}
-
-static inline void
-intConvert(int *s)
-{
-       *s = normal_int_SWAP(*s);
-}
-
-static inline void
-lngConvert(lng *s)
-{
-       *s = long_long_SWAP(*s);
-}
-
 static inline int
 batFix(const bat *b)
 {
@@ -260,8 +242,6 @@ ATOMproperty(str id, str property, GDKfc
                        atomset(BATatoms[t].atomHeapCheck, (int (*)(Heap *, 
HeapRepair *)) arg);
                } else if (strcmp("del", property) == 0) {
                        atomset(BATatoms[t].atomDel, (void (*)(Heap *, var_t 
*)) arg);
-               } else if (strcmp("convert", property) == 0) {
-                       atomset(BATatoms[t].atomConvert, (void (*)(void *, 
int)) arg);
                } else if (strcmp("put", property) == 0) {
                        atomset(BATatoms[t].atomPut, (var_t (*)(Heap *, var_t 
*, const void *)) arg);
                } else if (strcmp("null", property) == 0) {
@@ -1762,13 +1742,13 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) OIDfromStr, (int (*)(str *, int 
*, const void *)) OIDtoStr,
         (void *(*)(void *, stream *, size_t)) voidRead, (int (*)(const void *, 
stream *, size_t)) voidWrite,
         (int (*)(const void *, const void *)) intCmp,
-        (BUN (*)(const void *)) intHash, 0,
+        (BUN (*)(const void *)) intHash,
 #else
         TYPE_void, 1, 0, /* sizeof(void) */ 0, 0, 1, (ptr) &oid_nil,
         (int (*)(const char *, int *, ptr *)) OIDfromStr, (int (*)(str *, int 
*, const void *)) OIDtoStr,
         (void *(*)(void *, stream *, size_t)) voidRead, (int (*)(const void *, 
stream *, size_t)) voidWrite,
         (int (*)(const void *, const void *)) lngCmp,
-        (BUN (*)(const void *)) lngHash, 0,
+        (BUN (*)(const void *)) lngHash,
 #endif
         0, 0,
         0, 0,
@@ -1778,7 +1758,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) bitFromStr, (int (*)(str *, int 
*, const void *)) bitToStr,
         (void *(*)(void *, stream *, size_t)) bitRead, (int (*)(const void *, 
stream *, size_t)) bitWrite,
         (int (*)(const void *, const void *)) bteCmp,
-        (BUN (*)(const void *)) bteHash, 0,
+        (BUN (*)(const void *)) bteHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1787,7 +1767,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) bteFromStr, (int (*)(str *, int 
*, const void *)) bteToStr,
         (void *(*)(void *, stream *, size_t)) bteRead, (int (*)(const void *, 
stream *, size_t)) bteWrite,
         (int (*)(const void *, const void *)) bteCmp,
-        (BUN (*)(const void *)) bteHash, 0,
+        (BUN (*)(const void *)) bteHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1796,7 +1776,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) shtFromStr, (int (*)(str *, int 
*, const void *)) shtToStr,
         (void *(*)(void *, stream *, size_t)) shtRead, (int (*)(const void *, 
stream *, size_t)) shtWrite,
         (int (*)(const void *, const void *)) shtCmp,
-        (BUN (*)(const void *)) shtHash, (void (*)(ptr, int)) shtConvert,
+        (BUN (*)(const void *)) shtHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1805,7 +1785,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) batFromStr, (int (*)(str *, int 
*, const void *)) batToStr,
         (void *(*)(void *, stream *, size_t)) batRead, (int (*)(const void *, 
stream *, size_t)) batWrite,
         (int (*)(const void *, const void *)) intCmp,
-        (BUN (*)(const void *)) intHash, (void (*)(ptr, int)) intConvert,
+        (BUN (*)(const void *)) intHash,
         (int (*)(const void *)) batFix, (int (*)(const void *)) batUnfix,
         0, 0,
         0, 0,
@@ -1814,7 +1794,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) intFromStr, (int (*)(str *, int 
*, const void *)) intToStr,
         (void *(*)(void *, stream *, size_t)) intRead, (int (*)(const void *, 
stream *, size_t)) intWrite,
         (int (*)(const void *, const void *)) intCmp,
-        (BUN (*)(const void *)) intHash, (void (*)(ptr, int)) intConvert,
+        (BUN (*)(const void *)) intHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1825,13 +1805,13 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) OIDfromStr, (int (*)(str *, int 
*, const void *)) OIDtoStr,
         (void *(*)(void *, stream *, size_t)) intRead, (int (*)(const void *, 
stream *, size_t)) intWrite,
         (int (*)(const void *, const void *)) intCmp,
-        (BUN (*)(const void *)) intHash, (void (*)(ptr, int)) intConvert,
+        (BUN (*)(const void *)) intHash,
 #else
         TYPE_lng, 1, sizeof(oid), sizeof(oid), 0, 0, (ptr) &oid_nil,
         (int (*)(const char *, int *, ptr *)) OIDfromStr, (int (*)(str *, int 
*, const void *)) OIDtoStr,
         (void *(*)(void *, stream *, size_t)) lngRead, (int (*)(const void *, 
stream *, size_t)) lngWrite,
         (int (*)(const void *, const void *)) lngCmp,
-        (BUN (*)(const void *)) lngHash, (void (*)(ptr, int)) lngConvert,
+        (BUN (*)(const void *)) lngHash,
 #endif
         0, 0,
         0, 0,
@@ -1843,13 +1823,13 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) intFromStr, (int (*)(str *, int 
*, const void *)) intToStr,
         (void *(*)(void *, stream *, size_t)) intRead, (int (*)(const void *, 
stream *, size_t)) intWrite,
         (int (*)(const void *, const void *)) intCmp,
-        (BUN (*)(const void *)) intHash, (void (*)(ptr, int)) intConvert,
+        (BUN (*)(const void *)) intHash,
 #else
         TYPE_lng, 1, sizeof(wrd), sizeof(wrd), 0, 0, (ptr) &lng_nil,
         (int (*)(const char *, int *, ptr *)) lngFromStr, (int (*)(str *, int 
*, const void *)) lngToStr,
         (void *(*)(void *, stream *, size_t)) lngRead, (int (*)(const void *, 
stream *, size_t)) lngWrite,
         (int (*)(const void *, const void *)) lngCmp,
-        (BUN (*)(const void *)) lngHash, (void (*)(ptr, int)) lngConvert,
+        (BUN (*)(const void *)) lngHash,
 #endif
         0, 0,
         0, 0,
@@ -1861,13 +1841,13 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) ptrFromStr, (int (*)(str *, int 
*, const void *)) ptrToStr,
         (void *(*)(void *, stream *, size_t)) ptrRead, (int (*)(const void *, 
stream *, size_t)) ptrWrite,
         (int (*)(const void *, const void *)) intCmp,
-        (BUN (*)(const void *)) intHash, (void (*)(ptr, int)) intConvert,
+        (BUN (*)(const void *)) intHash,
 #else /* SIZEOF_VOID_P == SIZEOF_LNG */
         TYPE_ptr, 1, sizeof(ptr), sizeof(ptr), 0, 0, (ptr) &ptr_nil,
         (int (*)(const char *, int *, ptr *)) ptrFromStr, (int (*)(str *, int 
*, const void *)) ptrToStr,
         (void *(*)(void *, stream *, size_t)) ptrRead, (int (*)(const void *, 
stream *, size_t)) ptrWrite,
         (int (*)(const void *, const void *)) lngCmp,
-        (BUN (*)(const void *)) lngHash, (void (*)(ptr, int)) lngConvert,
+        (BUN (*)(const void *)) lngHash,
 #endif
         0, 0,
         0, 0,
@@ -1877,7 +1857,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) fltFromStr, (int (*)(str *, int 
*, const void *)) fltToStr,
         (void *(*)(void *, stream *, size_t)) fltRead, (int (*)(const void *, 
stream *, size_t)) fltWrite,
         (int (*)(const void *, const void *)) fltCmp,
-        (BUN (*)(const void *)) intHash, (void (*)(ptr, int)) intConvert,
+        (BUN (*)(const void *)) intHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1886,7 +1866,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) dblFromStr, (int (*)(str *, int 
*, const void *)) dblToStr,
         (void *(*)(void *, stream *, size_t)) dblRead, (int (*)(const void *, 
stream *, size_t)) dblWrite,
         (int (*)(const void *, const void *)) dblCmp,
-        (BUN (*)(const void *)) lngHash, (void (*)(ptr, int)) lngConvert,
+        (BUN (*)(const void *)) lngHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1895,7 +1875,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) lngFromStr, (int (*)(str *, int 
*, const void *)) lngToStr,
         (void *(*)(void *, stream *, size_t)) lngRead, (int (*)(const void *, 
stream *, size_t)) lngWrite,
         (int (*)(const void *, const void *)) lngCmp,
-        (BUN (*)(const void *)) lngHash, (void (*)(ptr, int)) lngConvert,
+        (BUN (*)(const void *)) lngHash,
         0, 0,
         0, 0,
         0, 0,
@@ -1904,7 +1884,7 @@ atomDesc BATatoms[MAXATOMS] = {
         (int (*)(const char *, int *, ptr *)) strFromStr, (int (*)(str *, int 
*, const void *)) strToStr,
         (void *(*)(void *, stream *, size_t)) strRead, (int (*)(const void *, 
stream *, size_t)) strWrite,
         (int (*)(const void *, const void *)) strCmp,
-        (BUN (*)(const void *)) strHash, 0,
+        (BUN (*)(const void *)) strHash,
         0, 0,
         (var_t (*)(Heap *, var_t *, const void *)) strPut, 0,
         (int (*)(const void *)) strLen, strHeap,
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -205,7 +205,6 @@ gdk_export const ptr ptr_nil;
 #define ATOMtype(t)            ((t == TYPE_void)?TYPE_oid:t)
 #define ATOMfix(t,v)           do if (BATatoms[t].atomFix) 
BATatoms[t].atomFix(v); while (0)
 #define ATOMunfix(t,v)         do if (BATatoms[t].atomUnfix) 
BATatoms[t].atomUnfix(v); while (0)
-#define ATOMconvert(t,v,d)     do if (BATatoms[t].atomConvert) 
BATatoms[t].atomConvert(v,d); while (0)
 #define ATOMheapConvert(t,hp,d)        do if (BATatoms[t].atomHeapConvert) 
BATatoms[t].atomHeapConvert(hp,d); while (0)
 
 #define CONV_HTON               1
diff --git a/monetdb5/mal/mal_atom.c b/monetdb5/mal/mal_atom.c
--- a/monetdb5/mal/mal_atom.c
+++ b/monetdb5/mal/mal_atom.c
@@ -126,11 +126,6 @@ int malAtomProperty(MalBlkPtr mb, InstrP
                        setAtomName(pci);
                        return 1;
                }
-               if (idcmp("convert", name) == 0 && pci->argc == 1) {
-                       BATatoms[tpe].atomConvert = (void (*)(ptr, 
int))pci->fcn;
-                       setAtomName(pci);
-                       return 1;
-               }
                break;
        case 'f':
                if (idcmp("fromstr", name) == 0 && pci->argc == 1) {
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -53,7 +53,6 @@ blob_export int BLOBfromstr(char *instr,
 blob_export int BLOBnequal(blob *l, blob *r);
 blob_export BUN BLOBhash(blob *b);
 blob_export blob * BLOBnull(void);
-blob_export void BLOBconvert(blob *b, int direction);
 blob_export var_t BLOBput(Heap *h, var_t *bun, blob *val);
 blob_export void BLOBdel(Heap *h, var_t *index);
 blob_export int BLOBlength(blob *p);
@@ -176,13 +175,6 @@ blob_write(blob *a, stream *s, size_t cn
 #define normal_vart_SWAP(x)    ((var_t) long_long_SWAP((lng)x))
 #endif
 
-static void
-blob_convert(blob *b, int direction)
-{
-       (void) direction;
-       b->nitems = normal_vart_SWAP(b->nitems);
-}
-
 static int
 blob_length(blob *p)
 {
@@ -530,12 +522,6 @@ BLOBwrite(blob *a, stream *s, size_t cnt
        return blob_write(a,s,cnt);
 }
 
-void
-BLOBconvert(blob *b, int direction)
-{
-       blob_convert(b, direction);
-}
-
 int
 BLOBlength(blob *p)
 {
diff --git a/monetdb5/modules/atoms/blob.mal b/monetdb5/modules/atoms/blob.mal
--- a/monetdb5/modules/atoms/blob.mal
+++ b/monetdb5/modules/atoms/blob.mal
@@ -26,7 +26,6 @@ command hash()    address BLOBhash;
 command null()    address BLOBnull;
 command read()    address BLOBread;
 command write()   address BLOBwrite;
-command convert() address BLOBconvert;
 command put()     address BLOBput;
 command del()     address BLOBdel;
 command length()  address BLOBlength;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to