summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorrschuster <rschuster@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-21 10:32:31 +0000
committerrschuster <rschuster@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-21 10:32:31 +0000
commit7a41c575e395e7b6d2b5bb79d9aa9cc3d5070bcf (patch)
treea94a9736eee084631b817aa6a3374972ac8bb77f /libjava
parente5ce4771220d67c38e87cbefc87f12e83b74c930 (diff)
downloadgcc-7a41c575e395e7b6d2b5bb79d9aa9cc3d5070bcf.tar.gz
2006-02-21 Robert Schuster <robertschuster@fsfe.org>
* link.cc: Added variant of create_error_method that will not complain about unused parameter if compiled with USE_LIBFFI not being defined. (_Jv_Linker::find_field_helper): Fixed indentation. (_Jv_Linker::create_error_method): Fixed indentation. (_Jv_Linker::link_symbol_table): Fixed indentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111331 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog9
-rw-r--r--libjava/link.cc32
2 files changed, 27 insertions, 14 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 2e1438929db..d96d0316a41 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,12 @@
+2006-02-21 Robert Schuster <robertschuster@fsfe.org>
+
+ * link.cc: Added variant of create_error_method that
+ will not complain about unused parameter if compiled with
+ USE_LIBFFI not being defined.
+ (_Jv_Linker::find_field_helper): Fixed indentation.
+ (_Jv_Linker::create_error_method): Fixed indentation.
+ (_Jv_Linker::link_symbol_table): Fixed indentation.
+
2006-02-16 Andrew Haley <aph@redhat.com>
* stacktrace.cc (GetStackTraceElements): Call
diff --git a/libjava/link.cc b/libjava/link.cc
index 481f98a138b..e1dc23f5bcb 100644
--- a/libjava/link.cc
+++ b/libjava/link.cc
@@ -142,10 +142,10 @@ _Jv_Linker::find_field_helper (jclass search, _Jv_Utf8Const *name,
// pass in the descriptor and check that way, because when
// the field is already resolved there is no easy way to
// find its descriptor again.
- if ( (field->isResolved () ?
- _Jv_equalUtf8Classnames (type_name, field->type->name) :
- _Jv_equalUtf8Classnames (
- type_name, (_Jv_Utf8Const *) field->type)) )
+ if ((field->isResolved ()
+ ? _Jv_equalUtf8Classnames (type_name, field->type->name)
+ : _Jv_equalUtf8Classnames (type_name,
+ (_Jv_Utf8Const *) field->type)))
{
*declarer = search;
return field;
@@ -771,7 +771,7 @@ _Jv_ThrowNoClassDefFoundErrorTrampoline(ffi_cif *,
void *data)
{
throw new java::lang::NoClassDefFoundError(
- _Jv_NewStringUtf8Const( (_Jv_Utf8Const *) data));
+ _Jv_NewStringUtf8Const((_Jv_Utf8Const *) data));
}
#else
// A variant of the NoClassDefFoundError throwing method that can
@@ -947,7 +947,6 @@ _Jv_Linker::find_iindex (jclass *ifaces, jshort *offsets, jshort num)
}
#ifdef USE_LIBFFI
-
// We use a structure of this type to store the closure that
// represents a missing method.
struct method_closure
@@ -960,12 +959,9 @@ struct method_closure
ffi_type *arg_types[1];
};
-#endif // USE_LIBFFI
-
void *
_Jv_Linker::create_error_method (_Jv_Utf8Const *class_name)
{
-#ifdef USE_LIBFFI
method_closure *closure
= (method_closure *) _Jv_AllocBytes(sizeof (method_closure));
@@ -974,9 +970,13 @@ _Jv_Linker::create_error_method (_Jv_Utf8Const *class_name)
// Initializes the cif and the closure. If that worked the closure
// is returned and can be used as a function pointer in a class'
// atable.
- if (ffi_prep_cif (&closure->cif, FFI_DEFAULT_ABI, 1, &ffi_type_void,
- closure->arg_types) == FFI_OK
- && ffi_prep_closure (&closure->closure, &closure->cif,
+ if ( ffi_prep_cif (&closure->cif,
+ FFI_DEFAULT_ABI,
+ 1,
+ &ffi_type_void,
+ closure->arg_types) == FFI_OK
+ && ffi_prep_closure (&closure->closure,
+ &closure->cif,
_Jv_ThrowNoClassDefFoundErrorTrampoline,
class_name) == FFI_OK)
return &closure->closure;
@@ -989,13 +989,17 @@ _Jv_Linker::create_error_method (_Jv_Utf8Const *class_name)
buffer->append (_Jv_NewStringUtf8Const(class_name));
throw new java::lang::InternalError(buffer->toString());
}
+}
#else
+void *
+_Jv_Linker::create_error_method (_Jv_Utf8Const *)
+{
// Codepath for platforms which do not support (or want) libffi.
// You have to accept that it is impossible to provide the name
// of the missing class then.
return (void *) _Jv_ThrowNoClassDefFoundError;
-#endif
}
+#endif // USE_LIBFFI
// Functions for indirect dispatch (symbolic virtual binding) support.
@@ -1213,7 +1217,7 @@ _Jv_Linker::link_symbol_table (jclass klass)
}
// Try fields only if the target class exists.
- if ( target_class != NULL )
+ if (target_class != NULL)
{
wait_for_state(target_class, JV_STATE_PREPARED);
jclass found_class;