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

fixed all code warnings #2307

Merged
merged 1 commit into from
Apr 26, 2022
Merged
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
3 changes: 2 additions & 1 deletion libdispatch/dutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions libsrc/ncio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -179,6 +181,7 @@ NC_HTTP => byterange
NC_S3SDK => s3
0 => Not URL
*/
#ifdef ENABLE_BYTERANGE
static int
urlmodetest(const char* path)
{
Expand All @@ -195,3 +198,4 @@ urlmodetest(const char* path)
ncurifree(uri);
return kind;
}
#endif
1 change: 0 additions & 1 deletion nc_test/tst_diskless6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion nc_test4/tst_quantize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions unit_test/test_pathcvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<NKINDS;k++) {
int kind = kinds[k];
Expand Down Expand Up @@ -188,6 +192,7 @@ main(int argc, char** argv)
return (failcount > 0 ? 1 : 0);
}

#ifdef DEBUG
static const char*
kind2string(int kind)
{
Expand All @@ -206,6 +211,7 @@ kind2string(int kind)
}
return "Unknown";
}
#endif

static char*
expand(const char* s)
Expand Down