Changeset: eb61516153dc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eb61516153dc
Modified Files:
sql/backends/monet5/sql_readline.mx
sql/backends/monet5/vaults/vault.mx
Branch: default
Log Message:
Don't use MX macros unnecessarily.
diffs (66 lines):
diff --git a/sql/backends/monet5/sql_readline.mx
b/sql/backends/monet5/sql_readline.mx
--- a/sql/backends/monet5/sql_readline.mx
+++ b/sql/backends/monet5/sql_readline.mx
@@ -81,14 +81,11 @@
};
static int sqlcommandlimit = 13;
-@-
-@= tst
#ifdef HAVE_STRNCASECMP
- (strncasecmp(@1, @2, @3) == 0)
+#define STR_EQUAL(a, b, l) (strncasecmp(a, b, l) == 0)
#else
- (strncmp(@1, @2, @3) == 0)
+#define STR_EQUAL(a, b, l) (strncmp(a, b, l) == 0)
#endif
-@c
static char *
sql_command_generator(const char *text, int state)
@@ -105,13 +102,13 @@
}
if( mdbSession() ){
while ( (name = sql_commands[index++]) ){
- if( @:tst(name,text,len)@ )
+ if( STR_EQUAL(name, text, len) )
return strdup(name);
}
return NULL;
}
while (index < sqlcommandlimit && (name = sql_commands[index++])) {
- if( @:tst(name,text,len)@ )
+ if( STR_EQUAL(name, text, len) )
return strdup(name);
}
return NULL;
diff --git a/sql/backends/monet5/vaults/vault.mx
b/sql/backends/monet5/vaults/vault.mx
--- a/sql/backends/monet5/vaults/vault.mx
+++ b/sql/backends/monet5/vaults/vault.mx
@@ -229,13 +229,6 @@
char vaultpath[BUFSIZ];
@-
-@= initialize
- if ( vaultpath[0] == 0){
- snprintf(vaultpath, PATHLENGTH, "%s%c%s%cvault",
GDKgetenv("gdk_dbfarm"), DIR_SEP, GDKgetenv("gdk_dbname"), DIR_SEP);
- if (mkdir(vaultpath, 0755) < 0 && errno != EEXIST)
- return createException(MAL,"vault.getLocation", "can
not access vault directory");
- }
-@-
The curl sample code has been copied from
http://curl.haxx.se/libcurl/c/import.html
@c
#ifdef HAVE_CURL
@@ -342,7 +335,11 @@
curl_global_init(CURL_GLOBAL_DEFAULT);
}
#endif
- @:initialize@
+ if ( vaultpath[0] == 0){
+ snprintf(vaultpath, PATHLENGTH, "%s%c%s%cvault",
GDKgetenv("gdk_dbfarm"), DIR_SEP, GDKgetenv("gdk_dbname"), DIR_SEP);
+ if (mkdir(vaultpath, 0755) < 0 && errno != EEXIST)
+ return createException(MAL,"vault.getLocation", "can
not access vault directory");
+ }
(void) cntxt;
(void) mb;
(void) stk;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list