diff --git a/ChangeLog b/ChangeLog index 8bff26d3..257b40d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2023-05-31 OSS Consortium + + * opensource COBOL 4J v1.0.11 released. + 2023-04-28 OSS Consortium * opensource COBOL 4J v1.0.10 released. diff --git a/NEWS b/NEWS index 3dbb9fc8..103d8d4d 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,18 @@ NEWS - user visible changes -*- outline -*- ----------------------------------------------------------------------- +* opensource COBOL 4J 1.0.11 + +** New Features + (1) Add -j and -java-source-dir options to control the file paths where Java files are generated + (2) Add -o and -class-file-dir options to control the file paths where class files are generated + +** Bug fixes + (1) Fix a bug related to RELATIVE files + (2) Fix a minor bug + +----------------------------------------------------------------------- + * opensource COBOL 4J 1.0.10 ** Bug fixes diff --git a/cobj/cobj.c b/cobj/cobj.c index 32be6d98..55bab9ce 100644 --- a/cobj/cobj.c +++ b/cobj/cobj.c @@ -765,10 +765,8 @@ static void cobc_print_usage(void) { puts(_(" -free_1col_aster Use free(1col_aster) source " "format")); puts(_(" -g Enable Java compiler debug")); - puts(_(" -o Place class files into ")); - puts(_(" -class-file-dir= Place class files into ")); - puts(_(" -j Place java files into ")); - puts(_(" -java-source-dir= Place java files into ")); + puts(_(" -o , -class-file-dir= Place class files into ")); + puts(_(" -j , -java-source-dir= Place Java files into ")); puts(_(" -E Preprocess only; do not compile " "or link")); puts(_(" -C Translation only; convert COBOL " @@ -834,18 +832,6 @@ static int process_command_line(const int argc, char *argv[]) { } } - /*while(c = getopt(argc, argv, short_options)) { - switch(c) { - case 'o': - output_name = strdup(optarg); - break; - - case 'j': - java_source_dir = strdup(optarg); - break; - } - }*/ - while ((c = getopt_long_only(argc, argv, short_options, long_options, &idx)) >= 0) { switch (c) { @@ -942,7 +928,7 @@ static int process_command_line(const int argc, char *argv[]) { case 'j': /* -j : the directory where java files are stored */ - /* -java-file-dir : the directory where java files are stored */ + /* -java-source-dir : the directory where java files are stored */ java_source_dir = strdup(optarg); break; diff --git a/configure b/configure index 3b7194d6..655a4f15 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.10. +# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.11. # # Report bugs to . # @@ -620,9 +620,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='opensource COBOL 4J' -PACKAGE_TARNAME='opensource-cobol-4j-1.0.10' -PACKAGE_VERSION='1.0.10' -PACKAGE_STRING='opensource COBOL 4J 1.0.10' +PACKAGE_TARNAME='opensource-cobol-4j-1.0.11' +PACKAGE_VERSION='1.0.11' +PACKAGE_STRING='opensource COBOL 4J 1.0.11' PACKAGE_BUGREPORT='ws-opensource-cobol-contact@osscons.jp' PACKAGE_URL='' @@ -1414,7 +1414,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures opensource COBOL 4J 1.0.10 to adapt to many kinds of systems. +\`configure' configures opensource COBOL 4J 1.0.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1464,7 +1464,7 @@ Fine tuning of the installation directories: --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root - [DATAROOTDIR/doc/opensource-cobol-4j-1.0.10] + [DATAROOTDIR/doc/opensource-cobol-4j-1.0.11] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1486,7 +1486,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.10:";; + short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.11:";; esac cat <<\_ACEOF @@ -1617,7 +1617,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -opensource COBOL 4J configure 1.0.10 +opensource COBOL 4J configure 1.0.11 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2105,7 +2105,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by opensource COBOL 4J $as_me 1.0.10, which was +It was created by opensource COBOL 4J $as_me 1.0.11, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3403,8 +3403,8 @@ fi # Define the identity of the package. - PACKAGE='opensource-cobol-4j-1.0.10' - VERSION='1.0.10' + PACKAGE='opensource-cobol-4j-1.0.11' + VERSION='1.0.11' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -25367,7 +25367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by opensource COBOL 4J $as_me 1.0.10, which was +This file was extended by opensource COBOL 4J $as_me 1.0.11, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25435,7 +25435,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -opensource COBOL 4J config.status 1.0.10 +opensource COBOL 4J config.status 1.0.11 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 83a86f06..524e22a5 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AC_PREREQ(2.59) -AC_INIT([opensource COBOL 4J],[1.0.10],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.0.10]) +AC_INIT([opensource COBOL 4J],[1.0.11],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.0.11]) AC_CONFIG_SRCDIR([libcob.h]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_TESTDIR([tests]) diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java index 8ea67a9d..bd85c5a5 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java @@ -40,7 +40,7 @@ public abstract class AbstractCobolField { static CobolDataStorage lastdata = null; static final int[] cobExp10 = { - 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 + 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; /** @@ -48,15 +48,14 @@ public abstract class AbstractCobolField { * * @author y-sakamoto */ - protected class GotoException extends Exception { - } + protected class GotoException extends Exception {} /** * コンストラクタ * - * @param size データを格納するバイト配列の長さ + * @param size データを格納するバイト配列の長さ * @param dataStorage データを格納するバイト配列を扱うオブジェクト - * @param attribute 変数に関する様々な情報を保持するオブジェクト(符号付か,COMP-3指定かなど) + * @param attribute 変数に関する様々な情報を保持するオブジェクト(符号付か,COMP-3指定かなど) */ public AbstractCobolField(int size, CobolDataStorage dataStorage, CobolFieldAttribute attribute) { this.size = size; @@ -64,8 +63,7 @@ public AbstractCobolField(int size, CobolDataStorage dataStorage, CobolFieldAttr this.attribute = attribute; } - public AbstractCobolField() { - } + public AbstractCobolField() {} /** * メンバ変数dataStorageのgetter @@ -131,8 +129,7 @@ public CobolDataStorage getFieldData() { } /** - * opensource COBOLのCOB_FIELD_DATAに相当するメソッド - * バイト配列の中で(符号データではなく)数値データの格納されている最小の添え字を返す opensource + * opensource COBOLのCOB_FIELD_DATAに相当するメソッド バイト配列の中で(符号データではなく)数値データの格納されている最小の添え字を返す opensource * COBOLではポインタを返しているが,このメソッドは添え字を返す * * @return SIGN_LEADINGかつSIGN_SEPARATEなら1,それ以外は0 @@ -142,12 +139,13 @@ public int getFirstDataIndex() { } public byte[] getBytes() { - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, - 9, - 0, - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - null); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, + 9, + 0, + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + null); CobolDataStorage n = new CobolDataStorage(new byte[4], 0); AbstractCobolField temp = CobolFieldFactory.makeCobolField(4, n, attr); temp.moveFrom(this); @@ -165,12 +163,13 @@ public byte[] getBytes() { * @return */ public int getInt() { - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, - 9, - 0, - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - null); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, + 9, + 0, + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + null); CobolDataStorage n = new CobolDataStorage(new byte[4], 0); AbstractCobolField temp = CobolFieldFactory.makeCobolField(4, n, attr); temp.moveFrom(this); @@ -281,7 +280,7 @@ public void setZero() { * libcob/numeric.cのcob_addの実装 thisの保持する数値データに,引数で与えられたフィールドの保持する数値データを加算する * * @param field 加算する数値を保持するフィールド - * @param opt 加算に関するオプション.詳しくはopensourceCOBOLを参照 + * @param opt 加算に関するオプション.詳しくはopensourceCOBOLを参照 * @return 加算後のthisの保持する数値データ */ public int add(AbstractCobolField field, int opt) throws CobolStopRunException { @@ -295,7 +294,7 @@ public int add(AbstractCobolField field, int opt) throws CobolStopRunException { * libcob/numeric.cのcob_subの実装 thisの保持する数値データに,引数で与えられたフィールドの保持する数値データを減算する * * @param field 減算する数値を保持するフィールド - * @param opt 減算に関するオプション.詳しくはopensourceCOBOLを参照 + * @param opt 減算に関するオプション.詳しくはopensourceCOBOLを参照 * @return 減算後のthisの保持する数値データ */ public int sub(AbstractCobolField field, int opt) throws CobolStopRunException { @@ -620,12 +619,13 @@ public void moveFrom(String s) { CobolDataStorage storage = new CobolDataStorage(bytes.length); storage.memcpy(bytes); - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_ALPHANUMERIC, - bytes.length, - 0, - 0, - String.format("X(%d)", bytes.length)); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_ALPHANUMERIC, + bytes.length, + 0, + 0, + String.format("X(%d)", bytes.length)); AbstractCobolField tmp = CobolFieldFactory.makeCobolField(bytes.length, storage, attr); this.moveFrom(tmp); @@ -647,12 +647,13 @@ public void moveFrom(int number) { storage.setByte(length - 1, (byte) (storage.getByte(length - 1) + 0x40)); } - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, - length, - 0, - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - "S9(10)"); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, + length, + 0, + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + "S9(10)"); AbstractCobolField tmp = CobolFieldFactory.makeCobolField(length, storage, attr); this.moveFrom(tmp); @@ -679,12 +680,13 @@ public void moveFrom(double number) { CobolDataStorage storage = new CobolDataStorage(ss.length()); storage.memcpy(ss, ss.length()); - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, - ss.length(), - scale, - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - ""); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, + ss.length(), + scale, + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + ""); AbstractCobolField tmp = CobolFieldFactory.makeCobolField(ss.length(), storage, attr); if (number < 0) { @@ -705,8 +707,7 @@ public void moveFrom(double number) { * * @param s */ - public void checkNumeric(String s) { - } + public void checkNumeric(String s) {} // TODO abstract指定 /** @@ -839,22 +840,24 @@ private AbstractCobolField numericFieldToNumericDisplayField(AbstractCobolField CobolDataStorage data = new CobolDataStorage(48); if (attr.isTypeNumeric()) { if (!attr.isTypeNumericDisplay()) { - CobolFieldAttribute newAttr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, - attr.getDigits(), - attr.getScale(), - attr.getFlags() & (~CobolFieldAttribute.COB_FLAG_HAVE_SIGN), - attr.getPic()); + CobolFieldAttribute newAttr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, + attr.getDigits(), + attr.getScale(), + attr.getFlags() & (~CobolFieldAttribute.COB_FLAG_HAVE_SIGN), + attr.getPic()); CobolNumericField temp = new CobolNumericField(attr.getDigits(), data, newAttr); temp.moveFrom(field); field = temp; } else if (attr.isFlagHaveSign()) { - CobolFieldAttribute newAttr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, - attr.getDigits(), - attr.getScale(), - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - attr.getPic()); + CobolFieldAttribute newAttr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY, + attr.getDigits(), + attr.getScale(), + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + attr.getPic()); CobolNumericField temp = new CobolNumericField(attr.getDigits(), data, newAttr); temp.moveFrom(field); field = temp; @@ -1018,8 +1021,7 @@ public String toString() { } /** - * libcob/common.cのcob_field_to_stringの実装 TODO - * CobolNationalFieldでオーバーライドしなくても済むように修正する. + * libcob/common.cのcob_field_to_stringの実装 TODO CobolNationalFieldでオーバーライドしなくても済むように修正する. * * @return this.dataの保持するデータを文字列にして返す. */ @@ -1036,12 +1038,13 @@ public String fieldToString() { /** libcob/move.cのcob_set_intの実装 */ public void setInt(int n) { - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, - 9, - 0, - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - null); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, + 9, + 0, + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + null); CobolDataStorage data = new CobolDataStorage(ByteBuffer.allocate(4).putInt(n).array()); AbstractCobolField temp = CobolFieldFactory.makeCobolField(4, data, attr); this.moveFrom(temp); @@ -1059,8 +1062,10 @@ public void setInt(CobolDataStorage data) { * @param size */ public void memcpy(byte[] src, int size) { - CobolFieldAttribute attr = new CobolFieldAttribute(CobolFieldAttribute.COB_TYPE_ALPHANUMERIC, 0, 0, 0, null); - AbstractCobolField temp = CobolFieldFactory.makeCobolField(size, new CobolDataStorage(src), attr); + CobolFieldAttribute attr = + new CobolFieldAttribute(CobolFieldAttribute.COB_TYPE_ALPHANUMERIC, 0, 0, 0, null); + AbstractCobolField temp = + CobolFieldFactory.makeCobolField(size, new CobolDataStorage(src), attr); this.moveFrom(temp); } @@ -1257,13 +1262,14 @@ public int cmpAll(AbstractCobolField other) { int sign = 0; if ((this.getAttribute().getType() == CobolFieldAttribute.COB_TYPE_ALPHANUMERIC_ALL - || this.getAttribute().getType() == CobolFieldAttribute.COB_TYPE_NATIONAL_ALL) + || this.getAttribute().getType() == CobolFieldAttribute.COB_TYPE_NATIONAL_ALL) && this.getSize() < other.getSize()) { int size = other.getSize(); CobolDataStorage data = other.getDataStorage(); sign = other.getSign(); CobolDataStorage s = CobolModule.getCurrentModule().collating_sequence; - OUTSIDE: do { + OUTSIDE: + do { while (size >= this.getSize()) { ret = comparator.compare(this.getDataStorage(), data, this.getSize(), s); if (ret != 0) { @@ -1281,7 +1287,8 @@ public int cmpAll(AbstractCobolField other) { CobolDataStorage data = this.getDataStorage(); sign = this.getSign(); CobolDataStorage s = CobolModule.getCurrentModule().collating_sequence; - OUTSIDE: do { + OUTSIDE: + do { while (size >= other.getSize()) { ret = comparator.compare(data, other.getDataStorage(), other.getSize(), s); if (ret != 0) { @@ -1323,13 +1330,15 @@ public int cmpSimpleStr(AbstractCobolField other) { if (ret == 0) { if (lf.getSize() > sf.getSize()) { if ((lf.getAttribute().getType() & CobolFieldAttribute.COB_TYPE_NATIONAL) != 0) { - ret = CobolUtil.isNationalPadding( - lf.getDataStorage().getSubDataStorage(sf.getSize()), lf.getSize() - sf.getSize()); + ret = + CobolUtil.isNationalPadding( + lf.getDataStorage().getSubDataStorage(sf.getSize()), lf.getSize() - sf.getSize()); } else { - ret = CobolUtil.commonCmpc( - lf.getDataStorage().getSubDataStorage(sf.getSize()), - (byte) ' ', - lf.getSize() - sf.getSize()); + ret = + CobolUtil.commonCmpc( + lf.getDataStorage().getSubDataStorage(sf.getSize()), + (byte) ' ', + lf.getSize() - sf.getSize()); } if (this.getSize() < other.getSize()) { ret = -ret; @@ -1466,12 +1475,13 @@ public void realPutSign(int sign) { */ public long getLong() { long n; - CobolFieldAttribute attr = new CobolFieldAttribute( - CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, - 18, - 0, - CobolFieldAttribute.COB_FLAG_HAVE_SIGN, - null); + CobolFieldAttribute attr = + new CobolFieldAttribute( + CobolFieldAttribute.COB_TYPE_NUMERIC_BINARY, + 18, + 0, + CobolFieldAttribute.COB_FLAG_HAVE_SIGN, + null); byte[] data = new byte[8]; CobolDataStorage storage = new CobolDataStorage(data); AbstractCobolField field = CobolFieldFactory.makeCobolField(8, storage, attr); @@ -1483,8 +1493,7 @@ public long getLongValue() { return 0; } - public void setLongValue(long n) { - } + public void setLongValue(long n) {} /** * libcob/move.cのcob_hankaku_moveの実装 diff --git a/tests/package.m4 b/tests/package.m4 index c5b3d416..172aeefc 100644 --- a/tests/package.m4 +++ b/tests/package.m4 @@ -1,6 +1,6 @@ # Signature of the current package. m4_define([AT_PACKAGE_NAME], [opensource COBOL 4J]) -m4_define([AT_PACKAGE_TARNAME], [opensource-cobol-4j-1.0.10]) -m4_define([AT_PACKAGE_VERSION], [1.0.10]) -m4_define([AT_PACKAGE_STRING], [opensource COBOL 4J 1.0.10]) +m4_define([AT_PACKAGE_TARNAME], [opensource-cobol-4j-1.0.11]) +m4_define([AT_PACKAGE_VERSION], [1.0.11]) +m4_define([AT_PACKAGE_STRING], [opensource COBOL 4J 1.0.11]) m4_define([AT_PACKAGE_BUGREPORT], [ws-opensource-cobol-contact@osscons.jp])