From 8d8fdfd12cd5a37435ac11cb077d442cf2e349d7 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Apr 2022 05:31:07 -0600 Subject: [PATCH] fixed warnings --- libdispatch/dutil.c | 3 ++- libsrc/ncio.c | 4 ++++ nc_test/tst_diskless6.c | 1 - nc_test4/tst_quantize.c | 2 +- unit_test/test_pathcvt.c | 6 ++++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libdispatch/dutil.c b/libdispatch/dutil.c index 35d069be6..b8f48e17c 100644 --- a/libdispatch/dutil.c +++ b/libdispatch/dutil.c @@ -211,10 +211,11 @@ NC_mktmp(const char* base) int fd = -1; char* tmp = NULL; size_t len; - int tries; #define MAXTRIES 4 #ifdef HAVE_MKSTEMP mode_t mask; +#else + int tries; #endif len = strlen(base)+6+1; diff --git a/libsrc/ncio.c b/libsrc/ncio.c index 9ee5d99bf..7574903a2 100644 --- a/libsrc/ncio.c +++ b/libsrc/ncio.c @@ -49,7 +49,9 @@ extern int ffio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** co extern int memio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const); /* Forward */ +#ifdef ENABLE_BYTERANGE static int urlmodetest(const char* path); +#endif int ncio_create(const char *path, int ioflags, size_t initialsz, @@ -179,6 +181,7 @@ NC_HTTP => byterange NC_S3SDK => s3 0 => Not URL */ +#ifdef ENABLE_BYTERANGE static int urlmodetest(const char* path) { @@ -195,3 +198,4 @@ urlmodetest(const char* path) ncurifree(uri); return kind; } +#endif diff --git a/nc_test/tst_diskless6.c b/nc_test/tst_diskless6.c index 69aa805da..108d835c0 100644 --- a/nc_test/tst_diskless6.c +++ b/nc_test/tst_diskless6.c @@ -132,7 +132,6 @@ fail(int ret) void exists(const char* file) { - int stat = 0; FILE* f = NCfopen(file, "r"); if(f == NULL) fail(NC_EPERM); fclose(f); diff --git a/nc_test4/tst_quantize.c b/nc_test4/tst_quantize.c index 95f248319..bb515b0c8 100644 --- a/nc_test4/tst_quantize.c +++ b/nc_test4/tst_quantize.c @@ -550,7 +550,7 @@ main(int argc, char **argv) /* union FU fout; */ union FU xpect[DIM_LEN_5]; union DU dfin; - union DU dfout; + /* union DU dfout; */ union DU double_xpect[DIM_LEN_5]; xpect[0].u = 0x3f8e3000; xpect[1].u = 0x3f800fff; diff --git a/unit_test/test_pathcvt.c b/unit_test/test_pathcvt.c index 7426e5495..6c12b107f 100644 --- a/unit_test/test_pathcvt.c +++ b/unit_test/test_pathcvt.c @@ -108,7 +108,9 @@ static Test PATHTESTS[] = { char* macros[128]; /*Forward */ +#ifdef DEBUG static const char* kind2string(int kind); +#endif static char* expand(const char* s); static void setmacros(void); static void reclaimmacros(void); @@ -130,7 +132,9 @@ main(int argc, char** argv) /* Test localkind X path-kind */ for(test=PATHTESTS;test->test;test++) { +#ifdef DEBUG int inputkind = NCgetinputpathkind(test->test); +#endif /* Iterate over the test paths */ for(k=0;k 0 ? 1 : 0); } +#ifdef DEBUG static const char* kind2string(int kind) { @@ -206,6 +211,7 @@ kind2string(int kind) } return "Unknown"; } +#endif static char* expand(const char* s)