Commit 3ba10bb0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed str_tolower() to strToLower().

parent 6ebe5d62
......@@ -6,7 +6,7 @@
#include "error.h"
void str_tolower(char *str)
void strToLower(char *str)
{
if ( str )
for ( size_t i = 0; str[i]; ++i )
......@@ -188,7 +188,7 @@ bool is_lon_axis(const char *units, const char *stdname)
memcpy(lc_units, units, 15);
lc_units[15] = 0;
str_tolower(lc_units);
strToLower(lc_units);
if ( (str_is_equal(lc_units, "degree") || str_is_equal(lc_units, "radian")) &&
(str_is_equal(stdname, "grid_longitude") || str_is_equal(stdname, "longitude")) )
......@@ -217,7 +217,7 @@ bool is_lat_axis(const char *units, const char *stdname)
memcpy(lc_units, units, 15);
lc_units[15] = 0;
str_tolower(lc_units);
strToLower(lc_units);
if ( (str_is_equal(lc_units, "degree") || str_is_equal(lc_units, "radian")) &&
(str_is_equal(stdname, "grid_latitude") || str_is_equal(stdname, "latitude")) )
......
......@@ -38,7 +38,7 @@ char *strdup(const char *s);
*/
#endif
void str_tolower(char *str);
void strToLower(char *str);
bool str_is_equal(const char *vstr, const char *cstr);
#ifndef M_PI
......
......@@ -610,7 +610,7 @@ int cdf_time_dimid(int fileID, int ndims, int nvars, ncdim_t *ncdims)
if ( strncmp(sbuf, "units", 5) == 0 )
{
cdfGetAttText(fileID, varid, "units", sizeof(sbuf), sbuf);
str_tolower(sbuf);
strToLower(sbuf);
if ( is_time_units(sbuf) ) return dimids[0];
}
......@@ -1010,7 +1010,7 @@ void cdfScanAttrAxis(ncvar_t *ncvars, ncdim_t *ncdims, int ncvarid, const char *
while (attlen--)
{
int attchr = attstring[attlen];
const int attchr = attstring[attlen];
if (attchr == 't')
{
if (attlen != 0) Warning("axis attribute 't' not on first position!");
......@@ -1254,13 +1254,13 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
}
else if ( isText && (strcmp(attname, "grid_type") == 0 || strcmp(attname, "CDI_grid_type") == 0) )
{
str_tolower(attstring);
strToLower(attstring);
set_gridtype(attstring, &ncvars[ncvarid].gridtype);
cdf_set_var(ncvars, ncvarid, TRUE);
}
else if ( isText && strcmp(attname, "level_type") == 0 )
{
str_tolower(attstring);
strToLower(attstring);
set_zaxistype(attstring, &ncvars[ncvarid].zaxistype);
cdf_set_var(ncvars, ncvarid, TRUE);
}
......@@ -1451,7 +1451,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
}
else if ( isText && strcmp(attname, "positive") == 0 )
{
str_tolower(attstring);
strToLower(attstring);
if ( str_is_equal(attstring, "down") ) ncvars[ncvarid].positive = POSITIVE_DOWN;
else if ( str_is_equal(attstring, "up") ) ncvars[ncvarid].positive = POSITIVE_UP;
......@@ -1527,7 +1527,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
}
else if ( isText && strcmp(attname, "_Unsigned") == 0 )
{
str_tolower(attstring);
strToLower(attstring);
if ( str_is_equal(attstring, "true") )
{
......@@ -1542,7 +1542,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
}
else if ( isText && strcmp(attname, "cdi") == 0 )
{
str_tolower(attstring);
strToLower(attstring);
if ( str_is_equal(attstring, "ignore") )
{
......@@ -1637,7 +1637,7 @@ void cdfVerifyVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims)
if (isText && strcmp(attname, "axis") == 0)
{
str_tolower(attstring);
strToLower(attstring);
cdfScanAttrAxis(ncvars, ncdims, ncvarid, attstring, nvdims, dimidsp);
}
}
......@@ -3519,7 +3519,7 @@ void find_time_vars(int nvars, ncvar_t *ncvars, ncdim_t *ncdims, int timedimid,
if ( ncvars[ncvarid].units[0] )
{
strcpy(timeunits, ncvars[ncvarid].units);
str_tolower(timeunits);
strToLower(timeunits);
if ( is_time_units(timeunits) )
{
......@@ -4124,7 +4124,7 @@ int cdfInqContents(stream_t *streamptr)
{
char attstring[1024];
cdfGetAttText(fileID, nctimevarid, "calendar", sizeof(attstring), attstring);
str_tolower(attstring);
strToLower(attstring);
set_calendar(attstring, &calendar);
}
......
......@@ -3267,8 +3267,8 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
char grb_name[256]; grb_name[0] = 0;
vlistInqVarName(vlistID, varID, cdi_name);
gribapiGetString(gh, "shortName", grb_name, sizeof(grb_name));
str_tolower(cdi_name);
str_tolower(grb_name);
strToLower(cdi_name);
strToLower(grb_name);
if ( (strlen(cdi_name) != strlen(grb_name)) || !str_is_equal(cdi_name, grb_name) )
Message("*** GRIB2 shortName does not correspond to chosen variable name: \"%s\" (\"%s\").",
grb_name[0]?grb_name:"unknown", cdi_name);
......
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