1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
Description: pointer to integer assignment potentially unsafe
Similarly to the patch for tdbcpostgres.c, definitions of data type to be used
for storing pointer values are defined TDBC_PTRINT_T which is intptr_t for
platforms supporting <stdint.h>
Author: Massimo Manghi <mxmanghi@apache.org>
Bug: http://core.tcl.tk/tdbcpostgres/tktview/582ee0100ceca8d0e520339914339c8c9e75a3bf
Last-Update: 2013-08-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/generic/fakepq.h
+++ b/generic/fakepq.h
@@ -13,6 +13,18 @@
*-----------------------------------------------------------------------------
*/
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+/* we typedef TDBC_INTPTR_T */
+
+#ifdef HAVE_STDINT_H
+typedef intptr_t TDBC_INTPTR_T;
+#else
+typedef int TDBC_INTPTR_T;
+#endif
+
#ifndef FAKEPQ_H_INCLUDED
#define FAKEPQ_H_INCLUDED
@@ -31,7 +43,12 @@
PGRES_NONFATAL_ERROR=6,
PGRES_FATAL_ERROR=7,
} ExecStatusType;
+
+#ifdef HAVE_STDINT_H
+typedef TDBC_INTPTR_T Oid;
+#else
typedef unsigned int Oid;
+#endif
typedef struct pg_conn PGconn;
typedef struct pg_result PGresult;
typedef void (*PQnoticeProcessor)(void*, const PGresult*);
|