* src/vmcore/field.c (field_get_annotations): Always enable the
authortwisti <none@none>
Thu, 16 Aug 2007 17:25:47 +0000 (17:25 +0000)
committertwisti <none@none>
Thu, 16 Aug 2007 17:25:47 +0000 (17:25 +0000)
method, but return NULL for !ENABLE_ANNOTATIONS. This keeps code
calling this function simpler.

* src/vmcore/field.h (field_get_annotations): Removed
ENABLE_ANNOTATIONS.

src/vmcore/field.c
src/vmcore/field.h

index 5cd1a6e6cc90a95132cb41a87fdc37ee12b01f0d..f2fa08d68b9da35b8d173b30e132b2e7c247a825 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: field.c 8315 2007-08-15 22:49:20Z panzi $
+   $Id: field.c 8325 2007-08-16 17:25:47Z twisti $
 
 */
 
@@ -386,19 +386,23 @@ void field_free(fieldinfo *f)
 }
 
 
-#if defined(ENABLE_ANNOTATIONS)
 /* field_get_annotations ******************************************************
 
    Gets a fields' annotations (or NULL if none).
 
 *******************************************************************************/
 
-java_bytearray *field_get_annotations(fieldinfo *f)
+java_handle_bytearray_t *field_get_annotations(fieldinfo *f)
 {
-       classinfo              *c           = f->class;
-       int                     slot        = f - c->fields;
-       annotation_bytearray_t *ba          = NULL;
-       java_bytearray         *annotations = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+       classinfo               *c;
+       int                      slot;
+       annotation_bytearray_t  *ba;
+       java_handle_bytearray_t *annotations;
+
+       c           = f->class;
+       slot        = f - c->fields;
+       annotations = NULL;
        
        if (c->field_annotations != NULL && c->field_annotations->size > slot) {
                ba = c->field_annotations->data[slot];
@@ -413,8 +417,10 @@ java_bytearray *field_get_annotations(fieldinfo *f)
        }
        
        return annotations;
-}
+#else
+       return NULL;
 #endif
+}
 
 
 /* field_printflags ************************************************************
index 7eb3df5a17f4c437d206fbc6f770c401e9e336d0..9dd28cabfcc6328a1ce2985f59442d214a3a7315 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: field.h 8315 2007-08-15 22:49:20Z panzi $
+   $Id: field.h 8325 2007-08-16 17:25:47Z twisti $
 */
 
 
@@ -76,9 +76,7 @@ bool       field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool);
 classinfo *field_get_type(fieldinfo *f);
 void       field_free(fieldinfo *f);
 
-#if defined(ENABLE_ANNOTATIONS)
-java_bytearray *field_get_annotations(fieldinfo *f);
-#endif
+java_handle_bytearray_t *field_get_annotations(fieldinfo *f);
 
 #if !defined(NDEBUG)
 void field_printflags(fieldinfo *f);