Skip to content

Commit b36ab07

Browse files
Implement NUMBER-OF-PARAMETERS (#270)
1 parent 691c4c4 commit b36ab07

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1414
* Add intrinsic functions
1515
* `C$CALLEDBY` (#262)
1616
* `C$LIST-DIRECTORY` (#264)
17+
* Implement `NUMBER-OF-PARAMETERS` (#270)
1718
### Fixed
1819
* Fix the message of COB_VERBOSE file sort (#260)
1920
* Fix the process that checks MOVE statements (#266, #267)

cobj/codegen.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,7 @@ static void joutput_call(struct cb_call *p) {
29022902
}
29032903
}
29042904
joutput(");\n");
2905+
joutput_line("CobolCallParams.callParams = %d;", (int)n);
29052906

29062907
if (!dynamic_link) {
29072908
if (CB_REFERENCE_P(p->name) && CB_FIELD_P(CB_REFERENCE(p->name)->value) &&
@@ -4677,12 +4678,13 @@ static void joutput_internal_function(struct cb_program *prog,
46774678
// output_newline ();
46784679
// }
46794680

4680-
// if (cb_field (current_prog->cb_call_params)->count) {
4681-
// output_line ("/* Initialize number of call params */");
4682-
// output (" ");
4683-
// output_integer (current_prog->cb_call_params);
4684-
// output_line (" = cob_call_params;");
4685-
// }
4681+
if (cb_field(current_prog->cb_call_params)->count) {
4682+
joutput_line("/* Initialize number of call params */");
4683+
joutput_prefix();
4684+
joutput_param(current_prog->cb_call_params, -1);
4685+
joutput(".setInt(CobolCallParams.callParams);");
4686+
joutput_newline();
4687+
}
46864688
// output_line ("cob_save_call_params = cob_call_params;");
46874689
// output_newline ();
46884690
if (cb_flag_traceall) {

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/CobolCallParams.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@
1818
*/
1919
package jp.osscons.opensourcecobol.libcobj.common;
2020

21-
public class CobolCallParams {}
21+
public class CobolCallParams {
22+
public static int callParams = 0;
23+
}

tests/run.src/extensions.at

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ AT_CLEANUP
748748
# Number of call parameters
749749

750750
AT_SETUP([NUMBER-OF-CALL-PARAMETERS])
751-
AT_CHECK([${SKIP_TEST}])
752751

753752
AT_DATA([callee.cob], [
754753
IDENTIFICATION DIVISION.

0 commit comments

Comments
 (0)