Skip to content

Commit cb3cedc

Browse files
committed
refactor(cobc):ゼロ除算のコンフィグ名称を変更
#39 で追加したゼロ除算機能のコンフィグでのパラメータ名称を、他のオプションと同様になるように修正した
1 parent e9573d6 commit cb3cedc

File tree

7 files changed

+21
-22
lines changed

7 files changed

+21
-22
lines changed

cobc/codegen.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
* it under the terms of the GNU General Public License as published by
77
* the Free Software Foundation; either version 2, or (at your option)
88
* any later version.
9-
*
9+
*
1010
* This program is distributed in the hope that it will be useful,
1111
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1212
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
14-
*
14+
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this software; see the file COPYING. If not, write to
1717
* the Free Software Foundation, 51 Franklin Street, Fifth Floor
@@ -1594,7 +1594,7 @@ initialize_type (struct cb_initialize *p, struct cb_field *f, int topfield)
15941594
} else if (cb_tree_type (CB_TREE (f)) == COB_TYPE_NUMERIC_DISPLAY) {
15951595
if (f->flag_sign_separate) {
15961596
return INITIALIZE_ONE;
1597-
} else if (cb_display_sign == COB_DISPLAY_SIGN_EBCDIC
1597+
} else if (cb_display_sign == COB_DISPLAY_SIGN_EBCDIC
15981598
&& f->pic->have_sign) {
15991599
return INITIALIZE_ONE;
16001600
} else {
@@ -3267,7 +3267,7 @@ output_stmt (cb_tree x)
32673267
output_line ("cob_exception_code = 0;");
32683268
}
32693269

3270-
if (cb_zero_division_error && p->name &&
3270+
if (cb_enable_zero_division_error && p->name &&
32713271
((strcmp (p->name, "DIVIDE") == 0) || (strcmp (p->name, "COMPUTE") == 0)) &&
32723272
(!p->handler1 && !p->handler2)) {
32733273
output_line ("cob_error_on_exit_flag = 1;");

cobc/config.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
* it under the terms of the GNU General Public License as published by
77
* the Free Software Foundation; either version 2, or (at your option)
88
* any later version.
9-
*
9+
*
1010
* This program is distributed in the hope that it will be useful,
1111
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1212
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
* GNU General Public License for more details.
14-
*
14+
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this software; see the file COPYING. If not, write to
1717
* the Free Software Foundation, 51 Franklin Street, Fifth Floor
@@ -59,7 +59,7 @@ CB_CONFIG_BOOLEAN (cb_switch_no_mnemonic, "switch-no-mnemonic")
5959
CB_CONFIG_BOOLEAN (cb_allow_is_in_sort_key_spec, "allow-is-in-sort-key-spec")
6060
CB_CONFIG_BOOLEAN (cb_allow_search_key_in_rhs, "allow-search-key-in-rhs")
6161
CB_CONFIG_BOOLEAN (cb_ignore_invalid_record_contains, "ignore-invalid-record-contains")
62-
CB_CONFIG_BOOLEAN (cb_zero_division_error, "zero_division_error")
62+
CB_CONFIG_BOOLEAN (cb_enable_zero_division_error, "enable-zero-division-error")
6363
CB_CONFIG_BOOLEAN (cb_enable_check_subscript_out_of_bounds, "enable-check-subscript-out-of-bounds")
6464
CB_CONFIG_BOOLEAN (cb_enable_expect_numeric_error, "enable-expect-numeric-error")
6565
CB_CONFIG_BOOLEAN (cb_enable_expect_compute_string_error, "enable-expect-compute-string-error")

cobc/tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ cb_build_picture (const char *str)
13241324
if (count_value == 0) {
13251325
goto error;
13261326
} else if (count_value == CHARACTER_LENGTH_OVERFLOW) {
1327-
n = CHARACTER_LENGTH_OVERFLOW;
1327+
n = CHARACTER_LENGTH_OVERFLOW;
13281328
} else if (n != CHARACTER_LENGTH_OVERFLOW) {
13291329
remain = INT_MAX - n;
13301330
if (remain < (count_value - 1)) {
@@ -1837,7 +1837,7 @@ static void
18371837
compute_composite_key (cb_tree key, struct cb_key_component *component_list)
18381838
{
18391839
int cb;
1840-
char pic[32];
1840+
char pic[32];
18411841
struct cb_key_component *key_component;
18421842
struct cb_field *composite_key;
18431843

@@ -1883,7 +1883,7 @@ finalize_file (struct cb_file *f, struct cb_field *records)
18831883
compute_composite_key (alt_key->key, alt_key->component_list);
18841884
}
18851885
}
1886-
}
1886+
}
18871887

18881888
/* check the record size if it is limited */
18891889
if (cb_ignore_invalid_record_contains) {
@@ -2251,7 +2251,7 @@ cb_build_binary_op (cb_tree x, int op, cb_tree y)
22512251
if (x == cb_error_node || y == cb_error_node) {
22522252
return cb_error_node;
22532253
}
2254-
if (cb_zero_division_error && op == '/') {
2254+
if (cb_enable_zero_division_error && op == '/') {
22552255
y = cb_check_zero_division (y);
22562256
if (y == cb_error_node) {
22572257
return cb_error_node;

config/default-en.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ assign-clause: mf
2222
# 3. the value of environment variable 'DATAFILE' or
2323
# 4. the literal "DATAFILE"
2424
# If no, the value of the assign clause is the file name.
25-
#
25+
#
2626
# Value: 'yes', 'no'
2727
filename-mapping: yes
2828

@@ -87,7 +87,7 @@ sticky-linkage: no
8787

8888
# If yes, set the file assign to the external file
8989
# Value: 'yes', 'no'
90-
assign_external: no
90+
assign_external: no
9191

9292
# If yes, allow non-matching level numbers
9393
# Value: 'yes', 'no'
@@ -147,7 +147,7 @@ switch-no-mnemonic: no
147147
allow-is-in-sort-key-spec: no
148148
allow-search-key-in-rhs: no
149149
ignore-invalid-record-contains: no
150-
zero_division_error: no
150+
enable-zero-division-error: no
151151
enable-check-subscript-out-of-bounds: yes
152152
enable-expect-numeric-error: yes
153153
enable-expect-compute-string-error: yes

config/default-jp.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ assign-clause: mf
2222
# 3. the value of environment variable 'DATAFILE' or
2323
# 4. the literal "DATAFILE"
2424
# If no, the value of the assign clause is the file name.
25-
#
25+
#
2626
# Value: 'yes', 'no'
2727
filename-mapping: yes
2828

@@ -87,7 +87,7 @@ sticky-linkage: no
8787

8888
# If yes, set the file assign to the external file
8989
# Value: 'yes', 'no'
90-
assign_external: no
90+
assign_external: no
9191

9292
# If yes, allow non-matching level numbers
9393
# Value: 'yes', 'no'
@@ -147,7 +147,7 @@ switch-no-mnemonic: no
147147
allow-is-in-sort-key-spec: no
148148
allow-search-key-in-rhs: no
149149
ignore-invalid-record-contains: no
150-
zero_division_error: yes
150+
enable-zero-division-error: yes
151151
enable-check-subscript-out-of-bounds: yes
152152
enable-expect-numeric-error: yes
153153
enable-expect-compute-string-error: yes

config/default.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ assign-clause: mf
2222
# 3. the value of environment variable 'DATAFILE' or
2323
# 4. the literal "DATAFILE"
2424
# If no, the value of the assign clause is the file name.
25-
#
25+
#
2626
# Value: 'yes', 'no'
2727
filename-mapping: yes
2828

@@ -87,7 +87,7 @@ sticky-linkage: no
8787

8888
# If yes, set the file assign to the external file
8989
# Value: 'yes', 'no'
90-
assign_external: no
90+
assign_external: no
9191

9292
# If yes, allow non-matching level numbers
9393
# Value: 'yes', 'no'
@@ -147,7 +147,7 @@ switch-no-mnemonic: no
147147
allow-is-in-sort-key-spec: no
148148
allow-search-key-in-rhs: no
149149
ignore-invalid-record-contains: no
150-
zero_division_error: no
150+
enable-zero-division-error: no
151151
enable-check-subscript-out-of-bounds: no
152152
enable-expect-numeric-error: no
153153
enable-expect-compute-string-error: no

config/jp-compat.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ switch-no-mnemonic: yes
2222
allow-is-in-sort-key-spec: yes
2323
allow-search-key-in-rhs: yes
2424
ignore-invalid-record-contains: yes
25-
zero_division_error: yes
25+
enable-zero-division-error: yes
2626
enable-check-subscript-out-of-bounds: yes
2727
enable-expect-numeric-error: yes
2828
enable-expect-compute-string-error: yes
2929

3030
# Value: 'any', 'fatal', 'never'
3131
abort-on-io-exception: fatal
32-

0 commit comments

Comments
 (0)