From 71a30406f7868679778968baf01eff92d89c6299 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 29 Jan 2013 23:33:59 +0000 Subject: [PATCH] Corrected 2 windows-specific errors when using Visual Studio: 1. In nc4hdf.c, had a variable declaration located such that Visual Studio complained and threw an error. Moved to head of function. 2. Visual Studio was complaining about variable declarations being made after OCVERIFY/OCDEREF macros. --- libsrc4/nc4hdf.c | 2 +- oc2/oc.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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);