Commit 074ae375 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

renamed strcompare to cmpstr

parent b0bd4e60
......@@ -55,7 +55,9 @@ char *strdup(const char *s);
*/
#endif
#define strcompare(s1, s2) (strncmp(s1, s2, strlen(s2)))
#define cmpstr(s1, s2) (strncmp(s1, s2, strlen(s2)))
#define cmpstrlen(s1, s2, len) (strncmp(s1, s2, len = strlen(s2)))
/* sxxxYYYYMMDDhhmm0 */
......
......@@ -55,11 +55,11 @@ void scale_vec(double scalefactor, long nvals, double *restrict values)
void grid_to_radian(const char *units, long nvals, double *restrict values, const char *description)
{
if ( strcompare(units, "degree") == 0 )
if ( cmpstr(units, "degree") == 0 )
{
scale_vec(DEG2RAD, nvals, values);
}
else if ( strcompare(units, "radian") == 0 )
else if ( cmpstr(units, "radian") == 0 )
{
/* No conversion necessary */
}
......@@ -72,11 +72,11 @@ void grid_to_radian(const char *units, long nvals, double *restrict values, cons
void grid_to_degree(const char *units, long nvals, double *restrict values, const char *description)
{
if ( strcompare(units, "radian") == 0 )
if ( cmpstr(units, "radian") == 0 )
{
for ( long n = 0; n < nvals; ++n ) values[n] *= RAD2DEG;
}
else if ( strcompare(units, "degree") == 0 )
else if ( cmpstr(units, "degree") == 0 )
{
/* No conversion necessary */
}
......
......@@ -500,10 +500,10 @@ void read_remap_scrip(const char *interp_file, int gridID1, int gridID2, int *ma
*submap_type = SUBMAP_TYPE_NONE;
*remap_order = 1;
if ( strcompare(map_method, "Conservative") == 0 )
if ( cmpstr(map_method, "Conservative") == 0 )
{
int iatt;
if ( strcompare(map_method, "Conservative remapping using clipping on sphere") == 0 )
if ( cmpstr(map_method, "Conservative remapping using clipping on sphere") == 0 )
rv->map_type = MAP_TYPE_CONSERV_YAC;
else
rv->map_type = MAP_TYPE_CONSERV;
......@@ -511,19 +511,19 @@ void read_remap_scrip(const char *interp_file, int gridID1, int gridID2, int *ma
status = nc_get_att_int(nc_file_id, NC_GLOBAL, "remap_order", &iatt);
if ( status == NC_NOERR ) *remap_order = iatt;
}
else if ( strcompare(map_method, "Bilinear") == 0 ) rv->map_type = MAP_TYPE_BILINEAR;
else if ( strcompare(map_method, "Bicubic") == 0 ) rv->map_type = MAP_TYPE_BICUBIC;
else if ( strcompare(map_method, "Distance") == 0 )
else if ( cmpstr(map_method, "Bilinear") == 0 ) rv->map_type = MAP_TYPE_BILINEAR;
else if ( cmpstr(map_method, "Bicubic") == 0 ) rv->map_type = MAP_TYPE_BICUBIC;
else if ( cmpstr(map_method, "Distance") == 0 )
{
rv->map_type = MAP_TYPE_DISTWGT;
*num_neighbors = 4;
}
else if ( strcompare(map_method, "Nearest") == 0 )
else if ( cmpstr(map_method, "Nearest") == 0 )
{
rv->map_type = MAP_TYPE_DISTWGT;
*num_neighbors = 1;
}
else if ( strcompare(map_method, "Largest") == 0 )
else if ( cmpstr(map_method, "Largest") == 0 )
{
rv->map_type = MAP_TYPE_CONSERV;
*submap_type = SUBMAP_TYPE_LAF;
......
Supports Markdown
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