Author: Alastair McKinstry <mckinstry@debian.org>
Description: Add int -> hid_t (int64_t) changes needed for HDF5 1.10.1
Last-Updated: 2018-01-21
Forwarded: no

--- a/src/EHapi.c
+++ b/src/EHapi.c
@@ -1,4 +1,4 @@
-/*
+/* 
  ----------------------------------------------------------------------------
  |    Copyright (C) 1999 Emergent IT Inc. and Raytheon Systems Company      |
  |                                                                          |
@@ -326,6 +326,8 @@
 	outvalue = HE5_EHint2long(invalue);
   else if (sizeof(hid_t) == sizeof(long))
 	outvalue = invalue;
+  else if (sizeof(hid_t) == sizeof(long long))
+        outvalue = HE5_EHllong2long(invalue);
 
   return(outvalue);
 }
@@ -411,6 +413,8 @@
 	outvalue = invalue;
   else if (sizeof(hid_t) == sizeof(long))
 	outvalue = HE5_EHlong2int(invalue);
+  else if (sizeof(hid_t) == sizeof(long long))
+	outvalue = HE5_EHlong2int(invalue);
 
   return(outvalue);
 }
@@ -448,6 +452,8 @@
 	outvalue = invalue;
   else if (sizeof(hid_t) == sizeof(long))
 	outvalue = HE5_EHint2long(invalue);
+  else if (sizeof(hid_t) == sizeof(long long))
+	outvalue = HE5_EHint2long(invalue);
 
   return(outvalue);
 }
@@ -486,6 +492,8 @@
 	outvalue = HE5_EHlong2int(invalue);
   else if (sizeof(hid_t) == sizeof(long))
 	outvalue = invalue;
+  else if (sizeof(hid_t) == sizeof(long long))
+	outvalue = invalue;
 
   return(outvalue);
 }
@@ -577,6 +585,8 @@
 	outvalue = HE5_EHint2hsize(invalue);
   else if (sizeof(hid_t) == sizeof(long) )
 	outvalue = HE5_EHlong2hsize(invalue);
+  else if (sizeof(hid_t) == sizeof(long long))
+	outvalue = HE5_EHllong2hsize(invalue);
 
   return(outvalue);
 }
@@ -729,6 +739,8 @@
 	outvalue = HE5_EHhsize2int(invalue);
   else if (sizeof(hid_t) == sizeof(long) )
 	outvalue = HE5_EHhsize2long(invalue);
+  else if (sizeof(hid_t) == sizeof(long long))
+	outvalue = HE5_EHhsize2llong(invalue);
 
   return(outvalue);
 }
@@ -878,6 +890,8 @@
 	outvalue = HE5_EHint2hssize(invalue);
   else if (sizeof(hid_t) == sizeof(long) )
 	outvalue = HE5_EHlong2hssize(invalue);
+  else if (sizeof(hid_t) == sizeof(long long))
+	outvalue = HE5_EHllong2hssize(invalue);
 
   return(outvalue);
 }
@@ -1360,6 +1374,178 @@
   return(outvalue);
 }
 
+long long 
+HE5_EHint2llong(int invalue)
+{
+  herr_t        status   = FAIL;
+  long long     outvalue = FAIL;
+  long long     buf      = FAIL;
+
+
+  memmove(&buf,&invalue,sizeof(int));
+
+  status = H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_LLONG, 1, &buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHint2llong", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"int\" to \"long long\" data type.");
+	  return(status);
+	}
+ 
+  memmove(&outvalue,&buf,sizeof(long long));
+
+  return(outvalue);
+}
+long long 
+HE5_EHlong2llong(long invalue)
+{
+  herr_t        status   = FAIL;
+  long long     outvalue = FAIL;
+  long long     buf      = FAIL;
+
+
+  memmove(&buf,&invalue,sizeof(long));
+
+  status = H5Tconvert(H5T_NATIVE_LONG, H5T_NATIVE_LLONG, 1, &buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHlong2llong", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"long\" to \"long long\" data type.");
+	  return(status);
+	}
+ 
+  memmove(&outvalue,&buf,sizeof(long long));
+
+  return(outvalue);
+}
+long long 
+HE5_EHhsize2llong(hsize_t invalue)
+{
+  herr_t        status   = FAIL;
+  long long     outvalue = FAIL;
+  long long     buf      = FAIL;
+
+
+  memmove(&buf,&invalue,H5Tget_size(H5T_NATIVE_HSIZE));
+
+  status = H5Tconvert(H5T_NATIVE_HSIZE, H5T_NATIVE_LLONG, 1, &buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHhsize2llong", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"hsize_t\" to \"long long\" data type.");
+	  return(status);
+	}
+ 
+  memmove(&outvalue,&buf,sizeof(long long));
+
+  return(outvalue);
+}
+long long 
+HE5_EHhssize2llong(hssize_t invalue)
+{
+  herr_t        status   = FAIL;
+  long long     outvalue = FAIL;
+  long long     buf      = FAIL;
+
+
+  memmove(&buf,&invalue,H5Tget_size(H5T_NATIVE_HSSIZE));
+
+  status = H5Tconvert(H5T_NATIVE_HSSIZE, H5T_NATIVE_LLONG, 1, &buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHhssize2llong", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"hssize_t\" to \"long long\" data type.");
+	  return(status);
+	}
+ 
+  memmove(&outvalue,&buf,sizeof(long long));
+
+  return(outvalue);
+}
+int 
+HE5_EHllong2int(long long invalue)
+{
+  herr_t                  status   = FAIL;
+  int                     outvalue = FAIL;
+  long long               *buf     = (long long *)NULL;
+
+  buf = (long long *)calloc(1,sizeof(long long));
+  memmove(buf,&invalue,sizeof(long long));
+				 
+  status = H5Tconvert(H5T_NATIVE_LLONG, H5T_NATIVE_INT, 1, buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHllong2int", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"long long\" to \"int\" data type.");
+	  return(status);
+	}
+				 
+  memmove(&outvalue,buf,sizeof(int));
+  free(buf);
+	  
+  return(outvalue);
+}
+long 
+HE5_EHllong2long(long long invalue)
+{
+  herr_t                  status   = FAIL;
+  long                    outvalue = FAIL;
+  long long               *buf     = (long long *)NULL;
+
+  buf = (long long *)calloc(1,sizeof(long long));
+  memmove(buf,&invalue,sizeof(long long));
+				 
+  status = H5Tconvert(H5T_NATIVE_LLONG, H5T_NATIVE_LONG, 1, buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHllong2long", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"long long\" to \"long\" data type.");
+	  return(status);
+	}
+				 
+  memmove(&outvalue,buf,sizeof(long));
+  free(buf);
+	  
+  return(outvalue);
+}
+hsize_t 
+HE5_EHllong2hsize(long long invalue)
+{
+  herr_t                  status   = FAIL;
+  hsize_t                 outvalue = FAIL;
+  long long               *buf     = (long long *)NULL;
+
+  buf = (long long *)calloc(1,sizeof(long long));
+  memmove(buf,&invalue,sizeof(long long));
+				 
+  status = H5Tconvert(H5T_NATIVE_LLONG, H5T_NATIVE_HSIZE, 1, buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHllong2hsize", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"long long\" to \"hsize_t\" data type.");
+	  return(status);
+	}
+				 
+  memmove(&outvalue,buf,H5Tget_size(H5T_NATIVE_HSIZE));
+  free(buf);
+	  
+  return(outvalue);
+}
+hssize_t 
+HE5_EHllong2hssize(long long invalue)
+{
+  herr_t                  status   = FAIL;
+  hssize_t                outvalue = FAIL;
+  long long               *buf     = (long long *)NULL;
+
+  buf = (long long *)calloc(1,sizeof(long long));
+  memmove(buf,&invalue,sizeof(long long));
+				 
+  status = H5Tconvert(H5T_NATIVE_LLONG, H5T_NATIVE_HSSIZE, 1, buf, NULL, H5P_DEFAULT);
+  if (status == FAIL)
+	{
+	  H5Epush(__FILE__, "HE5_EHllong2hssize", __LINE__, H5E_FUNC, H5E_CANTINIT, "Cannot convert \"long long\" to \"hssize_t\" data type.");
+	  return(status);
+	}
+				 
+  memmove(&outvalue,buf,H5Tget_size(H5T_NATIVE_HSSIZE));
+  free(buf);
+	  
+  return(outvalue);
+}
 
 /*----------------------------------------------------------------------------|
 |  BEGIN_PROLOG                                                               |
@@ -2224,7 +2410,7 @@
   if (fid < HE5_EHIDOFFSET || fid > HE5_NEOSHDF + HE5_EHIDOFFSET)
     {
 	  status = FAIL;
-	  sprintf(errbuf,"Invalid file ID: %d. ID should range from %d to  %d .\n", fid, HE5_EHIDOFFSET, HE5_NEOSHDF + HE5_EHIDOFFSET);
+	  sprintf(errbuf,"Invalid file ID: %ld. ID should range from %d to  %d .\n", (long int) fid, HE5_EHIDOFFSET, HE5_NEOSHDF + HE5_EHIDOFFSET);
 	  H5Epush(__FILE__, "HE5_EHchkfid", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
     }
@@ -2236,7 +2422,7 @@
 	  if( HE5_HeosTable[ fid0 ].active == 0)
         {
 		  status = FAIL;
-		  sprintf(errbuf,"HE5_EHchkid: File ID %d not active (%s).\n",fid, name);
+		  sprintf(errbuf,"HE5_EHchkid: File ID %ld not active (%s).\n",(long int) fid, name);
 		  H5Epush(__FILE__, "HE5_EHchkfid", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 		  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -8617,7 +8803,7 @@
   else
     {
       status = FAIL;
-      sprintf(errbuf,"Invalid file ID: %d . ID should range from %d to %d . \n", fid, HE5_EHIDOFFSET, HE5_NEOSHDF + HE5_EHIDOFFSET);
+      sprintf(errbuf,"Invalid file ID: %ld . ID should range from %d to %d . \n", (long int) fid, HE5_EHIDOFFSET, HE5_NEOSHDF + HE5_EHIDOFFSET);
       H5Epush(__FILE__,  "HE5_EHclose", __LINE__, H5E_FILE, H5E_BADFILE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
     }
@@ -12025,7 +12211,7 @@
   if( HE5_HeosTable[ fid0 ].active == 0)
     {
       status = FAIL;
-      sprintf(errbuf,"HE5_EHwritemeta: File ID %d not active \n",fid);
+      sprintf(errbuf,"HE5_EHwritemeta: File ID %ld not active \n",(long int) fid);
       H5Epush(__FILE__, "HE5_EHwritemeta", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
     }
@@ -12297,7 +12483,7 @@
   if( HE5_HeosTable[ fid0 ].active == 0)
     {
       status = FAIL;
-      sprintf(errbuf,"HE5_EHreadmeta: File ID %d not active \n",fid);
+      sprintf(errbuf,"HE5_EHreadmeta: File ID %ld not active \n",(long int) fid);
       H5Epush(__FILE__, "HE5_EHreadmeta", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
     }
@@ -12607,7 +12793,7 @@
   if( HE5_HeosTable[ fid0 ].active == 0)
     {
       status = FAIL;
-      sprintf(errbuf,"HE5_EHreadmeta: File ID %d not active \n",fid);
+      sprintf(errbuf,"HE5_EHreadmeta: File ID %ld not active \n",(long int) fid);
       H5Epush(__FILE__, "HE5_EHreadmeta", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
     }
--- a/include/HE5_HdfEosDef.h
+++ b/include/HE5_HdfEosDef.h
@@ -570,6 +570,15 @@
 int                  HE5_EHhssize2int(hssize_t invalue);
 hsize_t              HE5_EHhssize2hsize(hssize_t invalue);
 
+long long            HE5_EHint2llong(int invalue);
+long long            HE5_EHlong2llong(long invalue);
+long long            HE5_EHhsize2llong(hsize_t invalue);
+long long            HE5_EHhssize2llong(hssize_t invalue);
+int                  HE5_EHllong2int(long long invalue);
+long                 HE5_EHllong2long(long long invalue);
+hsize_t              HE5_EHllong2hsize(long long invalue);
+hssize_t             HE5_EHllong2hssize(long long invalue);
+
 unsigned LONGLONG    HE5_EHint2ullong(int invalue);
 long                 HE5_EHullong2long(unsigned LONGLONG invalue);
 
--- a/src/PTapi.c
+++ b/src/PTapi.c
@@ -106,88 +106,88 @@
 int
 HE5_PTopenF(char *filename, uintn Flags);
 int
-HE5_PTcreateF(int FileID, char *pointname);
+HE5_PTcreateF(hid_t FileID, char *pointname);
 int
-HE5_PTattachF(int FileID, char *pointname);
+HE5_PTattachF(hid_t FileID, char *pointname);
 int
-HE5_PTdetachF(int pointID);
+HE5_PTdetachF(hid_t pointID);
 int
-HE5_PTcloseF(int FileID);
+HE5_PTcloseF(hid_t FileID);
 
 /* Definition routines */
 
 int
-HE5_PTdeflevelF(int  pointID, const char *levelname, int rank[], char *fieldlist, long *dim_sizes, int dtype[], int array[]);
+HE5_PTdeflevelF(hid_t  pointID, const char *levelname, int rank[], char *fieldlist, long *dim_sizes, int dtype[], int array[]);
 int
-HE5_PTdeflinkageF(int pointID, char *parent, char *child, char *linkfield);
+HE5_PTdeflinkageF(hid_t pointID, char *parent, char *child, char *linkfield);
 
 /* I/O routines */
 
 int
-HE5_PTreadlevelF(int pointID, int level, char *fieldname, int ntype, void *datbuf);
+HE5_PTreadlevelF(hid_t pointID, int level, char *fieldname, int ntype, void *datbuf);
 int
-HE5_PTupdatelevelF(int pointID, int level, char *fieldlist, long nrec,  long recs[], int ntype, void *data);
+HE5_PTupdatelevelF(hid_t pointID, int level, char *fieldlist, long nrec,  long recs[], int ntype, void *data);
 int
-HE5_PTwritelevelF(int pointID, int level, long count[], char *fieldname, int ntype, void *data);
+HE5_PTwritelevelF(hid_t pointID, int level, long count[], char *fieldname, int ntype, void *data);
 int
-HE5_PTwriteattrF(int pointID, const char *attrname, int ntype, long fortcount[], void *datbuf);
+HE5_PTwriteattrF(hid_t pointID, const char *attrname, int ntype, long fortcount[], void *datbuf);
 int
-HE5_PTwritegrpattrF(int pointID, const char *attrname, int ntype, long fortcount[], void * datbuf);
+HE5_PTwritegrpattrF(hid_t pointID, const char *attrname, int ntype, long fortcount[], void * datbuf);
 int
-HE5_PTwritelocattrF(int pointID, const char *levelname, const char *attrname, int ntype, long count[],void * datbuf);
+HE5_PTwritelocattrF(hid_t pointID, const char *levelname, const char *attrname, int ntype, long count[],void * datbuf);
 int
-HE5_PTreadattrF(int pointID, const char *attrname, void *datbuf);
+HE5_PTreadattrF(hid_t pointID, const char *attrname, void *datbuf);
 int
-HE5_PTreadgrpattrF(int pointID, const char *attrname, void *datbuf);
+HE5_PTreadgrpattrF(hid_t pointID, const char *attrname, void *datbuf);
 int
-HE5_PTreadlocattrF(int pointID, const char *levelname, const char *attrname, void *datbuf);
+HE5_PTreadlocattrF(hid_t pointID, const char *levelname, const char *attrname, void *datbuf);
 int
-HE5_PTwrbckptrF(int pointID, int level);
+HE5_PTwrbckptrF(hid_t pointID, int level);
 int
-HE5_PTwrfwdptrF(int pointID, int level);
+HE5_PTwrfwdptrF(hid_t pointID, int level);
 
 /* Inquiry routines */
 
 int
-HE5_PTnrecsF(int pointID, int level);
+HE5_PTnrecsF(hid_t pointID, int level);
 int
 HE5_PTnlevelsF(hid_t pointID);
 int
-HE5_PTnfieldsF(int pointID, int level, char *fieldlist, long *strbufsize);
+HE5_PTnfieldsF(hid_t pointID, int level, char *fieldlist, long *strbufsize);
 int
-HE5_PTlevelindxF(int pointID, const char *levelname);
+HE5_PTlevelindxF(hid_t pointID, const char *levelname);
 int
-HE5_PTgetlevelnameF(int pointID, int  level, char *levelname, long *strbufsize);
+HE5_PTgetlevelnameF(hid_t pointID, int  level, char *levelname, long *strbufsize);
 int
-HE5_PTbcklinkinfoF(int pointID, int level, char *linkfield);
+HE5_PTbcklinkinfoF(hid_t pointID, int level, char *linkfield);
 int
-HE5_PTfwdlinkinfoF(int pointID, int level, char *linkfield);
+HE5_PTfwdlinkinfoF(hid_t pointID, int level, char *linkfield);
 int
-HE5_PTlevelinfoF(int pointID, int level, char *levelname, int rank[], char *fieldlist, long *dim_sizes, long *datasize, long offset[], int dtype[]);
+HE5_PTlevelinfoF(hid_t pointID, int level, char *levelname, int rank[], char *fieldlist, long *dim_sizes, long *datasize, long offset[], int dtype[]);
 int
-HE5_PTinqdatatypeF(int pointID, char *fieldname, char *attrname, int fieldgroup, int *Type, int *Class, int *Order, long *size);
+HE5_PTinqdatatypeF(hid_t pointID, char *fieldname, char *attrname, int fieldgroup, int *Type, int *Class, int *Order, long *size);
 int
 HE5_PTinqpointF(const char *filename, char *pointlist, long *strbufsize);
 int
-HE5_PTattrinfoF(int pointID, const char *attrname, int *numbertype, long *fortcount);
+HE5_PTattrinfoF(hid_t pointID, const char *attrname, int *numbertype, long *fortcount);
 int
-HE5_PTgrpattrinfoF(int pointID, const char *attrname, int *numbertype, long *fortcount);
+HE5_PTgrpattrinfoF(hid_t pointID, const char *attrname, int *numbertype, long *fortcount);
 int
-HE5_PTlocattrinfoF(int pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount);
+HE5_PTlocattrinfoF(hid_t pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount);
 int
-HE5_PTattrinfoF2(int pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize);
+HE5_PTattrinfoF2(hid_t pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize);
 int
-HE5_PTgrpattrinfoF2(int pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize);
+HE5_PTgrpattrinfoF2(hid_t pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize);
 int
-HE5_PTlocattrinfoF2(int pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount, long *fortsize);
+HE5_PTlocattrinfoF2(hid_t pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount, long *fortsize);
 long
-HE5_PTinqattrsF(int pointID, char *attrnames, long *strbufsize);
+HE5_PTinqattrsF(hid_t pointID, char *attrnames, long *strbufsize);
 long
-HE5_PTinqgrpattrsF(int pointID, char *attrnames, long *strbufsize);
+HE5_PTinqgrpattrsF(hid_t pointID, char *attrnames, long *strbufsize);
 long
-HE5_PTinqlocattrsF(int pointID, const char *levelname, char *attrnames, long *strbufsize);
+HE5_PTinqlocattrsF(hid_t pointID, const char *levelname, char *attrnames, long *strbufsize);
 int
-HE5_PTnumtypeinfoF(int pointID, int level, int numtype[]);
+HE5_PTnumtypeinfoF(hid_t pointID, int level, int numtype[]);
 
 
 /* Fortran Wrapper Utility Routines  */
@@ -632,7 +632,7 @@
 /*----------------------------------------------------------------------------|
 |  BEGIN_PROLOG                                                               |
 |                                                                             |
-|  FUNCTION: HE5_PTattach                                                     |
+|  FUNCTION: HE5_PTattach                                                    |
 |                                                                             |
 |  DESCRIPTION: Attaches to an existing point data set.                       |
 |                                                                             |
@@ -823,7 +823,7 @@
 	      status = HE5_PTgetlevelname_fromSM(pointID, i, LevelName);
 	      if ( status == FAIL )
 		{
-		  sprintf(errbuf, "Failed to get LevelName for the Level_%d.",i) ;
+		  sprintf(errbuf, "Failed to get LevelName for the Level_%ld.", (long int) i) ;
 		  H5Epush(__FILE__, "HE5_PTattach", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 		  HE5_EHprint(errbuf, __FILE__, __LINE__);
 
@@ -1190,7 +1190,7 @@
   nlevels = HE5_PTnlevels(pointID);
   if (nlevels == 0)
     {
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTnrecs", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(0);
@@ -1199,7 +1199,7 @@
     {
       /* Report error if level # to large */
       /* -------------------------------- */
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels,(long int)  pointID);
       H5Epush(__FILE__, "HE5_PTnrecs", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(0);
@@ -1656,7 +1656,7 @@
   if (nlevels == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTnfields", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -1666,7 +1666,7 @@
       /* Report error if level # too large */
       /* --------------------------------- */
       status = FAIL;
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels,(long int)  pointID);
       H5Epush(__FILE__, "HE5_PTnfields", __LINE__, H5E_ARGS, H5E_BADRANGE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -1838,7 +1838,7 @@
       if (nlevels == 0)
 	{
 	  status = FAIL;
-	  sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+	  sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
 	  H5Epush(__FILE__, "HE5_PTgetlevelname", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
 
@@ -1848,7 +1848,7 @@
 	  /* Report error if level # to large */
 	  /* -------------------------------- */
 	  status = FAIL;
-	  sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+	  sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels, (long int) pointID);
 	  H5Epush(__FILE__, "HE5_PTgetlevelname", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
 	}
@@ -3043,7 +3043,7 @@
   if (nlevels == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTwritelevel",   __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -3053,7 +3053,7 @@
       /* Report error if level # to large */
       /* -------------------------------- */
       status = FAIL;
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels,(long int)  pointID);
       H5Epush(__FILE__, "HE5_PTwritelevel", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -3482,7 +3482,7 @@
   nlevels = HE5_PTnlevels(pointID);
   if (nlevels == 0)
     {
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTlevelinfo", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(FAIL);
@@ -3491,7 +3491,7 @@
     {
       /* Report error if level # to large */
       /* -------------------------------- */
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels,(long int)  pointID);
       H5Epush(__FILE__, "HE5_PTlevelinfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(FAIL);
@@ -3909,7 +3909,7 @@
   if (nlevels == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTreadlevel", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -3919,7 +3919,7 @@
       /* Report error if level # to large */
       /* -------------------------------- */
       status = FAIL;
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels, (long int) pointID);
       H5Epush(__FILE__, "HE5_PTreadlevel", __LINE__, H5E_FILE, H5E_SEEKERROR, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -8309,7 +8309,7 @@
 {
   hid_t     fid     = FAIL;/* hdf5 type file ID     */
 
-  int       FileID  = FAIL;/* Return file ID        */
+  hid_t     FileID  = FAIL;/* Return file ID        */
 
   uintn     flags   = 9999;/* HDF5 file access code */
 
@@ -8389,7 +8389,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTcreateF(int FileID, char *pointname)
+HE5_PTcreateF(hid_t FileID, char *pointname)
 {
   int             PointID   = FAIL;/* point ID (return value)             */
 
@@ -8457,7 +8457,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTattachF(int FileID, char *pointname)
+HE5_PTattachF(hid_t FileID, char *pointname)
 {
   int             PointID  = FAIL;	/* Return value of the Point ID    */
 
@@ -8529,7 +8529,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTdetachF(int  PointID)
+HE5_PTdetachF(hid_t  PointID)
 {
   int             ret    = FAIL;/* (int) Return status variable   */
 
@@ -8599,7 +8599,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTcloseF(int FileID)
+HE5_PTcloseF(hid_t FileID)
 {
   int               ret    = FAIL;/* (int) return status variable   */
 
@@ -8682,7 +8682,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTdeflevelF(int  pointID, const char *levelname, int rank[], char *fieldlist, long *dim_sizes, int dtype[], int array[])
+HE5_PTdeflevelF(hid_t  pointID, const char *levelname, int rank[], char *fieldlist, long *dim_sizes, int dtype[], int array[])
 {
   herr_t            status    = FAIL;/* routine return status variable */
 
@@ -8879,7 +8879,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTdeflinkageF(int pointID, char *parent, char *child, char *linkfield)
+HE5_PTdeflinkageF(hid_t pointID, char *parent, char *child, char *linkfield)
 {
   int       ret     = FAIL;/* (int) Return status variable   */
 
@@ -8956,7 +8956,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTreadlevelF(int pointID, int level, char *fieldname, int ntype, void *datbuf)
+HE5_PTreadlevelF(hid_t pointID, int level, char *fieldname, int ntype, void *datbuf)
 {
   int            ret     = FAIL;/* (int) return status variable   */
 
@@ -9093,7 +9093,7 @@
   if (nlevels == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTreadlevel_f", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -9103,7 +9103,7 @@
       /* Report error if level # to large */
       /* -------------------------------- */
       status = FAIL;
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels, (long int) pointID);
       H5Epush(__FILE__, "HE5_PTreadlevel_f", __LINE__, H5E_FILE, H5E_SEEKERROR, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -9345,7 +9345,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTwritelevelF(int pointID, int level, long count[], char *fieldname, int ntype, void *data)
+HE5_PTwritelevelF(hid_t pointID, int level, long count[], char *fieldname, int ntype, void *data)
 {
   herr_t            status = FAIL;/* routine return status variable */
 
@@ -9507,7 +9507,7 @@
   if (nlevels == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "No Levels Defined for point ID: %d\n", pointID);
+      sprintf(errbuf, "No Levels Defined for point ID: %ld\n", (long int) pointID);
       H5Epush(__FILE__, "HE5_PTwritelevel_f", __LINE__, H5E_BTREE, H5E_NOTFOUND, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -9517,7 +9517,7 @@
       /* Report error if level # to large */
       /* -------------------------------- */
       status = FAIL;
-      sprintf(errbuf, "Only %d levels Defined for point ID: %d\n", nlevels, pointID);
+      sprintf(errbuf, "Only %d levels Defined for point ID: %ld\n", nlevels, (long int) pointID);
       H5Epush(__FILE__, "HE5_PTwritelevel_f", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -9816,7 +9816,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTwrbckptrF(int pointID, int level)
+HE5_PTwrbckptrF(hid_t pointID, int level)
 {
   int             ret    = FAIL;/* (int) Return status variable   */
 
@@ -9885,7 +9885,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTwrfwdptrF(int pointID, int level)
+HE5_PTwrfwdptrF(hid_t pointID, int level)
 {
   int             ret    = FAIL;/* (int) Return status variable   */
 
@@ -9958,7 +9958,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTupdatelevelF(int pointID, int level, char *fieldlist, long nrec,  long recs[], int ntype, void *data)
+HE5_PTupdatelevelF(hid_t pointID, int level, char *fieldlist, long nrec,  long recs[], int ntype, void *data)
 {
   herr_t            status  = FAIL;
 
@@ -10696,7 +10696,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTwriteattrF(int pointID, const char *attrname, int ntype, long fortcount[], void *datbuf)
+HE5_PTwriteattrF(hid_t pointID, const char *attrname, int ntype, long fortcount[], void *datbuf)
 {
 
   int       ret     = FAIL;/* int return status variable                 */
@@ -10854,7 +10854,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTwritegrpattrF(int pointID, const char *attrname, int ntype, long fortcount[], void * datbuf)
+HE5_PTwritegrpattrF(hid_t pointID, const char *attrname, int ntype, long fortcount[], void * datbuf)
 {
   int          ret        = FAIL;        /* (int) return status variable      */
   int	       rank       = 1;           /* Rank variable                     */
@@ -11009,7 +11009,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTwritelocattrF(int pointID, const char *levelname, const char *attrname, int ntype, long fortcount[],void * datbuf)
+HE5_PTwritelocattrF(hid_t pointID, const char *levelname, const char *attrname, int ntype, long fortcount[],void * datbuf)
 {
   int	       ret  = FAIL;             /* routine return status variable             */
   int 	       rank = 1;                /* Note: It is assumed that fortcout has just */
@@ -11163,7 +11163,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTreadattrF(int pointID, const char *attrname, void *datbuf)
+HE5_PTreadattrF(hid_t pointID, const char *attrname, void *datbuf)
 {
   int         ret     = FAIL;/* routine return status variable  */
 
@@ -11219,7 +11219,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTreadgrpattrF(int pointID, const char *attrname, void *datbuf)
+HE5_PTreadgrpattrF(hid_t pointID, const char *attrname, void *datbuf)
 {
   int         ret             = FAIL;   /* (int) return status      */
 
@@ -11274,7 +11274,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTreadlocattrF(int pointID, const char *levelname, const char *attrname, void *datbuf)
+HE5_PTreadlocattrF(hid_t pointID, const char *levelname, const char *attrname, void *datbuf)
 {
   int         ret             =  FAIL;/* return status variable   */
 
@@ -11984,7 +11984,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTnrecsF(int pointID, int level)
+HE5_PTnrecsF(hid_t pointID, int level)
 {
   hid_t           PointID = FAIL;/* HDF5 type point ID            */
 
@@ -12109,7 +12109,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTnfieldsF(int pointID, int level, char *fieldlist, long *strbufsize)
+HE5_PTnfieldsF(hid_t pointID, int level, char *fieldlist, long *strbufsize)
 {
   hid_t           PointID  = FAIL;/* HDF5 type point ID            */
 
@@ -12174,7 +12174,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTlevelindxF(int pointID, const char *levelname)
+HE5_PTlevelindxF(hid_t pointID, const char *levelname)
 {
   hid_t           PointID = FAIL;/* HDF5 type point ID            */
 
@@ -12240,7 +12240,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTgetlevelnameF(int pointID, int  level, char *levelname, long *strbufsize)
+HE5_PTgetlevelnameF(hid_t pointID, int  level, char *levelname, long *strbufsize)
 {
   int             ret     = FAIL;
 
@@ -12310,7 +12310,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTbcklinkinfoF(int pointID, int level, char *linkfield)
+HE5_PTbcklinkinfoF(hid_t pointID, int level, char *linkfield)
 {
   int             ret     = FAIL;
 
@@ -12378,7 +12378,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTfwdlinkinfoF(int pointID, int level, char *linkfield)
+HE5_PTfwdlinkinfoF(hid_t pointID, int level, char *linkfield)
 {
   int             ret     = FAIL;
 
@@ -12455,7 +12455,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTlevelinfoF(int pointID, int level, char *levelname, int rank[], char *fieldlist, long *dim_sizes, long *datasize, long offset[], int dtype[])
+HE5_PTlevelinfoF(hid_t pointID, int level, char *levelname, int rank[], char *fieldlist, long *dim_sizes, long *datasize, long offset[], int dtype[])
 {
   herr_t            status = FAIL;/* routine return status variable */
 
@@ -12581,7 +12581,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTinqdatatypeF(int pointID, char *fieldname, char *attrname, int fieldgroup, int *Type, int *Class, int *Order, long *size)
+HE5_PTinqdatatypeF(hid_t pointID, char *fieldname, char *attrname, int fieldgroup, int *Type, int *Class, int *Order, long *size)
 {
   int	       ret      = FAIL;               /* (int) status variable  */
 
@@ -12770,7 +12770,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTattrinfoF(int pointID, const char *attrname, int *numbertype, long *fortcount)
+HE5_PTattrinfoF(hid_t pointID, const char *attrname, int *numbertype, long *fortcount)
 {
   int          ret      = FAIL;               /* (int) return status variable  */
 
@@ -12870,7 +12870,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTattrinfoF2(int pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize)
+HE5_PTattrinfoF2(hid_t pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize)
 {
   int          ret      = FAIL;               /* (int) return status variable  */
 
@@ -12985,7 +12985,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTgrpattrinfoF(int pointID, const char *attrname, int *numbertype, long *fortcount)
+HE5_PTgrpattrinfoF(hid_t pointID, const char *attrname, int *numbertype, long *fortcount)
 {
   int	      ret     = FAIL;	        /* (int) return status variable   */
 
@@ -13087,7 +13087,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTgrpattrinfoF2(int pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize)
+HE5_PTgrpattrinfoF2(hid_t pointID, const char *attrname, int *numbertype, long *fortcount, long *fortsize)
 {
   int	      ret     = FAIL;	        /* (int) return status variable   */
 
@@ -13201,7 +13201,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTlocattrinfoF(int pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount)
+HE5_PTlocattrinfoF(hid_t pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount)
 {
   int	      ret     = FAIL;	        /* (int) return status variable   */
 
@@ -13304,7 +13304,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTlocattrinfoF2(int pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount, long *fortsize)
+HE5_PTlocattrinfoF2(hid_t pointID, const char *levelname, const char *attrname, int *numbertype, long *fortcount, long *fortsize)
 {
   int	      ret     = FAIL;	        /* (int) return status variable   */
 
@@ -13419,7 +13419,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 long
-HE5_PTinqattrsF(int pointID, char *attrnames, long *strbufsize)
+HE5_PTinqattrsF(hid_t pointID, char *attrnames, long *strbufsize)
 {
   long            nattr    = FAIL;/* Number of attributes (return)  */
 
@@ -13493,7 +13493,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 long
-HE5_PTinqgrpattrsF(int pointID, char *attrnames, long *strbufsize)
+HE5_PTinqgrpattrsF(hid_t pointID, char *attrnames, long *strbufsize)
 {
   long            nattr   = FAIL;         /* Number of attributes (return)  */
 
@@ -13564,7 +13564,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 long
-HE5_PTinqlocattrsF(int pointID, const char *levelname, char *attrnames, long *strbufsize)
+HE5_PTinqlocattrsF(hid_t pointID, const char *levelname, char *attrnames, long *strbufsize)
 {
   long            nattr       = FAIL;     /* Number of attributes   */
 
@@ -13630,7 +13630,7 @@
 |  END_PROLOG                                                                 |
 -----------------------------------------------------------------------------*/
 int
-HE5_PTnumtypeinfoF(int pointID, int level, int numtype[])
+HE5_PTnumtypeinfoF(hid_t pointID, int level, int numtype[])
 {
   herr_t            status = FAIL;/* routine return status variable */
 
--- a/src/GDapi.c
+++ b/src/GDapi.c
@@ -1727,7 +1727,8 @@
 
   hid_t           fid      = FAIL;/* HDF-EOS file id                */
   hid_t           gid      = FAIL;/* "HDFEOS" group ID              */
-  hid_t           (*func)(void*);
+  /* hid_t           (*func)(void*); */
+  H5E_auto1_t	  func;
 
   void            *edata = (void *)NULL;
 
@@ -2564,7 +2565,8 @@
 
   hid_t           fid      = FAIL;/* HDF-EOS file id                */
   hid_t           gid      = FAIL;/* "HDFEOS" group ID              */
-  hid_t           (*func)(void*);
+  /* hid_t           (*func)(void*); */
+  H5E_auto1_t	  func;
 
   hsize_t         dims[HE5_DTSETRANKMAX];/* default dimension sizes */
 
@@ -4612,7 +4614,7 @@
 
   int             i;                          /* Loop Index                     */
 
-  hid_t           (*func)(void*);
+  H5E_auto1_t	  func ;                      /* hid_t    (*func)(void*);       */
   hid_t           fid    = FAIL;              /* HDF-EOS file ID                */
   hid_t           gid    = FAIL;              /* "HDFEOS" group ID              */
 
@@ -17363,7 +17365,7 @@
   if (regionID < 0 || regionID >= HE5_NGRIDREGN)
     {
       status = FAIL;
-      sprintf(errbuf, "Invalid Region ID: %d.\n", regionID);
+      sprintf(errbuf, "Invalid Region ID: %ld.\n", (long int) regionID);
       H5Epush(__FILE__, "HE5_GDregioninfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       free(errbuf);
@@ -17378,7 +17380,7 @@
   if (HE5_GDXRegion[regionID] == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+      sprintf(errbuf, "Inactive Region ID: %ld.\n", regionID);
       H5Epush(__FILE__, "HE5_GDregioninfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       free(errbuf);
@@ -17881,7 +17883,7 @@
   if (regionID < 0 || regionID >= HE5_NGRIDREGN)
     {
       status = FAIL;
-      sprintf(errbuf, "Invalid Region id: %d.\n", regionID);
+      sprintf(errbuf, "Invalid Region id: %ld.\n", regionID);
       H5Epush(__FILE__, "HE5_GDextractregion", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       free(errbuf);
@@ -17895,7 +17897,7 @@
   if (HE5_GDXRegion[regionID] == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+      sprintf(errbuf, "Inactive Region ID: %ld.\n", regionID);
       H5Epush(__FILE__,  "HE5_GDextractregion", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       free(errbuf);
--- a/src/SWapi.c
+++ b/src/SWapi.c
@@ -13444,7 +13444,7 @@
 
 		      if ((HE5_SWXRegion[k]->nRegions) > HE5_MAXNREGIONS)
 			{
-			  sprintf(errbuf, "HE5_SWXRegion[%d]->nRegions exceeded HE5_MAXNREGIONS = %d.\n", k, HE5_MAXNREGIONS);
+			  sprintf(errbuf, "HE5_SWXRegion[%ld]->nRegions exceeded HE5_MAXNREGIONS = %d.\n", k, HE5_MAXNREGIONS);
 			  H5Epush(__FILE__, "HE5_SWdefboxregion", __LINE__, H5E_ARGS, H5E_BADRANGE, errbuf);
 			  HE5_EHprint(errbuf, __FILE__, __LINE__);
 			  if (lonArr != NULL) free(lonArr);
@@ -14768,7 +14768,7 @@
       if (regionID < 0 || regionID >= HE5_NSWATHREGN)
         {
 	  status = FAIL;
-	  sprintf(errbuf, "Invalid Region ID: %d.\n", regionID);
+	  sprintf(errbuf, "Invalid Region ID: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWextractregion", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -14781,7 +14781,7 @@
       if (HE5_SWXRegion[regionID] == 0)
         {
 	  status = FAIL;
-	  sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+	  sprintf(errbuf, "Inactive Region ID: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWextractregion", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -16336,7 +16336,7 @@
       if (regionID < 0 || regionID >= HE5_NSWATHREGN)
         {
 	  status = FAIL;
-	  sprintf(errbuf, "Invalid Region id: %d.\n", regionID);
+	  sprintf(errbuf, "Invalid Region id: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWregioninfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -16349,7 +16349,7 @@
       if (HE5_SWXRegion[regionID] == 0)
         {
 	  status = FAIL;
-	  sprintf(errbuf,"Inactive Region ID: %d.\n", regionID);
+	  sprintf(errbuf,"Inactive Region ID: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWregioninfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -16816,7 +16816,7 @@
       if (regionID < 0 || regionID >= HE5_NSWATHREGN)
         {
 	  status = FAIL;
-	  sprintf(errbuf, "Invalid Region ID: %d.\n", regionID);
+	  sprintf(errbuf, "Invalid Region ID: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWupdatescene", __LINE__, H5E_ARGS, H5E_BADRANGE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -16829,7 +16829,7 @@
       if (HE5_SWXRegion[regionID] == 0)
         {
 	  status = FAIL;
-	  sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+	  sprintf(errbuf, "Inactive Region ID: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWupdatescene", __LINE__, H5E_ARGS, H5E_BADRANGE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -16858,7 +16858,7 @@
 		  free(HE5_SWXRegion[regionID]);
 		  HE5_SWXRegion[regionID] = 0;
 		  status = FAIL;
-		  sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+		  sprintf(errbuf, "Inactive Region ID: %ld.\n", (long int) regionID);
 		  H5Epush(__FILE__, "HE5_SWupdatescene", __LINE__, H5E_ARGS, H5E_BADRANGE, errbuf);
 		  HE5_EHprint(errbuf, __FILE__, __LINE__);
 		  break;
@@ -16977,7 +16977,7 @@
       if (regionID < 0 || regionID >= HE5_NSWATHREGN)
         {
 	  status = FAIL;
-	  sprintf(errbuf,"Invalid Region id: %d.\n", regionID);
+	  sprintf(errbuf,"Invalid Region id: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWupdateidxmap", __LINE__, H5E_ARGS, H5E_BADRANGE, errbuf);
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -16990,7 +16990,7 @@
       if (HE5_SWXRegion[regionID] == 0)
         {
 	  status = FAIL;
-	  sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+	  sprintf(errbuf, "Inactive Region ID: %ld.\n", (long int) regionID);
 	  H5Epush(__FILE__, "HE5_SWupdateidxmap", __LINE__, H5E_FILE, H5E_BADRANGE, errbuf );
 	  HE5_EHprint(errbuf, __FILE__, __LINE__);
         }
@@ -23745,7 +23745,7 @@
   if (regionID < 0 || regionID >= HE5_NSWATHREGN)
     {
       status = FAIL;
-      sprintf(errbuf, "Invalid Region ID: %d.\n", regionID);
+      sprintf(errbuf, "Invalid Region ID: %ld.\n", (long int) regionID);
       H5Epush(__FILE__, "HE5_SWindexinfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
@@ -23756,7 +23756,7 @@
   if (HE5_SWXRegion[regionID] == 0)
     {
       status = FAIL;
-      sprintf(errbuf, "Inactive Region ID: %d.\n", regionID);
+      sprintf(errbuf, "Inactive Region ID: %ld.\n", (long int) regionID);
       H5Epush(__FILE__, "HE5_SWindexinfo", __LINE__, H5E_ARGS, H5E_BADVALUE, errbuf);
       HE5_EHprint(errbuf, __FILE__, __LINE__);
       return(status);
--- a/src/ZAapi.c
+++ b/src/ZAapi.c
@@ -1,4 +1,4 @@
-/*
+/* 
  ----------------------------------------------------------------------------
  |    Copyright (C) 2002  Emergent IT Inc.  and Raytheon Systems Company    |
  |                                                                          |
