Author: petdance
Date: Thu Jul 5 18:59:24 2007
New Revision: 19634
Modified:
trunk/include/parrot/list.h
trunk/src/list.c
Log:
list_new() now takes an enum instead of an overbroad INTVAL
Modified: trunk/include/parrot/list.h
==============================================================================
--- trunk/include/parrot/list.h (original)
+++ trunk/include/parrot/list.h Thu Jul 5 18:59:24 2007
@@ -125,7 +125,8 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-PARROT_API List * list_new( Interp *interp, INTVAL type )
+PARROT_API List * list_new( Interp *interp /*NN*/, PARROT_DATA_TYPES type )
+ __attribute__nonnull__(1)
__attribute__malloc__
__attribute__warn_unused_result__;
Modified: trunk/src/list.c
==============================================================================
--- trunk/src/list.c (original)
+++ trunk/src/list.c Thu Jul 5 18:59:24 2007
@@ -1111,31 +1111,22 @@
case enum_type_sized:
return (void *)&((char *)
PObj_bufstart(&chunk->data))[idx * list->item_size];
- break;
case enum_type_char:
return (void *)&((char *) PObj_bufstart(&chunk->data))[idx];
- break;
case enum_type_short:
return (void *)&((short *) PObj_bufstart(&chunk->data))[idx];
- break;
case enum_type_int:
return (void *)&((int *) PObj_bufstart(&chunk->data))[idx];
- break;
case enum_type_INTVAL:
return (void *)&((INTVAL *) PObj_bufstart(&chunk->data))[idx];
- break;
case enum_type_FLOATVAL:
return (void *)&((FLOATVAL *) PObj_bufstart(&chunk->data))[idx];
- break;
case enum_type_PMC:
return (void *)&((PMC **) PObj_bufstart(&chunk->data))[idx];
- break;
case enum_type_STRING:
return (void *)&((STRING **) PObj_bufstart(&chunk->data))[idx];
- break;
default:
real_exception(interp, NULL, 1, "Unknown list entry type\n");
- break;
}
return 0;
@@ -1172,7 +1163,7 @@
PARROT_API
List *
-list_new(Interp *interp, INTVAL type)
+list_new(Interp *interp /*NN*/, PARROT_DATA_TYPES type)
/* MALLOC, WARN_UNUSED */
{
List * const list = (List *)new_bufferlike_header(interp, sizeof (*list));