Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for deprecated Boolean constructor #115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4445,7 +4445,7 @@ if test -n "$with_javac" ; then
# and if found, set OFP_JAVAC to to $with_javac (third arg) and if not, set it to
# no (arg 4).
TMP_JAVAC_BASE_NAME="`basename $with_javac`"
TMP_PATH=`echo $with_javac | sed "s/\/$TMP_JAVAC_BASE_NAME//"`
TMP_PATH=`echo $with_javac | sed "s/\/$TMP_JAVAC_BASE_NAME$//"`
# Extract the first word of "$TMP_JAVAC_BASE_NAME", so it can be a program name with args.
set dummy $TMP_JAVAC_BASE_NAME; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -4586,7 +4586,7 @@ if test -n "$with_java" ; then
# and if found, set OFP_JAVA to to $with_java (third arg) and if not, set it to
# no (arg 4).
TMP_JAVA_BASE_NAME="`basename $with_java`"
TMP_PATH=`echo $with_java | sed "s/\/$TMP_JAVA_BASE_NAME//"`
TMP_PATH=`echo $with_java | sed "s/\/$TMP_JAVA_BASE_NAME$//"`
# Extract the first word of "$TMP_JAVA_BASE_NAME", so it can be a program name with args.
set dummy $TMP_JAVA_BASE_NAME; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down
6 changes: 3 additions & 3 deletions src/fortran/ofp/FrontEnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public static void main(String args[]) throws Exception {
File srcFile = new File(args[i]);
if (srcFile.exists() == false) {
System.err.println("Error: " + args[i] + " does not exist!");
error = new Boolean(true);
error = true;
} else {
includeDirs.add(srcFile.getParent());
FrontEnd ofp = new FrontEnd(newArgs.toArray(new String[newArgs.size()]), args[i], type);
Expand Down Expand Up @@ -420,7 +420,7 @@ public Boolean call() throws Exception {
// see if we successfully parse the program unit or not
if (verbose && error) {
System.out.println("Parser failed");
return new Boolean(error);
return error;
}
} // end while (not end of file)

Expand All @@ -437,7 +437,7 @@ public Boolean call() throws Exception {
System.out.println("Parser exiting normally");
}

return new Boolean(error);
return error;
} // end call()

public int getSourceForm() {
Expand Down
10 changes: 7 additions & 3 deletions src/fortran/ofp/parser/c/jni/c_main_ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ extern "C" {
#define ERROR_CODE 4

/* These should be defined in jni.h. */
#ifndef JNI_VERSION_1_8
#define JNI_VERSION_1_8 8
#endif
#ifndef JNI_VERSION_1_6
#define JNI_VERSION_1_6 6
#endif
Expand Down Expand Up @@ -99,7 +102,9 @@ extern "C" {
jni_version = getenv("JNI_VERSION");
if(jni_version)
{
if(strcmp(jni_version, "1.6") == 0)
if(strcmp(jni_version, "1.8") == 0)
jvm_args.version = JNI_VERSION_1_8;
else if(strcmp(jni_version, "1.8") == 0)
jvm_args.version = JNI_VERSION_1_6;
else if(strcmp(jni_version, "1.4") == 0)
jvm_args.version = JNI_VERSION_1_4;
Expand Down Expand Up @@ -175,15 +180,14 @@ extern "C" {

/* Get the error status from the 'boolean getError()' method. */
errorMethodID = (*env)->GetStaticMethodID(env, ofp_class, "getError", "()Z");
retval = (*env)->CallBooleanMethod(env, new_ofp_class, errorMethodID);
retval = (*env)->CallStaticBooleanMethod(env, new_ofp_class, errorMethodID);
}

/* We're done; destroy the Java VM. */
(*jvm)->DestroyJavaVM(jvm);

/* Cleanup any memory we allocated. */
free(classpath);

return (retval == JNI_TRUE ? ERROR_CODE : 0);
}

Expand Down
13 changes: 13 additions & 0 deletions src/fortran/ofp/parser/java/FortranStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ private void convertFreeFormInputBuffer()

char[] newData = new char[super.n];
boolean continuation = false;
int continueline = 0;
int count = 0;
int col = 1; // 1 based
int line = 1; // 1 based
Expand Down Expand Up @@ -325,6 +326,7 @@ else if (matchFreeFormString(i, data)) {
index_count = consumeFreeFormString(i, data, count, newData);
ii = index_count[0]; count = index_count[1];
while (data[ii] == '&') {
continueline += 1;
// string is continued across multiple lines
line += 1;
col += ii - i;
Expand Down Expand Up @@ -359,6 +361,14 @@ else if (matchFreeFormString(i, data)) {
col += 1;
}
newData[count++] = data[i];
if(continueline > 0 && data[i] == '\n')
{
while(continueline > 0)
{
continueline -= 1;
newData[count++] = '\n';
}
}
}

// this line is to be continued
Expand All @@ -368,6 +378,9 @@ else if (matchFreeFormString(i, data)) {
}

// switch to new data buffer
// System.out.println(this.data);
// System.out.println("================");
// System.out.println(newData);
this.data = newData;
this.n = count;
}
Expand Down