From c63da86a4fc3d81d97d0beb23a2ebda0af4bd4c6 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 7 Sep 2004 12:59:45 +0000 Subject: Enclose HDF4-specific code in '#ifdef WITH_HDF4'. This closes PR CactusExternal/1841: "FlexIO utils won't compile --- blocks all utils from compiling". git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@70 21a6bef8-4479-4f54-8f8d-0db94a2919ef --- src/ioconvert.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ioconvert.cc b/src/ioconvert.cc index 96e5bb1..cef2612 100644 --- a/src/ioconvert.cc +++ b/src/ioconvert.cc @@ -25,7 +25,7 @@ int main(int argc,char *argv[]){ if(argc<3) usage(); int i,swap; int sindex=0,dindex=0,findex=0; - IObase *infile,*outfile; + IObase *infile = NULL,*outfile = NULL; #ifdef WITH_HDF4 HDFIO *hdffile; #endif @@ -82,7 +82,7 @@ int main(int argc,char *argv[]){ } #endif - if(!outfile->isValid()){ + if(! (outfile && outfile->isValid())){ printf("cant write %s\n",argv[dindex]); delete infile; usage(); @@ -94,7 +94,9 @@ int main(int argc,char *argv[]){ IObase::DataType type; char *data; infile->seek(i); +#ifdef WITH_HDF4 if(hdfin && hdffile->isCoord()) continue; // skip coord vars +#endif fprintf(stderr,".%u",i); infile->readInfo(type,rank,dims); { -- cgit v1.2.3