Changeset: 450d9f6e8928 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/450d9f6e8928
Modified Files:
        cmake/monetdb-defines.cmake
        monetdb_config.h.in
Branch: samloader
Log Message:

merge with default branch


diffs (truncated from 4080 to 300 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
@@ -9125,6 +9125,9 @@ dict      join    pattern dict.join(X_0:bat[:any
 dict   renumber        pattern dict.renumber(X_0:bat[:any_1], 
X_1:bat[:any_1]):bat[:any_1]     DICTrenumber    renumber offsets
 dict   select  pattern dict.select(X_0:bat[:any], X_1:bat[:oid], 
X_2:bat[:any_1], X_3:any_1, X_4:any_1, X_5:bit, X_6:bit, X_7:bit, 
X_8:bit):bat[:oid]  DICTselect      value - range select on a dictionary
 dict   thetaselect     pattern dict.thetaselect(X_0:bat[:any], X_1:bat[:oid], 
X_2:bat[:any_1], X_3:any_1, X_4:str):bat[:oid]   DICTthetaselect thetaselect on 
a dictionary
+fhash  build   pattern fhash.build(X_0:bat[:any_1], X_1:bit) (X_2:bat[:oid], 
X_3:bat[:any_1])  FHASHbuild      Add `keys` to the `hashtable`. If 
`need_has_nil`, denote if `keys` contains NULL. Returns corresponding `gids` of 
the `keys` and the updated `hashtable`
+fhash  new     pattern fhash.new(X_0:any_1, X_1:lng, X_2:lng):bat[:any_1]      
FHASHnew        (empty)
+fhash  probe   command fhash.probe(X_0:bat[:any_1], X_1:bat[:any_1], X_2:bit, 
X_3:bit) (X_4:bat[:oid], X_5:bat[:oid])  FHASHprobe      Probe the `key` in the 
hash table. For a matched key, return its OID in the 'key' column and the slot 
ID in the hash table
 fits   attach  unsafe pattern fits.attach(X_0:str):void        FITSattach      
Open a FITS file and return catalog of the table HDUs
 fits   export  pattern fits.export(X_0:str):void       FITSexportTable Export 
a table to a FITS file
 fits   fitstest        command fits.fitstest(X_0:str):int      FITStest        
Returns the type of first extension in the FITS file filename
@@ -9678,6 +9681,7 @@ iaggr     sum     command iaggr.sum(X_0:bat[:flt
 iaggr  sum     command iaggr.sum(X_0:bat[:dbl], X_1:bit) (X_2:dbl, X_3:dbl, 
X_4:lng)   IALGfsum_skipnil        Return the Kahan/Neumaier summation or nil.
 iaggr  sum     command iaggr.sum(X_0:bat[:flt], X_1:bit) (X_2:dbl, X_3:dbl, 
X_4:lng)   IALGfsum_skipnil        Return the Kahan/Neumaier summation or nil.
 iaggr  sum     command iaggr.sum(X_0:bat[:flt], X_1:bit) (X_2:flt, X_3:flt, 
X_4:lng)   IALGfsum_skipnil_flt    Return the Kahan/Neumaier summation or nil.
+ialgebra       matched command ialgebra.matched(X_0:bat[:bit], 
X_1:bat[:oid]):bat[:oid]        OAHASHmatched   Mark matched rows, only return 
rows matched rows on first match.
 ialgebra       project pattern ialgebra.project(X_0:bat[:oid], 
X_1:any_1):bat[:any_1]  LALGconstant    Project a single value
 ialgebra       projection      command ialgebra.projection(X_0:bat[:oid], 
X_1:bat[:any_1]):bat[:any_1] LALGprojection  Project.
 ialgebra       unique  command ialgebra.unique(X_0:bat[:any_1], X_1:bat[:oid], 
X_2:bat[:oid], X_3:bit) (X_4:bat[:oid], X_5:bat[:any_1])        
LALGgroup_unique        Unique rows per group.
@@ -10112,10 +10116,6 @@ oahash hash    pattern oahash.hash(X_0:any_
 oahash hashmark_init   command oahash.hashmark_init(X_0:bat[:any_1], 
X_1:bat[:any_2]):bat[:bit]        OAHASHhashmark_init     (empty)
 oahash mprobe  command oahash.mprobe(X_0:bat[:any_1], X_1:bat[:any_1], 
X_2:bit, X_3:bit) (X_4:bat[:oid], X_5:bat[:oid], X_6:bat[:bit]) OAHASHmprobe    
Probe the `key`-s in the hash table. For a matched key, return its OID in the 
'key' column and the slot ID in the hash table
 oahash mprobe  command oahash.mprobe(X_0:bat[:any_1], X_1:bat[:any_1], 
X_2:bat[:lng], X_3:bit, X_4:bit) (X_5:bat[:oid], X_6:bat[:oid], X_7:bat[:bit])  
OAHASHmprobe_single     Probe the `key`-s in the hash table. For a matched key, 
return its OID in the 'key' column and the slot ID in the hash table
-oahash new     pattern oahash.new(X_0:any_1, X_1:int):bat[:any_1]      
OAHASHnew       (empty)
-oahash new     pattern oahash.new(X_0:any_1, X_1:int, 
X_2:bat[:any_2]):bat[:any_1]     OAHASHnew       (empty)
-oahash new     pattern oahash.new(X_0:any_1, X_1:int, X_2:bat[:any_2], 
X_3:int):bat[:any_1]    OAHASHnew       (empty)
-oahash new     pattern oahash.new(X_0:any_1, X_1:int, X_2:int):bat[:any_1]     
OAHASHnew       (empty)
 oahash new     pattern oahash.new(X_0:any_1, X_1:lng):bat[:any_1]      
OAHASHnew       (empty)
 oahash new     pattern oahash.new(X_0:any_1, X_1:lng, 
X_2:bat[:any_2]):bat[:any_1]     OAHASHnew       (empty)
 oahash new     pattern oahash.new(X_0:any_1, X_1:lng, X_2:bat[:any_2], 
X_3:int):bat[:any_1]    OAHASHnew       (empty)
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
@@ -6830,6 +6830,9 @@ dict      join    pattern dict.join(X_0:bat[:any
 dict   renumber        pattern dict.renumber(X_0:bat[:any_1], 
X_1:bat[:any_1]):bat[:any_1]     DICTrenumber    renumber offsets
 dict   select  pattern dict.select(X_0:bat[:any], X_1:bat[:oid], 
X_2:bat[:any_1], X_3:any_1, X_4:any_1, X_5:bit, X_6:bit, X_7:bit, 
X_8:bit):bat[:oid]  DICTselect      value - range select on a dictionary
 dict   thetaselect     pattern dict.thetaselect(X_0:bat[:any], X_1:bat[:oid], 
X_2:bat[:any_1], X_3:any_1, X_4:str):bat[:oid]   DICTthetaselect thetaselect on 
a dictionary
+fhash  build   pattern fhash.build(X_0:bat[:any_1], X_1:bit) (X_2:bat[:oid], 
X_3:bat[:any_1])  FHASHbuild      Add `keys` to the `hashtable`. If 
`need_has_nil`, denote if `keys` contains NULL. Returns corresponding `gids` of 
the `keys` and the updated `hashtable`
+fhash  new     pattern fhash.new(X_0:any_1, X_1:lng, X_2:lng):bat[:any_1]      
FHASHnew        (empty)
+fhash  probe   command fhash.probe(X_0:bat[:any_1], X_1:bat[:any_1], X_2:bit, 
X_3:bit) (X_4:bat[:oid], X_5:bat[:oid])  FHASHprobe      Probe the `key` in the 
hash table. For a matched key, return its OID in the 'key' column and the slot 
ID in the hash table
 fits   attach  unsafe pattern fits.attach(X_0:str):void        FITSattach      
Open a FITS file and return catalog of the table HDUs
 fits   export  pattern fits.export(X_0:str):void       FITSexportTable Export 
a table to a FITS file
 fits   fitstest        command fits.fitstest(X_0:str):int      FITStest        
Returns the type of first extension in the FITS file filename
@@ -7319,6 +7322,7 @@ iaggr     sum     command iaggr.sum(X_0:bat[:flt
 iaggr  sum     command iaggr.sum(X_0:bat[:dbl], X_1:bit) (X_2:dbl, X_3:dbl, 
X_4:lng)   IALGfsum_skipnil        Return the Kahan/Neumaier summation or nil.
 iaggr  sum     command iaggr.sum(X_0:bat[:flt], X_1:bit) (X_2:dbl, X_3:dbl, 
X_4:lng)   IALGfsum_skipnil        Return the Kahan/Neumaier summation or nil.
 iaggr  sum     command iaggr.sum(X_0:bat[:flt], X_1:bit) (X_2:flt, X_3:flt, 
X_4:lng)   IALGfsum_skipnil_flt    Return the Kahan/Neumaier summation or nil.
+ialgebra       matched command ialgebra.matched(X_0:bat[:bit], 
X_1:bat[:oid]):bat[:oid]        OAHASHmatched   Mark matched rows, only return 
rows matched rows on first match.
 ialgebra       project pattern ialgebra.project(X_0:bat[:oid], 
X_1:any_1):bat[:any_1]  LALGconstant    Project a single value
 ialgebra       projection      command ialgebra.projection(X_0:bat[:oid], 
X_1:bat[:any_1]):bat[:any_1] LALGprojection  Project.
 ialgebra       unique  command ialgebra.unique(X_0:bat[:any_1], X_1:bat[:oid], 
X_2:bat[:oid], X_3:bit) (X_4:bat[:oid], X_5:bat[:any_1])        
LALGgroup_unique        Unique rows per group.
@@ -7749,10 +7753,6 @@ oahash   hash    pattern oahash.hash(X_0:any_
 oahash hashmark_init   command oahash.hashmark_init(X_0:bat[:any_1], 
X_1:bat[:any_2]):bat[:bit]        OAHASHhashmark_init     (empty)
 oahash mprobe  command oahash.mprobe(X_0:bat[:any_1], X_1:bat[:any_1], 
X_2:bit, X_3:bit) (X_4:bat[:oid], X_5:bat[:oid], X_6:bat[:bit]) OAHASHmprobe    
Probe the `key`-s in the hash table. For a matched key, return its OID in the 
'key' column and the slot ID in the hash table
 oahash mprobe  command oahash.mprobe(X_0:bat[:any_1], X_1:bat[:any_1], 
X_2:bat[:lng], X_3:bit, X_4:bit) (X_5:bat[:oid], X_6:bat[:oid], X_7:bat[:bit])  
OAHASHmprobe_single     Probe the `key`-s in the hash table. For a matched key, 
return its OID in the 'key' column and the slot ID in the hash table
-oahash new     pattern oahash.new(X_0:any_1, X_1:int):bat[:any_1]      
OAHASHnew       (empty)
-oahash new     pattern oahash.new(X_0:any_1, X_1:int, 
X_2:bat[:any_2]):bat[:any_1]     OAHASHnew       (empty)
-oahash new     pattern oahash.new(X_0:any_1, X_1:int, X_2:bat[:any_2], 
X_3:int):bat[:any_1]    OAHASHnew       (empty)
-oahash new     pattern oahash.new(X_0:any_1, X_1:int, X_2:int):bat[:any_1]     
OAHASHnew       (empty)
 oahash new     pattern oahash.new(X_0:any_1, X_1:lng):bat[:any_1]      
OAHASHnew       (empty)
 oahash new     pattern oahash.new(X_0:any_1, X_1:lng, 
X_2:bat[:any_2]):bat[:any_1]     OAHASHnew       (empty)
 oahash new     pattern oahash.new(X_0:any_1, X_1:lng, X_2:bat[:any_2], 
X_3:int):bat[:any_1]    OAHASHnew       (empty)
diff --git a/clients/examples/C/streamcat.c b/clients/examples/C/streamcat.c
--- a/clients/examples/C/streamcat.c
+++ b/clients/examples/C/streamcat.c
@@ -75,14 +75,12 @@ static void copy_stream_to_file(stream *
 
 static void copy_file_to_stream(FILE *in, stream *out, size_t bufsize, bool 
do_flush, mnstr_flush_level flush_level);
 
-_Noreturn static void croak(int status, _In_z_ _Printf_format_string_ const 
char *msg, ...)
-       __attribute__((__format__(__printf__, 2, 3)));
-
 /* Format the message and write it to stderr. Then exit with the given status.
  * If status is 1, include USAGE in the message.
  */
-static void
-croak(int status, const char *msg, ...)
+__attribute__((__format__(__printf__, 2, 3)))
+_Noreturn static void
+croak(int status, _In_z_ _Printf_format_string_ const char *msg, ...)
 {
        va_list ap;
 
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -213,7 +213,7 @@ static const char *actions[] = {
        "SET NULL",
        "SET DEFAULT",
 };
-#define NR_ACTIONS     ((int) (sizeof(actions) / sizeof(actions[0])))
+#define NR_ACTIONS     ((int) countof(actions))
 
 static char *
 get_schema(Mapi mid)
@@ -858,7 +858,7 @@ dump_type(Mapi mid, stream *sqlf, const 
                int sub = atoi(c_type_digits);
 
                if (sub > 0 && (sub & 3) == 0 &&
-                   (sub >> 2) < (int) (sizeof(geomsubtypes) / 
sizeof(geomsubtypes[0])))
+                   (sub >> 2) < (int) countof(geomsubtypes))
                        geom = geomsubtypes[sub >> 2];
                if (geom) {
                        mnstr_printf(sqlf, "GEOMETRY(%s", geom);
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -1235,7 +1235,7 @@ sql_help(const char *pattern, stream *to
        for (i = 0; i < step; i++) {
                for (int j = 0; j < ncolumns; j++) {
                        size_t nextNum = i + j * step;
-                       if(nextNum < sizeof(sqlhelp1)/sizeof(sqlhelp1[0]) - 1) {
+                       if(nextNum < countof(sqlhelp1) - 1) {
                                sql_word(sqlhelp1[nextNum].command, j < 
ncolumns - 1 ? maxlen : 0, toConsole);
                        }
                }
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -780,7 +780,7 @@ mapi_handshake(Mapi mid)
                                        break;
                                case '^':
                                        r = mid->redirects;
-                                       m = NELEM(mid->redirects) - 1;
+                                       m = countof(mid->redirects) - 1;
                                        while (*r != NULL && m > 0) {
                                                m--;
                                                r++;
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -991,7 +991,7 @@ wsaerror(int err)
 {
        int i;
 
-       for (i = 0; i < NELEM(wsaerrlist); i++)
+       for (i = 0; i < countof(wsaerrlist); i++)
                if (wsaerrlist[i].e == err)
                        return wsaerrlist[i].m;
        return "Unknown error";
diff --git a/clients/mapilib/mapi.h b/clients/mapilib/mapi.h
--- a/clients/mapilib/mapi.h
+++ b/clients/mapilib/mapi.h
@@ -255,7 +255,8 @@ mapi_export const char *mapi_get_host(Ma
        __attribute__((__nonnull__(1)));
 mapi_export const char *mapi_get_user(Mapi mid)
        __attribute__((__nonnull__(1)));
-mapi_export const char *mapi_get_mapi_version(void);
+mapi_export const char *mapi_get_mapi_version(void)
+       __attribute__((__const__));
 mapi_export const char *mapi_get_monet_version(Mapi mid)
        __attribute__((__nonnull__(1)));
 mapi_export const char *mapi_get_motd(Mapi mid)
diff --git a/clients/mapilib/mapi_intern.h b/clients/mapilib/mapi_intern.h
--- a/clients/mapilib/mapi_intern.h
+++ b/clients/mapilib/mapi_intern.h
@@ -87,11 +87,6 @@ gmtime_r(const time_t *restrict timep, s
 #endif
 
 
-/* number of elements in an array */
-#define NELEM(arr)     (sizeof(arr) / sizeof(arr[0]))
-
-
-
 /* three structures used for communicating date/time information */
 /* these structs are deliberately compatible with the ODBC versions
    SQL_DATE_STRUCT, SQL_TIME_STRUCT, and SQL_TIMESTAMP_STRUCT */
@@ -275,7 +270,8 @@ void mapi_clrError(Mapi mid)
 MapiMsg mapi_setError(Mapi mid, const char *msg, const char *action, MapiMsg 
error)
        __attribute__((__nonnull__(2, 3)));
 MapiMsg mapi_printError(Mapi mid, const char *action, MapiMsg error, _In_z_ 
_Printf_format_string_ const char *fmt, ...)
-       __attribute__((__nonnull__(2))) __attribute__((__format__(__printf__, 
4, 5)));
+       __attribute__((__nonnull__(2)))
+       __attribute__((__format__(__printf__, 4, 5)));
 
 void mapi_impl_log_data(Mapi mid, const char *filename, long line, const char 
*mark, const char *data, size_t len);
 void mapi_impl_log_record(Mapi mid, const char *filename, long line, const 
char *mark, _In_z_ _Printf_format_string_ const char *fmt, ...)
diff --git a/clients/mapilib/msettings.c b/clients/mapilib/msettings.c
--- a/clients/mapilib/msettings.c
+++ b/clients/mapilib/msettings.c
@@ -46,7 +46,7 @@ int msetting_parse_bool(const char *text
                { "on", true },
                { "off", false },
        };
-       for (size_t i = 0; i < sizeof(variants) / sizeof(variants[0]); i++)
+       for (size_t i = 0; i < countof(variants); i++)
                if (strcasecmp(text, variants[i].word) == 0)
                        return variants[i].value;
        return -1;
@@ -92,7 +92,7 @@ by_name[] = {
 mparm
 mparm_parse(const char *name)
 {
-       int n = sizeof(by_name) / sizeof(by_name[0]);
+       int n = countof(by_name);
        // could use a binary search but this is not going to be a bottleneck
        for (int i = 0; i < n; i++)
                if (strcmp(by_name[i].name, name) == 0)
@@ -104,7 +104,7 @@ mparm_parse(const char *name)
 mparm
 mparm_enumerate(int i)
 {
-       int n = sizeof(by_name) / sizeof(by_name[0]);
+       int n = countof(by_name);
        if (i < 0 || i >= n)
                return MP_UNKNOWN;
        return by_name[i].parm;
diff --git a/clients/mapilib/msettings_internal.h 
b/clients/mapilib/msettings_internal.h
--- a/clients/mapilib/msettings_internal.h
+++ b/clients/mapilib/msettings_internal.h
@@ -141,7 +141,8 @@ msettings_strdup(const msettings *mp, co
 
 __attribute__((__format__(__printf__, 2, 3)))
 static inline char*
-msettings_allocprintf(const msettings *mp, const char *fmt, ...)
+msettings_allocprintf(const msettings *mp,
+                     _In_z_ _Printf_format_string_ const char *fmt, ...)
 {
        char *buffer = NULL;
        va_list ap, ap2;
diff --git a/clients/mapilib/parseurl.c b/clients/mapilib/parseurl.c
--- a/clients/mapilib/parseurl.c
+++ b/clients/mapilib/parseurl.c
@@ -66,11 +66,9 @@ advance(scanner *sc)
        return sc->c;
 }
 
-static bool complain(scanner *sc, _In_z_ _Printf_format_string_ const char 
*fmt, ...)
-       __attribute__((__format__(printf, 2, 3)));
-
+__attribute__((__format__(printf, 2, 3)))
 static bool
-complain(scanner *sc, const char *fmt, ...)
+complain(scanner *sc, _In_z_ _Printf_format_string_ const char *fmt, ...)
 {
        // do not overwrite existing error message,
        // the first one is usually the most informative.
diff --git a/clients/mapilib/writeurl.c b/clients/mapilib/writeurl.c
--- a/clients/mapilib/writeurl.c
+++ b/clients/mapilib/writeurl.c
@@ -77,11 +77,9 @@ ob_append_escaped(struct outbuf *ob, con
        }
 }
 
-static void ob_printf(struct outbuf *ob, _In_z_ _Printf_format_string_ const 
char *fmt, ...)
-       __attribute__((__format__(__printf__, 2, 3)));
-
+__attribute__((__format__(__printf__, 2, 3)))
 static void
-ob_printf(struct outbuf *ob, const char *fmt, ...)
+ob_printf(struct outbuf *ob, _In_z_ _Printf_format_string_ const char *fmt, 
...)
 {
        va_list ap;
        size_t avail = ob->end - ob->pos;
diff --git a/clients/odbc/driver/ODBCAttrs.c b/clients/odbc/driver/ODBCAttrs.c
--- a/clients/odbc/driver/ODBCAttrs.c
+++ b/clients/odbc/driver/ODBCAttrs.c
@@ -51,7 +51,7 @@ const struct attr_setting attr_settings[
        { "MAPTOLONGVARCHAR", NULL, MP_MAPTOLONGVARCHAR },
 };
 
-const int attr_setting_count = sizeof(attr_settings) / 
sizeof(attr_settings[0]);
+const int attr_setting_count = countof(attr_settings);
 
 int
 attr_setting_lookup(const char *attr_name, bool allow_alt_name)
@@ -65,4 +65,3 @@ attr_setting_lookup(const char *attr_nam
        }
        return -1;
 }
-
diff --git a/clients/odbc/driver/ODBCGlobal.h b/clients/odbc/driver/ODBCGlobal.h
--- a/clients/odbc/driver/ODBCGlobal.h
+++ b/clients/odbc/driver/ODBCGlobal.h
@@ -98,11 +98,9 @@ extern const char *ODBCdebug;
 
 extern void setODBCdebug(const char *filename, bool overrideEnvVar);
 
-static inline void ODBCLOG(_In_z_ _Printf_format_string_ const char *fmt, ...)
-       __attribute__((__format__(__printf__, 1, 2)));
-
+__attribute__((__format__(__printf__, 1, 2)))
 static inline void
-ODBCLOG(const char *fmt, ...)
+ODBCLOG(_In_z_ _Printf_format_string_ const char *fmt, ...)
 {
        va_list ap;
 
diff --git a/clients/odbc/driver/SQLGetFunctions.c 
b/clients/odbc/driver/SQLGetFunctions.c
--- a/clients/odbc/driver/SQLGetFunctions.c
+++ b/clients/odbc/driver/SQLGetFunctions.c
@@ -161,7 +161,7 @@ static UWORD FuncImplemented[] = {
 #endif /* not yet implemented */
 };
 
-#define NFUNCIMPLEMENTED (sizeof(FuncImplemented)/sizeof(FuncImplemented[0]))
+#define NFUNCIMPLEMENTED countof(FuncImplemented)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to