Index: mapsde.c
===================================================================
--- mapsde.c	(revision 13314)
+++ mapsde.c	(working copy)
@@ -57,7 +57,7 @@
   SE_LAYERINFO layerinfo;
   SE_COORDREF coordref;
   SE_STREAM stream;
-  long state_id;
+  ms_int32 state_id;
   char *table;
   char *column;
   char *row_id_column;
@@ -71,7 +71,7 @@
 } msSDELayerInfo;
 
 typedef struct {
-  long layerId;
+  ms_int32 layerId;
   char *table;
   char *column;
   char *connection;
@@ -122,7 +122,7 @@
 static void msSDECloseConnection( void *conn_handle )
 {
 
-    long status;
+    ms_int32 status;
     msSDEConnPoolInfo *poolinfo = conn_handle;
     
     if (poolinfo) {
@@ -145,7 +145,7 @@
 /* -------------------------------------------------------------------- */
 /*     Reports more detailed error information from SDE                 */
 /* -------------------------------------------------------------------- */
-static void sde_error(long error_code, char *routine, char *sde_routine) 
+static void sde_error(ms_int32 error_code, char *routine, char *sde_routine) 
 {
   char error_string[SE_MAX_MESSAGE_LENGTH];
 
@@ -172,7 +172,7 @@
 char *msSDELayerGetRowIDColumn(layerObj *layer)
 {
 #ifdef USE_SDE
-    long status, column_type; 
+    ms_int32 status, column_type; 
     char* column_name;
     char* full_column_name;
     char* proc_key;
@@ -452,12 +452,12 @@
 
     SE_POINT *points=NULL;
     SE_ENVELOPE envelope;
-    long type, status;
-    long *part_offsets = NULL;
-    long *subpart_offsets = NULL;
-    long num_parts = -1;
-    long num_subparts = -1;
-    long num_points = -1;
+    ms_int32 type, status;
+    ms_int32 *part_offsets = NULL;
+    ms_int32 *subpart_offsets = NULL;
+    ms_int32 num_parts = -1;
+    ms_int32 num_subparts = -1;
+    ms_int32 num_points = -1;
   
     lineObj line={0,NULL};
 
@@ -509,8 +509,8 @@
         return(MS_FAILURE);
     }
      
-    part_offsets = (long *) msSmallMalloc( (num_parts + 1) * sizeof(long));
-    subpart_offsets = (long *) msSmallMalloc( (num_subparts + 1)	* sizeof(long));
+    part_offsets = (ms_int32 *) msSmallMalloc( (num_parts + 1) * sizeof(ms_int32));
+    subpart_offsets = (ms_int32 *) msSmallMalloc( (num_subparts + 1)	* sizeof(ms_int32));
     part_offsets[num_parts] = num_subparts;
     subpart_offsets[num_subparts]	= num_points;
 
@@ -582,10 +582,10 @@
 /* -------------------------------------------------------------------- */
 static int sdeGetRecord(layerObj *layer, shapeObj *shape) {
     int i;
-    long status;
+    ms_int32 status;
     
     double doubleval;
-    long longval;
+    ms_int32 longval;
     struct tm dateval;
     
     short shortval; /* new gdv */
@@ -898,7 +898,7 @@
 static SE_QUERYINFO getSDEQueryInfo(layerObj *layer) 
 {
     SE_QUERYINFO query_info;
-    long status;
+    ms_int32 status;
     
     msSDELayerInfo *sde=NULL;
     
@@ -975,13 +975,13 @@
     return query_info;
 }
 
-static SE_SQL_CONSTRUCT* getSDESQLConstructInfo(layerObj *layer, long* id) 
+static SE_SQL_CONSTRUCT* getSDESQLConstructInfo(layerObj *layer, long *id) 
 {
     SE_SQL_CONSTRUCT* sql;
 
     char *full_filter=NULL;
     char *pszId=NULL;
-    long status;
+    ms_int32 status;
     
     msSDELayerInfo *sde=NULL;
     full_filter = (char*) msSmallMalloc((1000+1)*sizeof (char));
@@ -1056,7 +1056,7 @@
 /* -------------------------------------------------------------------- */
 int msSDELayerOpen(layerObj *layer) {
 #ifdef USE_SDE
-    long status=-1;
+    ms_int32 status=-1;
     int endian_test=1;
     char **params=NULL;
     char **data_params=NULL;
@@ -1465,7 +1465,7 @@
 /* -------------------------------------------------------------------- */
 int msSDELayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) {
 #ifdef USE_SDE
-    long status;
+    ms_int32 status;
     SE_ENVELOPE envelope;
     SE_SHAPE shape=0;
     SE_FILTER constraint;
@@ -1646,7 +1646,7 @@
 /* -------------------------------------------------------------------- */
 int msSDELayerNextShape(layerObj *layer, shapeObj *shape) {
 #ifdef USE_SDE
-    long status;
+    ms_int32 status;
     
     msSDELayerInfo *sde=NULL;
 
@@ -1731,7 +1731,7 @@
 /* -------------------------------------------------------------------- */
 int msSDELayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record) {
 #ifdef USE_SDE
-    long status;
+    ms_int32 status;
 
     SE_SQL_CONSTRUCT* sql;
 
@@ -1867,7 +1867,7 @@
 
     int i,j;
 /*    short nBaseColumns, nJoinColumns; */
-    long status;
+    ms_int32 status;
 short nbasecol, njoincol;
     SE_COLUMN_DEF *all_itemdefs = NULL;
 
