Skip to content

Commit

Permalink
Remove the nclong type
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Robinson committed Oct 5, 2024
1 parent aea7bb4 commit 4320d81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
8 changes: 4 additions & 4 deletions mfhdf/src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ NC_typelen(nc_type type)
case NC_SHORT:
return sizeof(short);
case NC_LONG:
return sizeof(nclong);
return sizeof(int32_t);
case NC_FLOAT:
return sizeof(float);
case NC_DOUBLE:
Expand Down Expand Up @@ -103,7 +103,7 @@ nctypelen(nc_type type)
case NC_SHORT:
return sizeof(short);
case NC_LONG:
return sizeof(nclong);
return sizeof(int32_t);
case NC_FLOAT:
return sizeof(float);
case NC_DOUBLE:
Expand Down Expand Up @@ -141,8 +141,8 @@ NC_arrayfill(void *low, size_t len, nc_type type)
break;
case NC_LONG:
while (lo < hi) {
*((nclong *)lo) = FILL_LONG;
lo += sizeof(nclong);
*((int32_t *)lo) = FILL_LONG;
lo += sizeof(int32_t);
}
break;
case NC_FLOAT:
Expand Down
8 changes: 1 addition & 7 deletions mfhdf/src/nc_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ typedef int nc_type;
#define NC_BYTE 1
#define NC_CHAR 2
#define NC_SHORT 3
#define NC_LONG 4 /* Use int32_t on modern systems */
#define NC_LONG 4 /* Maps to a 32-bit signed integer (int32_t) */
#define NC_FLOAT 5
#define NC_DOUBLE 6
/* private */
Expand All @@ -196,12 +196,6 @@ typedef int nc_type;
#define NC_VARIABLE 11
#define NC_ATTRIBUTE 12

/*
* Variables/attributes of type NC_LONG should use the C type 'nclong',
* which must map to a 32-bit integer.
*/
typedef int32_t nclong;

/*
* Global NetCDF error status variable
* Initialized in error.c
Expand Down
5 changes: 2 additions & 3 deletions mfhdf/src/putget.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,7 @@ xdr_NCv1data(XDR *xdrs, unsigned long where, nc_type type, uint8_t *values)
case NC_SHORT:
return xdr_NCvshort(xdrs, (unsigned)rem / 2, (short *)values);
case NC_LONG:
/* nclong is defined to a 32-bit integer type in nc_priv.h */
return h4_xdr_int(xdrs, (nclong *)values);
return h4_xdr_int(xdrs, (int32_t *)values);
case NC_FLOAT:
return h4_xdr_float(xdrs, (float *)values);
case NC_DOUBLE:
Expand Down Expand Up @@ -1498,7 +1497,7 @@ xdr_NCvdata(XDR *xdrs, unsigned long where, nc_type type, unsigned count, uint8_
return TRUE;
case NC_LONG:
xdr_NC_fnct = h4_xdr_int;
szof = sizeof(nclong);
szof = sizeof(int32_t);
break;
case NC_FLOAT:
xdr_NC_fnct = h4_xdr_float;
Expand Down

0 comments on commit 4320d81

Please sign in to comment.