* desc_to_type: renamed to descriptor_to_basic_type, cleaned up, moved to descriptor.c
[cacao.git] / src / vm / tables.c
index 40b880e64371dd7fc0289f8c9bc19c7bc1d8e9cd..b798b79b33fdff7088ab4d46825361aa3b4c6b98 100644 (file)
@@ -36,7 +36,7 @@
        - the heap
        - additional support functions
 
-   $Id: tables.c 3679 2005-11-16 12:12:02Z twisti $
+   $Id: tables.c 3825 2005-12-01 18:46:29Z edwin $
 
 */
 
@@ -166,67 +166,6 @@ void tables_close()
        MFREE(string_hash.ptr, void*, string_hash.size);
 }
 
-
-/******************************************************************************
-*********************** Misc support functions ********************************
-******************************************************************************/
-
-
-/******************** Function: desc_to_type **********************************
-   
-       Determines the corresponding Java base data type for a given type
-       descriptor.
-       
-******************************************************************************/
-
-u2 desc_to_type(utf *descriptor)
-{
-       char *utf_ptr = descriptor->text;  /* current position in utf text */
-
-       if (descriptor->blength < 1) {
-               log_text("Type-Descriptor is empty string");
-               assert(0);
-       }
-       
-       switch (*utf_ptr++) {
-       case 'B': 
-       case 'C':
-       case 'I':
-       case 'S':  
-       case 'Z':  return TYPE_INT;
-       case 'D':  return TYPE_DOUBLE;
-       case 'F':  return TYPE_FLOAT;
-       case 'J':  return TYPE_LONG;
-       case 'L':
-       case '[':  return TYPE_ADDRESS;
-       }
-                       
-       assert(0);
-
-       return 0;
-}
-
-
-/********************** Function: desc_typesize *******************************
-
-       Calculates the lenght in bytes needed for a data element of the type given
-       by its type descriptor.
-       
-******************************************************************************/
-
-u2 desc_typesize(utf *descriptor)
-{
-       switch (desc_to_type(descriptor)) {
-       case TYPE_INT:     return 4;
-       case TYPE_LONG:    return 8;
-       case TYPE_FLOAT:   return 4;
-       case TYPE_DOUBLE:  return 8;
-       case TYPE_ADDRESS: return sizeof(voidptr);
-       default:           return 0;
-       }
-}
-
-
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where