diff --git a/libsrc4/nc4hdf.c b/libsrc4/nc4hdf.c index f10536abb..729e4beb6 100644 --- a/libsrc4/nc4hdf.c +++ b/libsrc4/nc4hdf.c @@ -172,6 +172,7 @@ nc4_pg_var1(NC_PG_T pg, NC *nc, int ncid, int varid, int i; size_t *start = NULL; size_t *count = NULL; + int res = 0; int retval; @@ -199,7 +200,6 @@ nc4_pg_var1(NC_PG_T pg, NC *nc, int ncid, int varid, } /* Get or put this data. */ - int res = 0; if (pg == GET) { res = nc4_get_vara(nc, ncid, varid, start, count, xtype, is_long, ip); diff --git a/oc2/oc.c b/oc2/oc.c index 1b73a687d..ab27a2d27 100644 --- a/oc2/oc.c +++ b/oc2/oc.c @@ -551,9 +551,10 @@ oc_dds_fieldbyname(OCobject link, OCobject ddsnode, const char* name, OCobject* { OCerror err = OC_NOERR; OCnode* node; + size_t count,i; OCVERIFY(OC_Node,ddsnode); OCDEREF(OCnode*,node,ddsnode); - size_t count,i; + if(!iscontainer(node->octype)) return OC_EBADTYPE; @@ -965,12 +966,12 @@ oc_data_fieldbyname(OCobject link, OCobject datanode, const char* name, OCobject OCerror err = OC_NOERR; OCstate* state; OCdata* data; + size_t count,i; + OCobject ddsnode; OCVERIFY(OC_State,link); OCDEREF(OCstate*,state,link); OCVERIFY(OC_Data,datanode); OCDEREF(OCdata*,data,datanode); - size_t count,i; - OCobject ddsnode; /* Get the dds node for this datanode */ err = oc_data_ddsnode(link,datanode,&ddsnode);