Changeset: d1579bdd0293 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d1579bdd0293
Modified Files:
        clients/Tests/MAL-signatures-hge.test
        clients/Tests/MAL-signatures.test
        monetdb5/mal/mal_listing.c
        monetdb5/modules/kernel/batstr.c
        monetdb5/modules/mal/calc.c
        monetdb5/modules/mal/inspect.c
Branch: Dec2025
Log Message:

Some cleanup.  Remove unused (and unusable) MAL function inspect.getAtomSuper.


diffs (185 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -47189,11 +47189,6 @@ command inspect.getAtomSizes():bat[:int]
 INSPECTatom_sizes
 Collect a BAT with the atom sizes.
 inspect
-getAtomSuper
-command inspect.getAtomSuper():bat[:str]
-INSPECTatom_sup_names
-Collect a BAT with the atom names.
-inspect
 getComment
 pattern inspect.getComment(X_0:str, X_1:str):bat[:str]
 INSPECTgetComment
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -35689,11 +35689,6 @@ command inspect.getAtomSizes():bat[:int]
 INSPECTatom_sizes
 Collect a BAT with the atom sizes.
 inspect
-getAtomSuper
-command inspect.getAtomSuper():bat[:str]
-INSPECTatom_sup_names
-Collect a BAT with the atom names.
-inspect
 getComment
 pattern inspect.getComment(X_0:str, X_1:str):bat[:str]
 INSPECTgetComment
diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -65,7 +65,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
        char *bufend = buf;
        int nameused = 0;
        str tpe;
-       int showtype = 0, closequote = 0;
+       bool showtype = false, closequote = false;
        int varid = getArg(p, idx);
 
        // show the name when required or is used
@@ -105,7 +105,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
                        if (!isaBatType(getVarType(mb, varid))
                                && getBatType(getVarType(mb, varid)) >= 
TYPE_date
                                && getBatType(getVarType(mb, varid)) != 
TYPE_str) {
-                               closequote = 1;
+                               closequote = true;
                                bufend = stpcpy(bufend, "\"");
                        }
                        size_t cv_len = strlen(cv);
@@ -123,7 +123,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
                        if (closequote) {
                                bufend = stpcpy(bufend, "\"");
                        }
-                       showtype = showtype || closequote > TYPE_str ||
+                       showtype = showtype ||
                                ((isVarTypedef(mb, varid) ||
                                  (flg & (LIST_MAL_REMOTE | LIST_MAL_TYPE))) && 
isVarConstant(mb, varid)) ||
                                (isaBatType(getVarType(mb, varid)) && idx < 
p->retc);
diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -82,9 +82,9 @@ do_batstr_int(Client cntxt, MalBlkPtr mb
        bool nils = false;
        struct canditer ci1 = { 0 };
        oid off1;
-       bat *res = getArgReference_bat(stk, pci, 0),
-               bid = *getArgReference_bat(stk, pci, 1),
-               *sid1 = pci->argc == 3 ? getArgReference_bat(stk, pci, 2) : 
NULL;
+       bat *res = getArgReference_bat(stk, pci, 0);
+       bat bid = *getArgReference_bat(stk, pci, 1);
+       bat sid = pci->argc == 3 ? *getArgReference_bat(stk, pci, 2) : 0;
 
        (void) cntxt;
        (void) mb;
@@ -93,7 +93,7 @@ do_batstr_int(Client cntxt, MalBlkPtr mb
                                                          SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
                goto bailout;
        }
-       if (sid1 && !is_bat_nil(*sid1) && !(bs = BATdescriptor(*sid1))) {
+       if (!is_bat_nil(sid) && !(bs = BATdescriptor(sid))) {
                msg = createException(MAL, name,
                                                          SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
                goto bailout;
diff --git a/monetdb5/modules/mal/calc.c b/monetdb5/modules/mal/calc.c
--- a/monetdb5/modules/mal/calc.c
+++ b/monetdb5/modules/mal/calc.c
@@ -570,7 +570,7 @@ CALCmin(Client cntxt, MalBlkPtr mb, MalS
        if (t != getArgType(mb, pci, 2))
                return mythrow(MAL, "calc.min", SEMANTIC_TYPE_MISMATCH);
        nil = ATOMnilptr(t);
-       if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+       if (ATOMstorage(t) >= TYPE_str) {
                p1 = *(ptr *) p1;
                p2 = *(ptr *) p2;
        }
@@ -596,7 +596,7 @@ CALCmin_no_nil(Client cntxt, MalBlkPtr m
        if (t != getArgType(mb, pci, 2))
                return mythrow(MAL, "calc.min", SEMANTIC_TYPE_MISMATCH);
        nil = ATOMnilptr(t);
-       if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+       if (ATOMstorage(t) >= TYPE_str) {
                p1 = *(ptr *) p1;
                p2 = *(ptr *) p2;
        }
@@ -608,7 +608,7 @@ CALCmin_no_nil(Client cntxt, MalBlkPtr m
                        if (t != getArgType(mb, pci, i))
                                return mythrow(MAL, "calc.min", 
SEMANTIC_TYPE_MISMATCH);
                        ptr p2 = getArgReference(stk, pci, i);
-                       if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str)
+                       if (ATOMstorage(t) >= TYPE_str)
                                p2 = *(ptr *) p2;
                        if (ATOMeq(t, p1, nil) ||
                                (!ATOMeq(t, p2, nil) && ATOMcmp(t, p1, p2) > 0))
@@ -633,7 +633,7 @@ CALCmax(Client cntxt, MalBlkPtr mb, MalS
        if (t != getArgType(mb, pci, 2))
                return mythrow(MAL, "calc.max", SEMANTIC_TYPE_MISMATCH);
        nil = ATOMnilptr(t);
-       if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+       if (ATOMstorage(t) >= TYPE_str) {
                p1 = *(ptr *) p1;
                p2 = *(ptr *) p2;
        }
@@ -692,7 +692,7 @@ CALCmax_no_nil(Client cntxt, MalBlkPtr m
        if (t != getArgType(mb, pci, 2))
                return mythrow(MAL, "calc.max", SEMANTIC_TYPE_MISMATCH);
        nil = ATOMnilptr(t);
-       if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str) {
+       if (ATOMstorage(t) >= TYPE_str) {
                p1 = *(ptr *) p1;
                p2 = *(ptr *) p2;
        }
@@ -704,7 +704,7 @@ CALCmax_no_nil(Client cntxt, MalBlkPtr m
                        if (t != getArgType(mb, pci, i))
                                return mythrow(MAL, "calc.max", 
SEMANTIC_TYPE_MISMATCH);
                        ptr p2 = getArgReference(stk, pci, i);
-                       if (t >= TYPE_str && ATOMstorage(t) >= TYPE_str)
+                       if (ATOMstorage(t) >= TYPE_str)
                                p2 = *(ptr *) p2;
                        if (ATOMeq(t, p1, nil) ||
                                (!ATOMeq(t, p2, nil) && ATOMcmp(t, p1, p2) < 0))
diff --git a/monetdb5/modules/mal/inspect.c b/monetdb5/modules/mal/inspect.c
--- a/monetdb5/modules/mal/inspect.c
+++ b/monetdb5/modules/mal/inspect.c
@@ -525,31 +525,6 @@ INSPECTgetDatabaseName(Client ctx, str *
 }
 
 static str
-INSPECTatom_sup_names(Client ctx, bat *ret)
-{
-       (void) ctx;
-       int i, k;
-       BAT *b = COLnew(0, TYPE_str, 256, TRANSIENT);
-
-       if (b == 0)
-               throw(MAL, "inspect.getAtomSuper", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-
-       for (i = 0; i < GDKatomcnt; i++) {
-               for (k = ATOMstorage(i); k > TYPE_str; k = ATOMstorage(k)) ;
-               if (BUNappend(b, ATOMname(k), false) != GDK_SUCCEED)
-                       goto bailout;
-       }
-
-       *ret = b->batCacheid;
-       BBPkeepref(b);
-
-       return MAL_SUCCEED;
-  bailout:
-       BBPreclaim(b);
-       throw(MAL, "inspect.getAtomSuper", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-}
-
-static str
 INSPECTatom_sizes(Client ctx, bat *ret)
 {
        (void) ctx;
@@ -671,7 +646,6 @@ static mel_func inspect_init_funcs[] = {
  pattern("inspect", "getType", INSPECTtypeName, false, "Return the concrete 
type of a variable (expression).", args(1,2, arg("",str),argany("v",1))),
  pattern("inspect", "equalType", INSPECTequalType, false, "Return true if both 
operands are of the same type", args(1,3, 
arg("",bit),argany("l",0),argany("r",0))),
  command("inspect", "getAtomNames", INSPECTatom_names, false, "Collect a BAT 
with the atom names.", args(1,1, batarg("",str))),
- command("inspect", "getAtomSuper", INSPECTatom_sup_names, false, "Collect a 
BAT with the atom names.", args(1,1, batarg("",str))),
  command("inspect", "getAtomSizes", INSPECTatom_sizes, false, "Collect a BAT 
with the atom sizes.", args(1,1, batarg("",int))),
  command("inspect", "getEnvironment", INSPECTgetEnvironment, false, "Collect 
the environment variables.", args(2,2, batarg("k",str),batarg("v",str))),
  command("inspect", "getEnvironment", INSPECTgetEnvironmentKey, false, "Get 
the value of an environment variable", args(1,2, arg("",str),arg("k",str))),
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to