From 3e24dcd57533890d0523a471d37017446c58b193 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 20 Jun 2016 15:28:46 -0600 Subject: [PATCH] Removed some dead assignments reported by clang. --- libsrc/var.c | 14 +++++++------- libsrc4/nc4hdf.c | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libsrc/var.c b/libsrc/var.c index 88623c2d0..a510ba52b 100644 --- a/libsrc/var.c +++ b/libsrc/var.c @@ -382,13 +382,13 @@ ncx_szof(nc_type type) return X_SIZEOF_FLOAT; case NC_DOUBLE : return X_SIZEOF_DOUBLE; - case NC_USHORT : + case NC_USHORT : return X_SIZEOF_USHORT; - case NC_UINT : + case NC_UINT : return X_SIZEOF_UINT; - case NC_INT64 : + case NC_INT64 : return X_SIZEOF_INT64; - case NC_UINT64 : + case NC_UINT64 : return X_SIZEOF_UINT64; default: assert("ncx_szof invalid type" == 0); @@ -446,15 +446,15 @@ NC_var_shape(NC_var *varp, const NC_dimarray *dims) /*if(!(shp == varp->shape && IS_RECVAR(varp)))*/ if( shp != NULL && (shp != varp->shape || !IS_RECVAR(varp))) { - if( (off_t)(*shp) <= OFF_T_MAX / product ) + if( ((off_t)(*shp)) <= OFF_T_MAX / product ) { product *= (*shp > 0 ? *shp : 1); } else { - product = OFF_T_MAX ; + product = OFF_T_MAX ; } } - *dsp = product; + *dsp = product; } diff --git a/libsrc4/nc4hdf.c b/libsrc4/nc4hdf.c index 0b9cb403b..1fb08202e 100644 --- a/libsrc4/nc4hdf.c +++ b/libsrc4/nc4hdf.c @@ -4100,9 +4100,13 @@ NC4_walk(hid_t gid, int* countp) /* walk group members of interest */ err = H5Gget_num_objs(gid, &nobj); + if(err < 0) return err; + for(i = 0; i < nobj; i++) { /* Get name & kind of object in the group */ len = H5Gget_objname_by_idx(gid,(hsize_t)i,name,(size_t)NC_HDF5_MAX_NAME); + if(len < 0) return len; + otype = H5Gget_objtype_by_idx(gid,(size_t)i); switch(otype) { case H5G_GROUP: @@ -4121,6 +4125,7 @@ NC4_walk(hid_t gid, int* countp) if(aid >= 0) { const char** p; ssize_t len = H5Aget_name(aid, NC_HDF5_MAX_NAME, name); + if(len < 0) return len; /* Is this a netcdf-4 marker attribute */ for(p=NC_RESERVED_VARATT_LIST;*p;p++) { if(strcmp(name,*p) == 0) {