Clang compiler warnings

This commit is contained in:
Shahram Najm 2017-08-25 17:30:00 +01:00
parent b291dc6b6f
commit 3cf796ac71
6 changed files with 17 additions and 18 deletions

View File

@ -11,7 +11,7 @@
#include "eccodes.h"
#include <assert.h>
void compare_doubles(const double d1, const double d2, const double epsilon)
static void compare_doubles(const double d1, const double d2, const double epsilon)
{
assert(fabs(d1 - d2) < epsilon);
}

View File

@ -17,7 +17,7 @@
*/
#include "grib_api.h"
void usage(char* prog) {
static void usage(const char* prog) {
printf("usage: %s filename\n",prog);
exit(1);
}

View File

@ -21,7 +21,8 @@ double scale ;
typedef unsigned long (*ieee_to_long_proc) (double);
typedef double (*long_to_ieee_proc) (unsigned long);
void test(unsigned long input, ieee_to_long_proc ieee_to_long, long_to_ieee_proc long_to_ieee)
#if 0
static void test(unsigned long input, ieee_to_long_proc ieee_to_long, long_to_ieee_proc long_to_ieee)
{
double x1 = long_to_ieee(input);
unsigned long num2 = ieee_to_long(x1);
@ -29,8 +30,6 @@ void test(unsigned long input, ieee_to_long_proc ieee_to_long, long_to_ieee_proc
if (num2!=input) printf("ERROR: input=%ld not equal!!!\n", input);
}
#if 0
double p(double ref1,double ref2)
{
double scale = (max-ref1) / 65535;
@ -50,14 +49,14 @@ double p(double ref1,double ref2)
#endif
/* generate a random floating point number from min to max */
double randfrom(double min, double max)
static double randfrom(double minimum, double maximum)
{
double range = (max - min);
double range = (maximum - minimum);
double div = RAND_MAX / range;
return min + (rand() / div);
return minimum + (rand() / div);
}
/* Return 1 on success, 0 on failure */
int test_doubles(ieee_to_long_proc ieee_to_long, long_to_ieee_proc long_to_ieee)
static int test_doubles(ieee_to_long_proc ieee_to_long, long_to_ieee_proc long_to_ieee)
{
const double tolerance = 1e-7;
const double increment = 1;

View File

@ -9,7 +9,7 @@
*/
#include "grib_api.h"
void usage(char* prog) {
static void usage(const char* prog) {
printf("usage: %s infile\n",prog);
exit(1);
}

View File

@ -18,7 +18,7 @@
#define TRUE 1
#define FALSE 0
BOOL Check(
static BOOL Check(
const long year1, const long month1, const long day1, const long hour1, const long min1, const long sec1,
const long year2, const long month2, const long day2, const long hour2, const long min2, const long sec2)
{
@ -28,7 +28,7 @@ BOOL Check(
return TRUE;
}
void TestDateTime(const long year, const long month, const long day, const long hour, const long min, const long sec)
static void TestDateTime(const long year, const long month, const long day, const long hour, const long min, const long sec)
{
double jd = 0.0;
long year1, month1, day1, hour1, min1, sec1; /*generated ones*/
@ -59,7 +59,7 @@ void TestDateTime(const long year, const long month, const long day, const long
}
}
void Test0()
static void Test0()
{
long year, month, day, hour, min, sec;
double jd;
@ -87,7 +87,7 @@ void Test0()
printf("%ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,min,sec,jd);
}
void Test1()
static void Test1()
{
long year, month, day, hour, min, sec;
double jd;
@ -115,7 +115,7 @@ void Test1()
printf("%ld %ld %ld %ld:%ld:%ld -> %f\n",year,month,day,hour,min,sec,jd);
}
void Test2()
static void Test2()
{
long year, month, day, hour, minute, second;
int i,last;
@ -160,7 +160,7 @@ void Test2()
}
}
void Test3()
static void Test3()
{
long iyear, imnth, iday, ihr, imin, isec;
printf("Test3...\n");

View File

@ -9,7 +9,7 @@
*/
#include "grib_api_internal.h"
void usage(char* prog) {
static void usage(const char* prog) {
printf("usage: %s infile\n",prog);
exit(1);
}
@ -67,7 +67,7 @@ int main(int argc,char* argv[]) {
count, edition, (long)size, totalLength, shortName, gridType, levelType, level, step);
grib_handle_delete(h);
}
} else {
} else {
printf("MESSAGE #%ld\n",count);
}
size=bufsize;