Merge pull request #2307 from edwardhartnett/ejh_warn

fixed all code warnings
This commit is contained in:
Ward Fisher 2022-04-26 11:05:11 -06:00 committed by GitHub
commit 885e2cc4ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 3 deletions

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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<NKINDS;k++) {
int kind = kinds[k];
@ -188,6 +192,7 @@ main(int argc, char** argv)
return (failcount > 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)