Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25089/modules/mal

Modified Files:
        factory.mx inspect.mx mdb.mx 
Log Message:
preparing for handling multiplexed inline functions.
minor code cleanup, saving 1.5 page of code.


Index: inspect.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/inspect.mx,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- inspect.mx  7 Apr 2007 21:05:48 -0000       1.84
+++ inspect.mx  24 Dec 2007 12:28:24 -0000      1.85
@@ -468,11 +468,8 @@
        Symbol s;
        char buf[BUFSIZ];
        BAT *b;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol(getName(*mod,strlen(*mod)), putName(*fcn, strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getDefinition", 
                                "failed to find <module>.<function>");
@@ -506,11 +503,8 @@
        char buf[BUFSIZ];
        str ps, tail;
        BAT *b;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol(getName(*mod,strlen(*mod)), putName(*fcn, strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getSignature", 
                                "failed to find <module>.<function>");
@@ -549,11 +543,8 @@
        char buf[BUFSIZ];
        str ps, tail;
        BAT *b;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol( getName(*mod,strlen(*mod)), putName(*fcn, 
strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getAddress", "failed to find 
<module>.<function>");
        b = BATnew(TYPE_str, TYPE_str, 12);
@@ -592,11 +583,8 @@
        Symbol s;
        char buf[BUFSIZ];
        BAT *b;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol( getName(*mod,strlen(*mod)), putName(*fcn, 
strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getComment", "failed to find 
<module>.<function>");
        b = BATnew(TYPE_str, TYPE_str, 12);
@@ -621,11 +609,8 @@
        Symbol s;
        char *buf;
        size_t len,lim;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol( getName(*mod,strlen(*mod)), putName(*fcn, 
strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getSource", 
                        "Failed to find <module>.<function>");
@@ -668,11 +653,8 @@
 {
        Symbol s;
        BAT *b;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol( getName(*mod,strlen(*mod)), putName(*fcn, 
strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getSignature", 
                        "failed to find <module>.<function>");
@@ -823,11 +805,8 @@
 INSPECTgetFunctionSize(lng *ret, str *mod, str *fcn)
 {
        Symbol s;
-       Client c= MCgetClient();
-       Module m;
 
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol( getName(*mod,strlen(*mod)), putName(*fcn, 
strlen(*fcn)));
        if (s == 0)
                throw(MAL, "inspect.getSize", 
                        "failed to find <module>.<function>");
@@ -852,14 +831,11 @@
 {
        str modnme = getArgName(mb, p, 1);
        str fcnnme = getArgName(mb, p, 2);
-       Module scope = NULL;
        Symbol s = NULL;
        Client c = MCgetClient();
 
-       scope = findModule(c->nspace, modnme);
 
-       if (scope)
-               s = findSymbolInModule(scope, putName(fcnnme, strlen(fcnnme)));
+       s = findSymbol(getName(modnme,strlen(modnme)), putName(fcnnme, 
strlen(fcnnme)));
 
        if (s == NULL){
                char buf[BUFSIZ];

Index: factory.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/factory.mx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- factory.mx  8 Apr 2007 20:09:46 -0000       1.23
+++ factory.mx  24 Dec 2007 12:28:24 -0000      1.24
@@ -171,12 +171,8 @@
 FCTshutdown(int *ret, str *mod, str *fcn)
 {
        Symbol s;
-       Client c= MCgetClient();
-       Module m;
-
        (void) ret;
-       m= findModule(c->nspace, getName(*mod,strlen(*mod)) );
-       s = findSymbolInModule(m, putName(*fcn, strlen(*fcn)));
+       s = findSymbol(getName(*mod,strlen(*mod)), putName(*fcn, strlen(*fcn)));
        if (s == NULL)
                throw(MAL, "factory.shutdown", "Factory not found");
        shutdownFactory(s->def);

Index: mdb.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/mdb.mx,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- mdb.mx      6 Nov 2007 23:27:31 -0000       1.64
+++ mdb.mx      24 Dec 2007 12:28:24 -0000      1.65
@@ -483,9 +483,7 @@
 {
        str modnme;
        str fcnnme;
-       Module scope = NULL;
        Symbol s = NULL;
-       Client c = MCgetClient();
 
        if (stk != 0) {
                modnme = (str) getArgValue(stk, p, 1);
@@ -495,10 +493,7 @@
                fcnnme = getArgDefault(mb, p, 2);
        }
 
-       scope = findModule(c->nspace, putName(modnme, strlen(modnme)));
-
-       if (scope)
-               s = findSymbolInModule(scope, putName(fcnnme, strlen(fcnnme)));
+       s = findSymbol(putName(modnme, strlen(modnme)), putName(fcnnme, 
strlen(fcnnme)));
 
        if (s == NULL)
                throw(MAL, "mdb.inspect", "Could not find function");
@@ -634,10 +629,8 @@
        str fcnnme = (str) getArgValue(stk, p, 2);
        Symbol s = NULL;
        Client c = MCgetClient();
-       Module mod;
 
-       mod= findModule(c->nspace, getName(modnme,strlen(modnme)) );
-       s = findSymbolInModule(mod, putName(fcnnme, strlen(fcnnme)));
+       s = findSymbol(getName(modnme,strlen(modnme)), putName(fcnnme, 
strlen(fcnnme)));
        if (s == NULL)
                showException(MAL,"mdb.list","Could not find %s.%s", modnme, 
fcnnme);
        else
@@ -664,10 +657,8 @@
        str fcnnme = (str) getArgValue(stk, p, 2);
        Symbol s = NULL;
        Client c = MCgetClient();
-       Module mod;
 
-       mod= findModule(c->nspace, getName(modnme,strlen(modnme)) );
-       s = findSymbolInModule(mod, putName(fcnnme, strlen(fcnnme)));
+       s = findSymbol(getName(modnme,strlen(modnme)), putName(fcnnme, 
strlen(fcnnme)));
        if (s == NULL)
                showException(MAL,"mdb.list","Could not find %s.%s", modnme, 
fcnnme);
        else
@@ -694,10 +685,8 @@
        str fcnnme = (str) getArgValue(stk, p, 2);
        Symbol s = NULL;
        Client c = MCgetClient();
-       Module mod;
 
-       mod= findModule(c->nspace, getName(modnme,strlen(modnme)) );
-       s = findSymbolInModule(mod, putName(fcnnme, strlen(fcnnme)));
+       s = findSymbol(getName(modnme,strlen(modnme)), putName(fcnnme, 
strlen(fcnnme)));
        if (s == NULL)
                showException(MAL,"mdb.var","Could not find %s.%s", modnme, 
fcnnme);
        else
@@ -787,9 +776,7 @@
        str fname;
        str modnme;
        str fcnnme;
-       Module scope = NULL;
        Symbol s = NULL;
-       Client c = MCgetClient();
 
        if (stk != 0) {
                modnme = (str) getArgValue(stk, p, 1);
@@ -801,10 +788,7 @@
                fname = getArgDefault(mb, p, 3);
        }
 
-       scope = findModule(c->nspace, putName(modnme, strlen(modnme)));
-
-       if (scope)
-               s = findSymbolInModule(scope, putName(fcnnme, strlen(fcnnme)));
+       s = findSymbol(getName(modnme,strlen(modnme)), putName(fcnnme, 
strlen(fcnnme)));
 
        if (s == NULL) {
                char buf[1024];


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to