Commit ca2ffaf8 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

fixed most warnings

parent f5774a21
......@@ -39,7 +39,7 @@ static void modelRun(MPI_Comm commModel)
maxlev = 5 };
static int nlev[nVars] = {1,1,5,5,2};
static char * name = "example";
const static char * name = "example";
int gridID, zaxisID[nVars], taxisID;
int vlistID, varID[nVars], streamID, tsID, tfID = 0;
......
......@@ -1094,8 +1094,8 @@ const char *institutInqLongnamePtr(int instID);
/* Model routines */
int modelDef(int instID, int modelgribID, const char *name);
int modelInq(int instID, int modelgribID, char *name);
int modelInqInstitut(int modelID);
int modelInq(int instID, int modelgribID, const char *name);
int modelInqInstitut(int modelID) ;
int modelInqGribID(int modelID);
const char *modelInqNamePtr(int modelID);
......
......@@ -73,7 +73,7 @@ int cdiSortName = 0;
int cdiHaveMissval = 0;
static long cdiGetenvInt(char *envName)
static long cdiGetenvInt(const char *envName)
{
char *envString;
long envValue = -1;
......
......@@ -326,7 +326,7 @@ int streamInqFileID(int streamID);
void gridDefHasDims(int gridID, int hasdims);
int gridInqHasDims(int gridID);
const char *gridNamePtr(int gridtype);
char *zaxisNamePtr(int leveltype);
const char *zaxisNamePtr(int leveltype);
int zaxisInqLevelID(int zaxisID, double level);
void streamCheckID(const char *caller, int streamID);
......
......@@ -90,9 +90,9 @@ void cdiParamToString(int param, char *paramstr, int maxlen)
}
char *cdiUnitNamePtr(int cdi_unit)
const char *cdiUnitNamePtr(int cdi_unit)
{
char *cdiUnits[] = {
const char *cdiUnits[] = {
/* 0 */ "undefined",
/* 1 */ "Pa",
/* 2 */ "hPa",
......@@ -102,7 +102,7 @@ char *cdiUnitNamePtr(int cdi_unit)
/* 6 */ "m",
};
enum { numUnits = (int) (sizeof(cdiUnits)/sizeof(char *)) };
char *name = ( cdi_unit > 0 && cdi_unit < numUnits ) ?
const char *name = ( cdi_unit > 0 && cdi_unit < numUnits ) ?
cdiUnits[cdi_unit] : NULL;
return name;
}
......
......@@ -58,7 +58,7 @@ void extDebug(int debug)
static void extLibInit()
{
char *envString;
char *envName = "EXT_PRECISION";
const char *envName = "EXT_PRECISION";
envString = getenv(envName);
......
......@@ -1206,8 +1206,8 @@ int fileClose_serial(int fileID)
{
char *name;
int ret;
char *fbtname[] = {"unknown", "standard", "mmap"};
char *ftname[] = {"unknown", "open", "fopen"};
const char *fbtname[] = {"unknown", "standard", "mmap"};
const char *ftname[] = {"unknown", "open", "fopen"};
bfile_t *fileptr = file_to_pointer(fileID);
double rout = 0;
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <config.h>
#include <math.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include "dmemory.h"
#ifndef M_PI
......
......@@ -44,7 +44,7 @@ int IEG_Debug = 0; /* If set to 1, debugging */
void iegLibInit()
{
char *envString;
char *envName = "IEG_PRECISION";
const char *envName = "IEG_PRECISION";
envString = getenv(envName);
......
......@@ -134,7 +134,7 @@ void modelInit(void)
struct modelLoc
{
char *name;
const char *name;
int instID, modelgribID, resID;
};
......@@ -179,7 +179,7 @@ findModelByName(int resID, void *res, void *data)
return CDI_APPLY_GO_ON;
}
int modelInq(int instID, int modelgribID, char *name)
int modelInq(int instID, int modelgribID, const char *name)
{
modelInit ();
......@@ -332,7 +332,7 @@ modelUnpack(void *buf, int size, int *position, int originNamespace, void *conte
}
else
{
name = "";
name = (char*)"";
}
int targetID = namespaceAdaptKey(tempbuf[0], originNamespace);
model_t *mp = modelNewEntry(force_id?targetID:CDI_UNDEFID,
......
......@@ -60,7 +60,7 @@ void srvDebug(int debug)
void srvLibInit()
{
char *envString;
char *envName = "SRV_PRECISION";
const char *envName = "SRV_PRECISION";
envString = getenv(envName);
......
......@@ -369,7 +369,7 @@ int setBaseTime(const char *timeunits, taxis_t *taxis)
}
static
void cdfGetAttInt(int fileID, int ncvarid, char *attname, int attlen, int *attint)
void cdfGetAttInt(int fileID, int ncvarid, const char *attname, int attlen, int *attint)
{
nc_type atttype;
size_t nc_attlen;
......
......@@ -1860,7 +1860,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
int status;
static short lwarn = TRUE;
size_t len;
char *mesg;
const char *mesg;
UNUSED(nmiss);
......
......@@ -1224,7 +1224,7 @@ static const PAR cosmo250[] = {
};
static void
const static void
tableDefault(void)
{
int tableID, instID, modelID;
......
......@@ -23,10 +23,10 @@
static const struct {
unsigned char positive; // 1: up; 2: down
char *name;
char *longname;
char *stdname;
char *units;
const char *name;
const char *longname;
const char *stdname;
const char *units;
}
ZaxistypeEntry[] = {
{ /* 0 */ 0, "sfc", "surface", "", ""},
......@@ -336,9 +336,9 @@ void zaxisDestroyP ( void * zaxisptr )
}
char *zaxisNamePtr(int zaxistype)
const char *zaxisNamePtr(int zaxistype)
{
char *name = (zaxistype >= 0 && zaxistype < CDI_NumZaxistype)
const char *name = (zaxistype >= 0 && zaxistype < CDI_NumZaxistype)
? ZaxistypeEntry[zaxistype].longname
: ZaxistypeEntry[ZAXIS_GENERIC].longname;
return (name);
......
......@@ -41,7 +41,7 @@ read_table(const char *table_fname, size_t *table_len)
int main(int argc, char *argv[])
{
char *fname = "example.grb", *table_fname = "example.cksum";
const char *fname = "example.grb", *table_fname = "example.cksum";
if (argc > 1)
fname = argv[1];
......
......@@ -118,7 +118,7 @@ main(int argc, char *argv[])
int i, j, k, nmiss = 0;
double *lons, *lats, *var[nvars], *levs, mscale, mrscale;
size_t varSize[nvars];
char *varName[nvars] = { "varname1", "varname2" };
const char *varName[nvars] = { "varname1", "varname2" };
#ifndef TEST_CHUNK_WRITE
const char *suffix = "grb", *prefix = "example";
int grid = GRID_LONLAT;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment