Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate definition in ocprint #1726

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions debug/cf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ fi
FLAGS=

if test "x$VS" != x -a "x$INSTALL" != x ; then
<<<<<<< HEAD
FLAGS="-DCMAKE_PREFIX_PATH=${NCC}"
=======
FLAGS="$FLAGS -DCMAKE_PREFIX_PATH=${NCC}"
>>>>>>> master
fi
FLAGS="$FLAGS -DCMAKE_INSTALL_PREFIX=/tmp/netcdf"

Expand Down
7 changes: 7 additions & 0 deletions debug/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
#git remote add unidata https://github.com/Unidata/netcdf-c.git
git fetch unidata
git rebase unidata/master
#git push


2 changes: 2 additions & 0 deletions include/ncexternl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef NCEXTERNL_H
#define NCEXTERNL_H

#ifndef MSC_EXTRA
#if defined(DLL_NETCDF) /* define when library is a DLL */
# if defined(DLL_EXPORT) /* define when building the library */
# define MSC_EXTRA __declspec(dllexport)
Expand All @@ -16,6 +17,7 @@
#else
# define MSC_EXTRA
#endif /* defined(DLL_NETCDF) */
#endif /*MSC_EXTRA*/
#ifndef EXTERNL
# define EXTERNL MSC_EXTRA extern
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/netcdf_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ EXTERNL int nc_var_filter_remove(int ncid, int varid, unsigned int id);
last arg is void*, but is actually H5Z_class2_t*.
It is void* to avoid having to reference hdf.h.
*/
EXTERNL int nc_filter_client_register(unsigned int id, void*/*H5Z_class2_t* */);
EXTERNL int nc_filter_client_register(unsigned int id, void*);
EXTERNL int nc_filter_client_unregister(unsigned int id);
EXTERNL int nc_filter_client_inq(unsigned int id, void*/*H5Z_class2_t* */);
EXTERNL int nc_filter_client_inq(unsigned int id, void*);

/* HDF5 specific filter info */
typedef struct NC4_Filterspec {
Expand Down
1 change: 0 additions & 1 deletion libdap2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
int verbose;
char* fileurl;
int debug;
extern int ocdebug;

/* Forward */
static void usage(void);
Expand Down
2 changes: 1 addition & 1 deletion libdap4/d4debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#endif


#undef D4CATCH /* Warning: significant performance impact */
#define D4CATCH /* Warning: significant performance impact */

#define PANIC(msg) assert(d4panic(msg));
#define PANIC1(msg,arg) assert(d4panic(msg,arg));
Expand Down
23 changes: 23 additions & 0 deletions ncdump/nccopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,28 @@ copy_vars(int igrp, int ogrp)
return stat;
}

static void
report(int rank, size_t* start, size_t* count, void* buf)
{
int i;
size_t prod = 1;
for(i=0;i<rank;i++) prod *= count[i];
fprintf(stderr,"start=");
for(i=0;i<rank;i++)
fprintf(stderr,"%s%ld",(i==0?"(":" "),(long)start[i]);
fprintf(stderr,")");
fprintf(stderr," count=");
for(i=0;i<rank;i++)
fprintf(stderr,"%s%ld",(i==0?"(":" "),(long)count[i]);
fprintf(stderr,")");
fprintf(stderr," data=");
for(i=0;i<prod;i++)
fprintf(stderr,"%s%d",(i==0?"(":" "),((int*)buf)[i]);
fprintf(stderr,"\n");
fflush(stderr);
}


/* Copy the schema in a group and all its subgroups, recursively, from
* group igrp in input to parent group ogrp in destination. Use
* dimmap array to map input dimids to output dimids. */
Expand Down Expand Up @@ -1615,6 +1637,7 @@ copy_var_data(int igrp, int varid, int ogrp) {
* subsequent calls. */
while((ntoget = nc_next_iter(iterp, start, count)) > 0) {
NC_CHECK(nc_get_vara(igrp, varid, start, count, buf));
report(iterp->rank,start,count,buf);
NC_CHECK(nc_put_vara(ogrp, ovarid, start, count, buf));
#ifdef USE_NETCDF4
/* we have to explicitly free values for strings and vlens */
Expand Down
9 changes: 6 additions & 3 deletions ncdump/ocprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "oc.h"
#include "ocx.h"

#ifdef _MSC_VER
#ifdef _WIN32
#include "XGetopt.h"
int opterr, optind;
char* optarg;
Expand All @@ -56,8 +56,6 @@ char* optarg;
/*Mnemonic*/
#define TOPLEVEL 1

int ocdebug;

static OCerror ocstat;
static OClink glink;

Expand Down Expand Up @@ -276,9 +274,14 @@ main(int argc, char **argv)
if(ocopt.output == NULL)
ocopt.output = stdout;

#ifndef _MSC_VER
/* For some reason, visual studio claims ocdebug
is an undefined reference; it is not seeing the
decl in ocinternal.c */
if (ocopt.debug.debuglevel > 0) {
ocdebug = ocopt.debug.debuglevel;
}
#endif

if(ocopt.logging) {
ncloginit();
Expand Down
1 change: 1 addition & 0 deletions oc2/dapparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "config.h"
#include "dapparselex.h"
#include "dapy.h"
#include "ocdebug.h"

/* Forward */

Expand Down
6 changes: 6 additions & 0 deletions oc2/oc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Version: 2.1
#include <sys/types.h>
#endif

#include "ncexternl.h"


/*!\file oc.h
*/

Expand Down Expand Up @@ -578,6 +581,9 @@ EXTERNL OCerror oc_set_curlopt(OClink link, const char* option, void* value);
/**************************************************/
/* Experimental/Undocumented */

/* Access the debug flags */
EXTERNL int ocdebug;

/* Given an arbitrary OCnode, return the connection of which it is a part */
EXTERNL OCerror oc_get_connection(OCobject ocnode, OCobject* linkp);

Expand Down
3 changes: 1 addition & 2 deletions oc2/ocdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include "ncexternl.h"
#include "ocinternal.h"
#include "ocdebug.h"

int ocdebug;

#ifdef OCCATCHERROR
/* Place breakpoint here to catch errors close to where they occur*/
OCerror
Expand Down
3 changes: 0 additions & 3 deletions oc2/ocdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ about how IO is getting along.
*/
#undef OCPROGRESS

EXTERNL int ocdebug;
EXTERNL int cedebug;

/*extern char* dent2(int n);*/
/*/extern char* dent(int n);*/
extern int ocpanic(const char* fmt, ...);
Expand Down
5 changes: 4 additions & 1 deletion oc2/ocinternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@

#include <errno.h>

#include "ncrc.h"
#include "oc.h"
#include "ocinternal.h"
#include "ocdebug.h"
#include "occurlfunctions.h"
#include "ochttp.h"
#include "ocread.h"
#include "dapparselex.h"
#include "ncwinpath.h"
#include "ncrc.h"

#define DATADDSFILE "datadds"

Expand All @@ -45,6 +46,8 @@
#endif
#endif

int ocdebug = 0;

/*Forward*/
static OCerror ocextractddsinmemory(OCstate*,OCtree*,int);
static OCerror ocextractddsinfile(OCstate*,OCtree*,int);
Expand Down
7 changes: 0 additions & 7 deletions oc2/ocinternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,8 @@ typedef struct OCtree
The true external interface is defined in oc.h
*/

#if 0
/* Location: ceparselex.c*/
extern int cedebug;
extern NClist* CEparse(OCstate*,char* input);
#endif

extern int ocinitialized;


extern OCerror ocopen(OCstate** statep, const char* url);
extern void occlose(OCstate* state);
extern OCerror ocfetch(OCstate*, const char*, OCdxd, OCflags, OCnode**);
Expand Down