Changeset: 9bd5d14db86e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9bd5d14db86e
Modified Files:
        CMakeLists.txt
        clients/mapiclient/prompt.c
        clients/mapiclient/tomograph.c
        gdk/gdk.h
        gdk/gdk_atoms.h
        gdk/gdk_posix.h
        gdk/gdk_utils.c
        monetdb5/mal/mal_linker.c
        monetdb5/modules/mal/wlc.h
        monetdb_config.h.in
        sql/backends/monet5/UDF/pyapi/pytypes.c
Branch: cmake-fun
Log Message:

Cleanup unused GDK macros.


diffs (214 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -507,7 +507,7 @@ endif()
 check_type_size(char SIZEOF_CHAR LANGUAGE C)
 check_type_size(short SIZEOF_SHORT LANGUAGE C)
 check_type_size(int SIZEOF_INT LANGUAGE C)
-check_type_size(long SIZEOF_LONG LANGUAGE C)
+check_type_size(long SIZEOF_LNG LANGUAGE C)
 set(SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
 check_type_size(wchar_t SIZEOF_WCHAR_T LANGUAGE C)
 set(HAVE_HGE OFF CACHE INTERNAL "Huge integers are available" FORCE)
diff --git a/clients/mapiclient/prompt.c b/clients/mapiclient/prompt.c
--- a/clients/mapiclient/prompt.c
+++ b/clients/mapiclient/prompt.c
@@ -19,14 +19,14 @@
 char *
 prompt_getlogin(void)
 {
-#ifndef NATIVE_WIN32
+#ifdef NATIVE_WIN32
+       return "win32";
+#else
        return getlogin();
-#else
-       return "win32";
 #endif
 }
 
-#ifdef _MSC_VER
+#ifdef NATIVE_WIN32
 char *
 simple_prompt(const char *prompt, int maxlen, int echo, const char *def)
 {
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -1153,7 +1153,7 @@ static int height = 160;
 static char *
 findlogo(void)
 {
-#ifdef _MSC_VER
+#ifdef NATIVE_WIN32
        /* on Windows, convert \ to  / path separators since this path
         * is added to gnuplot input */
        static char buf[sizeof(LOGOFILE)];
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -488,20 +488,16 @@ typedef size_t oid;
 
 typedef int bat;               /* Index into BBP */
 typedef void *ptr;             /* Internal coding of types */
-
-#define SIZEOF_PTR     SIZEOF_VOID_P
 typedef float flt;
 typedef double dbl;
 typedef char *str;
 
-#define SIZEOF_LNG             8
 #define LL_CONSTANT(val)       INT64_C(val)
 #define LLFMT                  "%" PRId64
 #define ULLFMT                 "%" PRIu64
 
 typedef oid var_t;             /* type used for heap index of var-sized BAT */
 #define SIZEOF_VAR_T   SIZEOF_OID
-#define VARFMT         OIDFMT
 
 #if SIZEOF_VAR_T == SIZEOF_INT
 #define VAR_MAX                ((var_t) INT_MAX)
@@ -540,7 +536,6 @@ typedef uint64_t BUN8type;
 #define BUN8_NONE ((BUN8type) UINT64_C(0xFFFFFFFFFFFFFFFF))
 #endif
 
-
 /*
  * @- Checking and Error definitions:
  */
@@ -825,8 +820,6 @@ typedef struct BATiter {
 #define timprints      T.imprints
 #define tprops         T.props
 
-
-
 /*
  * @- Heap Management
  * Heaps are the low-level entities of mass storage in
@@ -927,7 +920,6 @@ gdk_export void HEAP_free(Heap *heap, va
  * The routine BATclone creates an empty BAT storage area with the
  * properties inherited from its argument.
  */
-#define BATDELETE      (-9999)
 
 gdk_export BAT *COLnew(oid hseq, int tltype, BUN capacity, role_t role)
        __attribute__((__warn_unused_result__));
@@ -1304,7 +1296,6 @@ typedef enum {
 gdk_export gdk_return BATsetaccess(BAT *b, restrict_t mode);
 gdk_export restrict_t BATgetaccess(BAT *b);
 
-
 #define BATdirty(b)    (!(b)->batCopiedtodisk ||                       \
                         (b)->batDirtydesc ||                           \
                         (b)->theap.dirty ||                            \
@@ -1410,7 +1401,6 @@ gdk_export bool BATordered_rev(BAT *b);
 gdk_export gdk_return BATsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, 
BAT *o, BAT *g, bool reverse, bool nilslast, bool stable)
        __attribute__((__warn_unused_result__));
 
-
 gdk_export void GDKqsort(void *restrict h, void *restrict t, const void 
*restrict base, size_t n, int hs, int ts, int tpe, bool reverse, bool nilslast);
 
 #define BATtordered(b) ((b)->tsorted)
@@ -2292,7 +2282,6 @@ typedef struct threadStruct {
        uintptr_t sp;
 } ThreadRec, *Thread;
 
-
 gdk_export int THRgettid(void);
 gdk_export Thread THRget(int tid);
 gdk_export MT_Id THRcreate(void (*f) (void *), void *arg, enum MT_thr_detach 
d, const char *name);
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -23,7 +23,7 @@
 #else
 #define oidStrlen      48
 #endif
-#if SIZEOF_PTR == SIZEOF_INT
+#if SIZEOF_VOID_P == SIZEOF_INT
 #define ptrStrlen      24
 #else
 #define ptrStrlen      48
diff --git a/gdk/gdk_posix.h b/gdk/gdk_posix.h
--- a/gdk/gdk_posix.h
+++ b/gdk/gdk_posix.h
@@ -154,7 +154,7 @@ gdk_export int win_rename(const char *, 
 gdk_export int win_unlink(const char *);
 gdk_export int win_mkdir(const char *, const int mode);
 
-#define _stat64(x,y)   win_stat(x,y)
+#define _stat64                win_stat
 #define mkdir          win_mkdir
 #define rmdir          win_rmdir
 #define rename         win_rename
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -435,8 +435,6 @@ GDKinit(opt *set, int setlen)
                      "error in configure: bad value for SIZEOF_SHORT");
        static_assert(sizeof(int) == SIZEOF_INT,
                      "error in configure: bad value for SIZEOF_INT");
-       static_assert(sizeof(long) == SIZEOF_LONG,
-                     "error in configure: bad value for SIZEOF_LONG");
        static_assert(sizeof(lng) == SIZEOF_LNG,
                      "error in configure: bad value for SIZEOF_LNG");
 #ifdef HAVE_HGE
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -24,6 +24,7 @@
 #include <io.h>
 #define open _open
 #define close _close
+#define access _access
 #else
 #include <unistd.h>
 #include <dirent.h>
@@ -51,9 +52,6 @@ static int lastfile = 0;
 #ifndef F_OK
 #define F_OK 0
 #endif
-#ifdef _MSC_VER
-#define access(f, m)   _access(f, m)
-#endif
 static inline int
 fileexists(const char *path)
 {
diff --git a/monetdb5/modules/mal/wlc.h b/monetdb5/modules/mal/wlc.h
--- a/monetdb5/modules/mal/wlc.h
+++ b/monetdb5/modules/mal/wlc.h
@@ -33,8 +33,8 @@
 #ifndef F_OK
 #define F_OK 0
 #endif
-#ifdef _MSC_VER
-#define access(f, m)    _access(f, m)
+#ifdef NATIVE_WIN32
+#define access _access
 #endif
 
 mal_export MT_Lock wlc_lock;
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -268,7 +268,7 @@
 #cmakedefine SIZEOF_INT @SIZEOF_INT@
 
 /* The size of `long', as computed by sizeof. */
-#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
+#cmakedefine SIZEOF_LNG @SIZEOF_LNG@
 
 /* The size of `short', as computed by sizeof. */
 #cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@
diff --git a/sql/backends/monet5/UDF/pyapi/pytypes.c 
b/sql/backends/monet5/UDF/pyapi/pytypes.c
--- a/sql/backends/monet5/UDF/pyapi/pytypes.c
+++ b/sql/backends/monet5/UDF/pyapi/pytypes.c
@@ -152,7 +152,7 @@ int PyType_ToBat(int type)
                case NPY_INT:
                        return TYPE_int;
                case NPY_LONG:
-#if SIZEOF_LONG == 4
+#if SIZEOF_LNG == 4
                        return TYPE_int;
 #endif
                case NPY_LONGLONG:
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to