This patch fixes several misguided assumptions that sizeof(long) == 4, which is not...
authorDave Page <dpage@pgadmin.org>
Thu, 1 Jul 2004 09:20:56 +0000 (09:20 +0000)
committerDave Page <dpage@pgadmin.org>
Thu, 1 Jul 2004 09:20:56 +0000 (09:20 +0000)
connection.h
dlg_specific.c
psqlodbc.h
socket.c
statement.c
statement.h

index 5eb0023b8e36d55dae3705c25ce6453af1ed98f4..8715ac37027824a06ff826ecdeb04dece2a3b85e 100644 (file)
@@ -358,7 +358,7 @@ struct ConnectionClass_
    int         lobj_type;
    int         ntables;
    COL_INFO  **col_info;
-   long        translation_option;
+   UDWORD      translation_option;
    HINSTANCE   translation_handle;
    DataSourceToDriverProc DataSourceToDriver;
    DriverToDataSourceProc DriverToDataSource;
index 08451619439aaf0643cdd8309e5bb356b458520c..fa65f84d2b6f7cf956e2333e8f08c2eb38099f65 100644 (file)
@@ -127,7 +127,7 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len)
    /* Abbrebiation is needed ? */
    if (abbrev || strlen(connect_string) >= len)
    {
-       unsigned long flag = 0;
+       UInt4 flag = 0;
        if (ci->disallow_premature)
            flag |= BIT_DISALLOWPREMATURE;
        if (ci->allow_keyset)
@@ -209,7 +209,7 @@ static void
 unfoldCXAttribute(ConnInfo *ci, const char *value)
 {
    int     count;
-   unsigned long   flag;
+   UInt4       flag;
 
    if (strlen(value) < 2)
    {
index 05d3011d24f11b87f1cf7119c88eadf94d544c30..1424e13d38c98d7b904ff08e229ffdd3ce1ca301 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Comments:       See "notice.txt" for copyright and license information.
  *
- * $Id: psqlodbc.h,v 1.82 2004/02/04 08:55:28 dpage Exp $
+ * $Id: psqlodbc.h,v 1.83 2004/07/01 09:20:56 dpage Exp $
  *
  */
 
 #include "gpps.h"
 #endif
 
+
 #ifndef WIN32
-#define Int4 long int
-#define UInt4 unsigned int
-#define Int2 short
-#define UInt2 unsigned short
 
-#if !defined(WITH_UNIXODBC) && !defined(WITH_IODBC)
+# if defined(HAVE_INTTYPES_H)
+#  include <inttypes.h>
+# else
+#  if defined(HAVE_STDINT_H)
+#   include <stdint.h>
+#  endif
+# endif
+
+# define Int4 int32_t
+# define UInt4 uint32_t
+# define Int2 int16_t
+# define UInt2 uint16_t
+
+# if !defined(WITH_UNIXODBC) && !defined(WITH_IODBC)
 typedef float SFLOAT;
 typedef double SDOUBLE;
-#endif
+# endif
 
-#ifndef CALLBACK
-#define CALLBACK
-#endif
+# ifndef CALLBACK
+#  define CALLBACK
+# endif
+
+#else /* WIN32 */
+
+# define Int4 int
+# define UInt4 unsigned int
+# define Int2 short
+# define UInt2 unsigned short
 
-#else
-#define Int4 int
-#define UInt4 unsigned int
-#define Int2 short
-#define UInt2 unsigned short
 #endif
 
+
 typedef UInt4 Oid;
 
 #ifndef WIN32
index 1c3801d24bfa0be52ba81e991ca04e734ac9c28d..e3958827210d9df9c6f1a3515b91a5fd7a5f0ce7 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -125,7 +125,11 @@ SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname)
    struct sockaddr_un *un;
 #endif /* HAVE_UNIX_SOCKETS */
    int family, sLen; 
-   unsigned long iaddr;
+#ifdef WIN32
+        UInt4 iaddr;
+#else
+   in_addr_t iaddr;
+#endif
 
    if (self->socket != -1)
    {
index ebb47dbc0703cd13b5ba1051727ac128d9015314..d50937f20b71e80ec80974896d52dd07f3ea2328 100644 (file)
@@ -853,7 +853,7 @@ SC_get_time(StatementClass *stmt)
  * just the current row number.  But it could be more sophisticated
  * someday, such as mapping a key to a 32 bit value
  */
-unsigned long
+UInt4
 SC_get_bookmark(StatementClass *self)
 {
    return (self->currTuple + 1);
index 39b9d9ff9f8aba744a538a2a970ec81db99e337b..687da411d7e37081ff2cc59da49de0fbdc4d30c0 100644 (file)
@@ -339,7 +339,7 @@ RETCODE     SC_fetch(StatementClass *self);
 void       SC_free_params(StatementClass *self, char option);
 void       SC_log_error(const char *func, const char *desc, const StatementClass *self);
 time_t     SC_get_time(StatementClass *self);
-unsigned long SC_get_bookmark(StatementClass *self);
+UInt4      SC_get_bookmark(StatementClass *self);
 RETCODE        SC_pos_update(StatementClass *self, UWORD irow, UDWORD index);
 RETCODE        SC_pos_delete(StatementClass *self, UWORD irow, UDWORD index);
 RETCODE        SC_pos_refresh(StatementClass *self, UWORD irow, UDWORD index);