Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
ab505d88
Commit
ab505d88
authored
Feb 25, 2015
by
Uwe Schulzweida
Browse files
replaced atoi by parameter2int
parent
d125b720
Changes
42
Hide whitespace changes
Inline
Side-by-side
src/CDIread.c
View file @
ab505d88
...
...
@@ -111,7 +111,7 @@ void *CDIread(void *argument)
if
(
operatorArgc
()
>
1
)
cdoAbort
(
"Too many arguments!"
);
if
(
operatorArgc
()
==
1
)
nruns
=
atol
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
==
1
)
nruns
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
nruns
<
0
)
nruns
=
0
;
if
(
nruns
>
99
)
nruns
=
99
;
...
...
src/CDItest.c
View file @
ab505d88
...
...
@@ -58,7 +58,7 @@ void *CDItest(void *argument)
UNUSED
(
operatorID
);
// operatorInputArg("Number of copies");
if
(
operatorArgc
()
==
1
)
max_copy
=
atoi
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
==
1
)
max_copy
=
parameter2int
(
operatorArgv
()[
0
]);
processStartTime
(
&
s_utime
,
&
s_stime
);
...
...
src/CDIwrite.c
View file @
ab505d88
...
...
@@ -129,11 +129,11 @@ void *CDIwrite(void *argument)
if
(
operatorArgc
()
>
5
)
cdoAbort
(
"Too many arguments!"
);
gridfile
=
defaultgrid
;
if
(
operatorArgc
()
>=
1
)
nruns
=
atol
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>=
1
)
nruns
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>=
2
)
gridfile
=
operatorArgv
()[
1
];
if
(
operatorArgc
()
>=
3
)
nlevs
=
atol
(
operatorArgv
()[
2
]);
if
(
operatorArgc
()
>=
4
)
ntimesteps
=
atol
(
operatorArgv
()[
3
]);
if
(
operatorArgc
()
>=
5
)
nvars
=
atol
(
operatorArgv
()[
4
]);
if
(
operatorArgc
()
>=
3
)
nlevs
=
parameter2int
(
operatorArgv
()[
2
]);
if
(
operatorArgc
()
>=
4
)
ntimesteps
=
parameter2int
(
operatorArgv
()[
3
]);
if
(
operatorArgc
()
>=
5
)
nvars
=
parameter2int
(
operatorArgv
()[
4
]);
if
(
nruns
<
0
)
nruns
=
0
;
if
(
nruns
>
99
)
nruns
=
99
;
...
...
src/Change.c
View file @
ab505d88
...
...
@@ -85,7 +85,7 @@ void *Change(void *argument)
{
if
(
nch
%
2
)
cdoAbort
(
"Odd number of input arguments!"
);
for
(
i
=
0
;
i
<
nch
;
i
++
)
chints
[
i
]
=
atoi
(
operatorArgv
()[
i
]);
chints
[
i
]
=
parameter2int
(
operatorArgv
()[
i
]);
}
else
if
(
operatorID
==
CHPARAM
||
operatorID
==
CHNAME
||
operatorID
==
CHUNIT
)
{
...
...
@@ -103,7 +103,7 @@ void *Change(void *argument)
{
operatorCheckArgc
(
3
);
chcode
=
atoi
(
operatorArgv
()[
0
]);
chcode
=
parameter2int
(
operatorArgv
()[
0
]);
chlevels
[
0
]
=
parameter2double
(
operatorArgv
()[
1
]);
chlevels
[
1
]
=
parameter2double
(
operatorArgv
()[
2
]);
}
...
...
@@ -119,7 +119,7 @@ void *Change(void *argument)
{
if
(
nch
%
2
)
cdoAbort
(
"Odd number of input arguments!"
);
for
(
i
=
0
;
i
<
nch
;
i
++
)
chltypes
[
i
]
=
atoi
(
operatorArgv
()[
i
]);
chltypes
[
i
]
=
parameter2int
(
operatorArgv
()[
i
]);
}
streamID1
=
streamOpenRead
(
cdoStreamName
(
0
));
...
...
src/Duplicate.c
View file @
ab505d88
...
...
@@ -44,7 +44,7 @@ void *Duplicate(void *argument)
cdoInitialize
(
argument
);
if
(
operatorArgc
()
>
1
)
cdoAbort
(
"Too many arguments!"
);
else
if
(
operatorArgc
()
==
1
)
ndup
=
atoi
(
operatorArgv
()[
0
]);
else
if
(
operatorArgc
()
==
1
)
ndup
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
cdoVerbose
)
cdoPrint
(
"ndup = %d
\n
"
,
ndup
);
...
...
src/EOFs.c
View file @
ab505d88
...
...
@@ -115,7 +115,7 @@ void *EOFs(void * argument)
operfunc
=
cdoOperatorF1
(
operatorID
);
operatorInputArg
(
"Number of eigen functions to write out"
);
n_eig
=
atoi
(
operatorArgv
()[
0
]);
n_eig
=
parameter2int
(
operatorArgv
()[
0
]);
envstr
=
getenv
(
"CDO_SVD_MODE"
);
...
...
src/EcaIndices.c
View file @
ab505d88
...
...
@@ -352,7 +352,7 @@ void *EcaCwdi(void *argument)
cdoInitialize
(
argument
);
cdoOperatorAdd
(
"eca_cwdi"
,
0
,
31
,
NULL
);
if
(
operatorArgc
()
>
0
)
argN
=
atoi
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
0
)
argN
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
1
)
argT
=
parameter2double
(
operatorArgv
()[
1
]);
longname
=
(
char
*
)
malloc
(
strlen
(
CWDI_LONGNAME
)
+
80
);
...
...
@@ -394,7 +394,7 @@ void *EcaCwfi(void *argument)
cdoInitialize
(
argument
);
cdoOperatorAdd
(
"eca_cwfi"
,
0
,
31
,
NULL
);
if
(
operatorArgc
()
>
0
)
argN
=
atoi
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
0
)
argN
=
parameter2int
(
operatorArgv
()[
0
]);
longname
=
(
char
*
)
malloc
(
strlen
(
CWFI_LONGNAME
)
+
40
);
sprintf
(
longname
,
CWFI_LONGNAME
,
argN
);
...
...
@@ -494,7 +494,7 @@ void *EcaGsl(void *argument)
cdoInitialize
(
argument
);
cdoOperatorAdd
(
"eca_gsl"
,
0
,
10
,
NULL
);
if
(
operatorArgc
()
>
0
)
argN
=
atoi
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
0
)
argN
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
1
)
argT
=
parameter2double
(
operatorArgv
()[
1
]);
if
(
operatorArgc
()
>
2
)
minLandFraction
=
parameter2double
(
operatorArgv
()[
2
]);
...
...
@@ -573,7 +573,7 @@ void *EcaHwdi(void *argument)
cdoInitialize
(
argument
);
cdoOperatorAdd
(
"eca_hwdi"
,
0
,
31
,
NULL
);
if
(
operatorArgc
()
>
0
)
argN
=
atoi
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
0
)
argN
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
1
)
argT
=
parameter2double
(
operatorArgv
()[
1
]);
longname
=
(
char
*
)
malloc
(
strlen
(
HWDI_LONGNAME
)
+
80
);
...
...
@@ -615,7 +615,7 @@ void *EcaHwfi(void *argument)
cdoInitialize
(
argument
);
cdoOperatorAdd
(
"eca_hwfi"
,
0
,
31
,
NULL
);
if
(
operatorArgc
()
>
0
)
argN
=
atoi
(
operatorArgv
()[
0
]);
if
(
operatorArgc
()
>
0
)
argN
=
parameter2int
(
operatorArgv
()[
0
]);
longname
=
(
char
*
)
malloc
(
strlen
(
HWFI_LONGNAME
)
+
40
);
sprintf
(
longname
,
HWFI_LONGNAME
,
argN
);
...
...
src/Ensstat.c
View file @
ab505d88
...
...
@@ -86,7 +86,7 @@ void *Ensstat(void *argument)
if
(
operfunc
==
func_pctl
)
{
operatorInputArg
(
"percentile number"
);
pn
=
atoi
(
operatorArgv
()[
0
]);
pn
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
pn
<
1
||
pn
>
99
)
cdoAbort
(
"Illegal argument: percentile number %d is not in the range 1..99!"
,
pn
);
...
...
src/Ensstat3.c
View file @
ab505d88
...
...
@@ -101,7 +101,7 @@ void *Ensstat3(void *argument)
if
(
operfunc
==
func_roc
)
{
operatorInputArg
(
"Number of eigen functions to write out"
);
nbins
=
atoi
(
operatorArgv
()[
0
]);
nbins
=
parameter2int
(
operatorArgv
()[
0
]);
}
nfiles
=
cdoStreamCnt
()
-
1
;
...
...
src/Eof3d.c
View file @
ab505d88
...
...
@@ -111,7 +111,7 @@ void *EOF3d(void * argument)
operfunc
=
cdoOperatorF1
(
operatorID
);
operatorInputArg
(
"Number of eigen functions to write out"
);
n_eig
=
atoi
(
operatorArgv
()[
0
]);
n_eig
=
parameter2int
(
operatorArgv
()[
0
]);
envstr
=
getenv
(
"CDO_SVD_MODE"
);
...
...
src/Fldstat.c
View file @
ab505d88
...
...
@@ -120,7 +120,7 @@ void *Fldstat(void *argument)
if
(
operfunc
==
func_pctl
)
{
operatorInputArg
(
"percentile number"
);
pn
=
atoi
(
operatorArgv
()[
0
]);
pn
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
pn
<
1
||
pn
>
99
)
cdoAbort
(
"Illegal argument: percentile number %d is not in the range 1..99!"
,
pn
);
...
...
src/Fourier.c
View file @
ab505d88
...
...
@@ -56,7 +56,7 @@ void *Fourier(void *argument)
cdoInitialize
(
argument
);
operatorInputArg
(
"the sign of the exponent (-1 for normal or 1 for reverse transformation)!"
);
sign
=
atoi
(
operatorArgv
()[
0
]);
sign
=
parameter2int
(
operatorArgv
()[
0
]);
streamID1
=
streamOpenRead
(
cdoStreamName
(
0
));
...
...
src/Gradsdes.c
View file @
ab505d88
...
...
@@ -1022,7 +1022,7 @@ void *Gradsdes(void *argument)
if
(
operatorArgc
()
==
1
)
{
map_version
=
atoi
(
operatorArgv
()[
0
]);
map_version
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
map_version
!=
1
&&
map_version
!=
2
&&
map_version
!=
4
)
cdoAbort
(
"map_version=%d unsupported!"
,
map_version
);
}
...
...
src/Gridboxstat.c
View file @
ab505d88
...
...
@@ -576,8 +576,8 @@ void *Gridboxstat(void *argument)
operatorInputArg
(
"xinc, yinc"
);
operatorCheckArgc
(
2
);
xinc
=
atoi
(
operatorArgv
()[
0
]);
yinc
=
atoi
(
operatorArgv
()[
1
]);
xinc
=
parameter2int
(
operatorArgv
()[
0
]);
yinc
=
parameter2int
(
operatorArgv
()[
1
]);
cdoOperatorAdd
(
"gridboxmin"
,
func_min
,
0
,
NULL
);
cdoOperatorAdd
(
"gridboxmax"
,
func_max
,
0
,
NULL
);
...
...
src/Harmonic.c
View file @
ab505d88
...
...
@@ -58,8 +58,8 @@ void *Harmonic(void *argument)
operatorCheckArgc
(
2
);
n_out
=
atoi
(
operatorArgv
()[
0
]);
n
=
atoi
(
operatorArgv
()[
1
]);
n_out
=
parameter2int
(
operatorArgv
()[
0
]);
n
=
parameter2int
(
operatorArgv
()[
1
]);
if
(
n_out
>
9
)
cdoAbort
(
"Maximum number of wave numbers is 9!"
);
...
...
src/Intgrid.c
View file @
ab505d88
...
...
@@ -357,8 +357,8 @@ void *Intgrid(void *argument)
{
operatorInputArg
(
"xinc, yinc"
);
operatorCheckArgc
(
2
);
xinc
=
atoi
(
operatorArgv
()[
0
]);
yinc
=
atoi
(
operatorArgv
()[
1
]);
xinc
=
parameter2int
(
operatorArgv
()[
0
]);
yinc
=
parameter2int
(
operatorArgv
()[
1
]);
}
streamID1
=
streamOpenRead
(
cdoStreamName
(
0
));
...
...
src/Intntime.c
View file @
ab505d88
...
...
@@ -57,7 +57,7 @@ void *Intntime(void *argument)
operatorInputArg
(
"number of timesteps between 2 timesteps"
);
if
(
operatorArgc
()
<
1
)
cdoAbort
(
"Too few arguments!"
);
numts
=
atoi
(
operatorArgv
()[
0
]);
numts
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
numts
<
2
)
cdoAbort
(
"parameter must be greater than 1!"
);
streamID1
=
streamOpenRead
(
cdoStreamName
(
0
));
...
...
src/Merstat.c
View file @
ab505d88
...
...
@@ -74,7 +74,7 @@ void *Merstat(void *argument)
if
(
operfunc
==
func_pctl
)
{
operatorInputArg
(
"percentile number"
);
pn
=
atoi
(
operatorArgv
()[
0
]);
pn
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
pn
<
1
||
pn
>
99
)
cdoAbort
(
"Illegal argument: percentile number %d is not in the range 1..99!"
,
pn
);
...
...
src/Output.c
View file @
ab505d88
...
...
@@ -100,7 +100,7 @@ void *Output(void *argument)
if
(
operatorArgc
()
<
1
)
cdoAbort
(
"Too few arguments!"
);
format
=
operatorArgv
()[
0
];
if
(
operatorArgc
()
==
2
)
nelem
=
atoi
(
operatorArgv
()[
1
]);
if
(
operatorArgc
()
==
2
)
nelem
=
parameter2int
(
operatorArgv
()[
1
]);
}
else
if
(
operatorID
==
OUTPUTTAB
)
{
...
...
src/Outputgmt.c
View file @
ab505d88
...
...
@@ -640,7 +640,7 @@ void *Outputgmt(void *argument)
{
operatorInputArg
(
"increment"
);
operatorCheckArgc
(
1
);
ninc
=
atoi
(
operatorArgv
()[
0
]);
ninc
=
parameter2int
(
operatorArgv
()[
0
]);
if
(
ninc
<
1
)
cdoAbort
(
"Increment must be greater than 0!"
);
}
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment