Changeset: c4ef9edc1c35 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c4ef9edc1c35
Modified Files:
        clients/odbc/driver/ODBCGlobal.h
        clients/odbc/winsetup/setup.c
Branch: default
Log Message:

Use more modern C.


diffs (46 lines):

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
@@ -70,22 +70,15 @@
 #include <ctype.h>
 
 #ifdef SQLLEN                  /* it's a define for 32, a typedef for 64 */
-#define LENFMT         "%d"
-#define ULENFMT                "%u"
-#define LENCAST                (int)
-#define ULENCAST       (unsigned int)
+#define LENFMT         "%" PRId32
+#define ULENFMT                "%" PRIu32
+#define LENCAST                (int32_t)
+#define ULENCAST       (uint32_t)
 #else
-#ifdef _MSC_VER
-#define LENFMT         "%I64d"
-#define ULENFMT                "%I64u"
-#define LENCAST                (__int64)
-#define ULENCAST       (unsigned __int64)
-#else
-#define LENFMT         "%ld"
-#define ULENFMT                "%lu"
-#define LENCAST                (long)
-#define ULENCAST       (unsigned long)
-#endif
+#define LENFMT         "%" PRId64
+#define ULENFMT                "%" PRIu64
+#define LENCAST                (int64_t)
+#define ULENCAST       (uint64_t)
 #endif
 
 /* these functions are called from within the library */
diff --git a/clients/odbc/winsetup/setup.c b/clients/odbc/winsetup/setup.c
--- a/clients/odbc/winsetup/setup.c
+++ b/clients/odbc/winsetup/setup.c
@@ -192,7 +192,7 @@ ConfigDSN(HWND parent, WORD request, LPC
        char *dsn = NULL;
        BOOL rc;
 
-       ODBCLOG("ConfigDSN %d %s %s 0x%I64x\n", request, driver ? driver : 
"(null)", attributes ? attributes : "(null)", (unsigned __int64) (uintptr_t) 
&data);
+       ODBCLOG("ConfigDSN %d %s %s 0x%" PRIxPTR "\n", request, driver ? driver 
: "(null)", attributes ? attributes : "(null)", (uintptr_t) &data);
 
        if (strcmp(driver, DriverName) != 0) {
                SQLPostInstallerError(ODBC_ERROR_INVALID_NAME,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to