This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: link.cc indentation


Hi,
I applied the following indentation fix for link.cc .

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.

cya
Robert
Index: link.cc
===================================================================
--- link.cc	(Revision 111330)
+++ link.cc	(Arbeitskopie)
@@ -142,10 +142,10 @@
 	  // 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 @@
                                         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 @@
 }
 
 #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 @@
   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 @@
   // 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 @@
       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 @@
 	}
 
       // 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;

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]