[svn:parrot] r41414 - in trunk: include/parrot src src/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Tue Sep 22 21:04:46 UTC 2009
Author: bacek
Date: Tue Sep 22 21:03:54 2009
New Revision: 41414
URL: https://trac.parrot.org/parrot/changeset/41414
Log:
[core] Rename list_foo functions into Parrot_pmc_array_foo. Closing TT#1057
Modified:
trunk/include/parrot/list.h
trunk/src/list.c
trunk/src/pmc/array.pmc
trunk/src/pmc_freeze.c
Modified: trunk/include/parrot/list.h
==============================================================================
--- trunk/include/parrot/list.h Tue Sep 22 20:23:44 2009 (r41413)
+++ trunk/include/parrot/list.h Tue Sep 22 21:03:54 2009 (r41414)
@@ -84,7 +84,7 @@
UINTVAL ld(UINTVAL x);
PARROT_EXPORT
-void list_assign(PARROT_INTERP,
+void Parrot_pmc_array_assign(PARROT_INTERP,
ARGMOD(List *list),
INTVAL idx,
ARGIN_NULLOK(void *item),
@@ -96,20 +96,32 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-List * list_clone(PARROT_INTERP, ARGIN(const List *other))
+List * Parrot_pmc_array_clone(PARROT_INTERP, ARGIN(const List *other))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
PARROT_EXPORT
+void Parrot_pmc_array_delete(PARROT_INTERP,
+ ARGMOD(List *list),
+ INTVAL idx,
+ INTVAL n_items)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(*list);
+
+PARROT_EXPORT
PARROT_CAN_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
-void * list_get(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, int type)
+void * Parrot_pmc_array_get(PARROT_INTERP,
+ ARGMOD(List *list),
+ INTVAL idx,
+ int type)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*list);
PARROT_EXPORT
-void list_insert(PARROT_INTERP,
+void Parrot_pmc_array_insert(PARROT_INTERP,
ARGMOD(List *list),
INTVAL idx,
INTVAL n_items)
@@ -118,7 +130,7 @@
FUNC_MODIFIES(*list);
PARROT_EXPORT
-void list_mark(PARROT_INTERP, ARGMOD(List *list))
+void Parrot_pmc_array_mark(PARROT_INTERP, ARGMOD(List *list))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*list);
@@ -126,24 +138,26 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-List * list_new(PARROT_INTERP, PARROT_DATA_TYPE type)
+List * Parrot_pmc_array_new(PARROT_INTERP, PARROT_DATA_TYPE type)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-List * list_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, ARGIN(PMC *init))
+List * Parrot_pmc_array_new_init(PARROT_INTERP,
+ PARROT_DATA_TYPE type,
+ ARGIN(PMC *init))
__attribute__nonnull__(1)
__attribute__nonnull__(3);
PARROT_EXPORT
-void list_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
+void Parrot_pmc_array_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*container);
PARROT_EXPORT
-void list_pmc_new_init(PARROT_INTERP,
+void Parrot_pmc_array_pmc_new_init(PARROT_INTERP,
ARGMOD(PMC *container),
ARGIN(PMC *init))
__attribute__nonnull__(1)
@@ -153,13 +167,13 @@
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
-void * list_pop(PARROT_INTERP, ARGMOD(List *list), int type)
+void * Parrot_pmc_array_pop(PARROT_INTERP, ARGMOD(List *list), int type)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*list);
PARROT_EXPORT
-void list_push(PARROT_INTERP,
+void Parrot_pmc_array_push(PARROT_INTERP,
ARGMOD(List *list),
ARGIN_NULLOK(void *item),
int type)
@@ -168,20 +182,22 @@
FUNC_MODIFIES(*list);
PARROT_EXPORT
-void list_set_length(PARROT_INTERP, ARGMOD(List *list), INTVAL len)
+void Parrot_pmc_array_set_length(PARROT_INTERP,
+ ARGMOD(List *list),
+ INTVAL len)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*list);
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
-void * list_shift(PARROT_INTERP, ARGMOD(List *list), int type)
+void * Parrot_pmc_array_shift(PARROT_INTERP, ARGMOD(List *list), int type)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*list);
PARROT_EXPORT
-void list_splice(PARROT_INTERP,
+void Parrot_pmc_array_splice(PARROT_INTERP,
ARGMOD(List *list),
ARGMOD_NULLOK(List *value_list),
INTVAL offset,
@@ -192,7 +208,7 @@
FUNC_MODIFIES(*value_list);
PARROT_EXPORT
-void list_unshift(PARROT_INTERP,
+void Parrot_pmc_array_unshift(PARROT_INTERP,
ARGMOD(List *list),
ARGIN(void *item),
int type)
@@ -202,81 +218,74 @@
FUNC_MODIFIES(*list);
PARROT_EXPORT
-void list_visit(PARROT_INTERP, ARGIN(List *list), ARGMOD(void *pinfo))
+void Parrot_pmc_array_visit(PARROT_INTERP,
+ ARGIN(List *list),
+ ARGMOD(void *pinfo))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*pinfo);
-PARROT_EXPORT
-void Parrot_array_delete(PARROT_INTERP,
- ARGMOD(List *list),
- INTVAL idx,
- INTVAL n_items)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*list);
-
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
-INTVAL Parrot_array_length(SHIM_INTERP, ARGIN(const List *list))
+INTVAL Parrot_pmc_array_length(SHIM_INTERP, ARGIN(const List *list))
__attribute__nonnull__(2);
#define ASSERT_ARGS_ld __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_list_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(other)
-#define ASSERT_ARGS_list_get __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ && PARROT_ASSERT_ARG(list)
+#define ASSERT_ARGS_Parrot_pmc_array_get __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_insert __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_insert __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_list_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(init)
-#define ASSERT_ARGS_list_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(container)
-#define ASSERT_ARGS_list_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(container) \
&& PARROT_ASSERT_ARG(init)
-#define ASSERT_ARGS_list_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_set_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_set_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_shift __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_shift __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_splice __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_splice __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_unshift __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_unshift __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list) \
&& PARROT_ASSERT_ARG(item)
-#define ASSERT_ARGS_list_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list) \
&& PARROT_ASSERT_ARG(pinfo)
-#define ASSERT_ARGS_Parrot_array_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- && PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_Parrot_array_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(list)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/list.c */
Modified: trunk/src/list.c
==============================================================================
--- trunk/src/list.c Tue Sep 22 20:23:44 2009 (r41413)
+++ trunk/src/list.c Tue Sep 22 21:03:54 2009 (r41414)
@@ -132,7 +132,7 @@
A List can hold various datatypes. See F<src/datatypes.h> for the
enumeration of types.
-Not all are yet implemented in C<list_set>/C<list_item>, see the
+Not all are yet implemented in C<Parrot_pmc_array_set>/C<Parrot_pmc_array_item>, see the
C<switch()>.
Arbitrary length data:
@@ -149,10 +149,10 @@
=back
-In C<list_assign> the values are copied into the array, C<list_get>
+In C<Parrot_pmc_array_assign> the values are copied into the array, C<Parrot_pmc_array_get>
returns a pointer as for all other data types.
-See F<src/list_2.t> and C<list_new_init()>.
+See F<src/list_2.t> and C<Parrot_pmc_array_new_init()>.
=head2 Return value
@@ -237,7 +237,7 @@
FUNC_MODIFIES(*list)
FUNC_MODIFIES(*idx);
-static void list_append(PARROT_INTERP,
+static void Parrot_pmc_array_append(PARROT_INTERP,
ARGMOD(List *list),
ARGIN_NULLOK(void *item),
int type,
@@ -248,7 +248,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-static void * list_item(PARROT_INTERP,
+static void * Parrot_pmc_array_item(PARROT_INTERP,
ARGMOD(List *list),
int type,
INTVAL idx)
@@ -256,7 +256,7 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*list);
-static void list_set(PARROT_INTERP,
+static void Parrot_pmc_array_set(PARROT_INTERP,
ARGMOD(List *list),
ARGIN_NULLOK(void *item),
INTVAL type,
@@ -313,13 +313,13 @@
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list) \
&& PARROT_ASSERT_ARG(idx)
-#define ASSERT_ARGS_list_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_item __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_item __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pmc_array_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
#define ASSERT_ARGS_rebuild_chunk_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -961,7 +961,7 @@
other. So the time to look up a chunk doesn't depend on the array
length, but on the complexity of the array. C<rebuild_chunk_list> tries
to reduce the complexity, but may fail, if you e.g. do a prime sieve by
-actually C<list_delet>ing the none prime numbers.
+actually C<Parrot_pmc_array_delet>ing the none prime numbers.
The complexity of the array is how many different C<chunk_blocks> are
there. They come from:
@@ -1172,8 +1172,8 @@
/*
-=item C<static void list_set(PARROT_INTERP, List *list, void *item, INTVAL type,
-INTVAL idx)>
+=item C<static void Parrot_pmc_array_set(PARROT_INTERP, List *list, void *item,
+INTVAL type, INTVAL idx)>
Sets C<item> of type C<type> in chunk at C<idx>.
@@ -1182,10 +1182,10 @@
*/
static void
-list_set(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item),
+Parrot_pmc_array_set(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item),
INTVAL type, INTVAL idx)
{
- ASSERT_ARGS(list_set)
+ ASSERT_ARGS(Parrot_pmc_array_set)
List_chunk *chunk = get_chunk(interp, list, (UINTVAL *)&idx);
const INTVAL oidx = idx;
@@ -1238,8 +1238,8 @@
/*
-=item C<static void * list_item(PARROT_INTERP, List *list, int type, INTVAL
-idx)>
+=item C<static void * Parrot_pmc_array_item(PARROT_INTERP, List *list, int type,
+INTVAL idx)>
Get the pointer to the item of type C<type> in the chunk at C<idx>.
@@ -1250,9 +1250,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
static void *
-list_item(PARROT_INTERP, ARGMOD(List *list), int type, INTVAL idx)
+Parrot_pmc_array_item(PARROT_INTERP, ARGMOD(List *list), int type, INTVAL idx)
{
- ASSERT_ARGS(list_item)
+ ASSERT_ARGS(Parrot_pmc_array_item)
List_chunk * const chunk = get_chunk(interp, list, (UINTVAL *)&idx);
/* if this is a sparse chunk return -1, the caller may decide to return 0
* or undef or whatever */
@@ -1292,8 +1292,8 @@
/*
-=item C<static void list_append(PARROT_INTERP, List *list, void *item, int type,
-UINTVAL idx)>
+=item C<static void Parrot_pmc_array_append(PARROT_INTERP, List *list, void
+*item, int type, UINTVAL idx)>
Adds one or more chunks to end of list.
@@ -1302,14 +1302,14 @@
*/
static void
-list_append(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type, UINTVAL idx)
+Parrot_pmc_array_append(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type, UINTVAL idx)
{
- ASSERT_ARGS(list_append)
+ ASSERT_ARGS(Parrot_pmc_array_append)
/* initially, list may be empty, also used by assign */
while (idx >= list->cap){
add_chunk_at_end(interp, list, idx);
}
- list_set(interp, list, item, type, idx);
+ Parrot_pmc_array_set(interp, list, item, type, idx);
/* invariant: prepare for next push */
if (idx >= list->cap - 1)
@@ -1325,7 +1325,7 @@
=over 4
-=item C<List * list_new(PARROT_INTERP, PARROT_DATA_TYPE type)>
+=item C<List * Parrot_pmc_array_new(PARROT_INTERP, PARROT_DATA_TYPE type)>
Returns a new list of type C<type>.
@@ -1337,9 +1337,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
List *
-list_new(PARROT_INTERP, PARROT_DATA_TYPE type)
+Parrot_pmc_array_new(PARROT_INTERP, PARROT_DATA_TYPE type)
{
- ASSERT_ARGS(list_new)
+ ASSERT_ARGS(Parrot_pmc_array_new)
List * const list = (List *)Parrot_gc_new_bufferlike_header(interp,
sizeof (*list));
@@ -1378,7 +1378,7 @@
/*
-=item C<void list_pmc_new(PARROT_INTERP, PMC *container)>
+=item C<void Parrot_pmc_array_pmc_new(PARROT_INTERP, PMC *container)>
Creates a new list containing PMC* values in C<PMC_data(container)>.
@@ -1388,11 +1388,11 @@
PARROT_EXPORT
void
-list_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
+Parrot_pmc_array_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
{
- ASSERT_ARGS(list_pmc_new)
+ ASSERT_ARGS(Parrot_pmc_array_pmc_new)
- List * const l = list_new(interp, enum_type_PMC);
+ List * const l = Parrot_pmc_array_new(interp, enum_type_PMC);
l->container = container;
PMC_data(container) = l;
}
@@ -1400,9 +1400,10 @@
/*
-=item C<List * list_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, PMC *init)>
+=item C<List * Parrot_pmc_array_new_init(PARROT_INTERP, PARROT_DATA_TYPE type,
+PMC *init)>
-C<list_new_init()> uses these initializers:
+C<Parrot_pmc_array_new_init()> uses these initializers:
0 ... size (set initial size of list)
1 ... array dimensions (multiarray)
@@ -1418,9 +1419,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
List *
-list_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, ARGIN(PMC *init))
+Parrot_pmc_array_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, ARGIN(PMC *init))
{
- ASSERT_ARGS(list_new_init)
+ ASSERT_ARGS(Parrot_pmc_array_new_init)
List *list;
PMC *multi_key = NULL;
INTVAL size = 0;
@@ -1469,7 +1470,7 @@
}
}
- list = list_new(interp, type);
+ list = Parrot_pmc_array_new(interp, type);
if (list->item_type == enum_type_sized) { /* override item_size */
@@ -1485,7 +1486,7 @@
}
if (size)
- list_set_length(interp, list, size);
+ Parrot_pmc_array_set_length(interp, list, size);
return list;
}
@@ -1493,7 +1494,8 @@
/*
-=item C<void list_pmc_new_init(PARROT_INTERP, PMC *container, PMC *init)>
+=item C<void Parrot_pmc_array_pmc_new_init(PARROT_INTERP, PMC *container, PMC
+*init)>
Creates a new list of PMC* values in C<PMC_data(container)>.
@@ -1503,11 +1505,11 @@
PARROT_EXPORT
void
-list_pmc_new_init(PARROT_INTERP, ARGMOD(PMC *container), ARGIN(PMC *init))
+Parrot_pmc_array_pmc_new_init(PARROT_INTERP, ARGMOD(PMC *container), ARGIN(PMC *init))
{
- ASSERT_ARGS(list_pmc_new_init)
+ ASSERT_ARGS(Parrot_pmc_array_pmc_new_init)
- List * const l = list_new_init(interp, enum_type_PMC, init);
+ List * const l = Parrot_pmc_array_new_init(interp, enum_type_PMC, init);
l->container = container;
PMC_data(container) = l;
}
@@ -1515,7 +1517,7 @@
/*
-=item C<List * list_clone(PARROT_INTERP, const List *other)>
+=item C<List * Parrot_pmc_array_clone(PARROT_INTERP, const List *other)>
Returns a clone of the C<other> list.
@@ -1529,9 +1531,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
List *
-list_clone(PARROT_INTERP, ARGIN(const List *other))
+Parrot_pmc_array_clone(PARROT_INTERP, ARGIN(const List *other))
{
- ASSERT_ARGS(list_clone)
+ ASSERT_ARGS(Parrot_pmc_array_clone)
List *l;
List_chunk *chunk, *prev;
UINTVAL i;
@@ -1539,7 +1541,7 @@
Parrot_block_GC_mark(interp);
Parrot_block_GC_sweep(interp);
- l = list_new(interp, other->item_type);
+ l = Parrot_pmc_array_new(interp, other->item_type);
STRUCT_COPY(l, other);
Buffer_buflen(&l->chunk_list) = 0;
@@ -1595,7 +1597,7 @@
/*
-=item C<void list_mark(PARROT_INTERP, List *list)>
+=item C<void Parrot_pmc_array_mark(PARROT_INTERP, List *list)>
Marks the list and its contents as live for the memory management system.
@@ -1605,9 +1607,9 @@
PARROT_EXPORT
void
-list_mark(PARROT_INTERP, ARGMOD(List *list))
+Parrot_pmc_array_mark(PARROT_INTERP, ARGMOD(List *list))
{
- ASSERT_ARGS(list_mark)
+ ASSERT_ARGS(Parrot_pmc_array_mark)
List_chunk *chunk;
for (chunk = list->first; chunk; chunk = chunk->next) {
@@ -1634,7 +1636,7 @@
/*
-=item C<void list_visit(PARROT_INTERP, List *list, void *pinfo)>
+=item C<void Parrot_pmc_array_visit(PARROT_INTERP, List *list, void *pinfo)>
This is used by freeze/thaw to visit the contents of the list.
@@ -1646,14 +1648,14 @@
PARROT_EXPORT
void
-list_visit(PARROT_INTERP, ARGIN(List *list), ARGMOD(void *pinfo))
+Parrot_pmc_array_visit(PARROT_INTERP, ARGIN(List *list), ARGMOD(void *pinfo))
{
- ASSERT_ARGS(list_visit)
+ ASSERT_ARGS(Parrot_pmc_array_visit)
List_chunk *chunk;
visit_info * const info = (visit_info*) pinfo;
UINTVAL idx;
- const UINTVAL n = Parrot_array_length(interp, list);
+ const UINTVAL n = Parrot_pmc_array_length(interp, list);
PARROT_ASSERT(list->item_type == enum_type_PMC);
for (idx = 0, chunk = list->first; chunk; chunk = chunk->next) {
@@ -1675,7 +1677,7 @@
/*
-=item C<INTVAL Parrot_array_length(PARROT_INTERP, const List *list)>
+=item C<INTVAL Parrot_pmc_array_length(PARROT_INTERP, const List *list)>
Returns the length of the list.
@@ -1686,16 +1688,16 @@
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
INTVAL
-Parrot_array_length(SHIM_INTERP, ARGIN(const List *list))
+Parrot_pmc_array_length(SHIM_INTERP, ARGIN(const List *list))
{
- ASSERT_ARGS(Parrot_array_length)
+ ASSERT_ARGS(Parrot_pmc_array_length)
return list->length;
}
/*
-=item C<void list_set_length(PARROT_INTERP, List *list, INTVAL len)>
+=item C<void Parrot_pmc_array_set_length(PARROT_INTERP, List *list, INTVAL len)>
Sets the length of the list to C<len>.
@@ -1705,9 +1707,9 @@
PARROT_EXPORT
void
-list_set_length(PARROT_INTERP, ARGMOD(List *list), INTVAL len)
+Parrot_pmc_array_set_length(PARROT_INTERP, ARGMOD(List *list), INTVAL len)
{
- ASSERT_ARGS(list_set_length)
+ ASSERT_ARGS(Parrot_pmc_array_set_length)
if (len < 0)
len += list->length;
@@ -1724,7 +1726,7 @@
}
}
- list_append(interp, list, NULL, list->item_type, idx);
+ Parrot_pmc_array_append(interp, list, NULL, list->item_type, idx);
}
else
rebuild_chunk_ptrs(list, 1);
@@ -1736,7 +1738,8 @@
/*
-=item C<void list_insert(PARROT_INTERP, List *list, INTVAL idx, INTVAL n_items)>
+=item C<void Parrot_pmc_array_insert(PARROT_INTERP, List *list, INTVAL idx,
+INTVAL n_items)>
Makes room for C<n_items> at C<idx>.
@@ -1746,9 +1749,9 @@
PARROT_EXPORT
void
-list_insert(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
+Parrot_pmc_array_insert(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
{
- ASSERT_ARGS(list_insert)
+ ASSERT_ARGS(Parrot_pmc_array_insert)
List_chunk *chunk;
PARROT_ASSERT(idx >= 0);
@@ -1821,8 +1824,8 @@
/*
-=item C<void Parrot_array_delete(PARROT_INTERP, List *list, INTVAL idx, INTVAL
-n_items)>
+=item C<void Parrot_pmc_array_delete(PARROT_INTERP, List *list, INTVAL idx,
+INTVAL n_items)>
Deletes C<n_items> at C<idx>.
@@ -1832,9 +1835,9 @@
PARROT_EXPORT
void
-Parrot_array_delete(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
+Parrot_pmc_array_delete(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
{
- ASSERT_ARGS(Parrot_array_delete)
+ ASSERT_ARGS(Parrot_pmc_array_delete)
List_chunk *chunk;
PARROT_ASSERT(idx >= 0);
@@ -1917,7 +1920,8 @@
/*
-=item C<void list_push(PARROT_INTERP, List *list, void *item, int type)>
+=item C<void Parrot_pmc_array_push(PARROT_INTERP, List *list, void *item, int
+type)>
Pushes C<item> of type C<type> on to the end of the list.
@@ -1927,18 +1931,19 @@
PARROT_EXPORT
void
-list_push(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type)
+Parrot_pmc_array_push(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type)
{
- ASSERT_ARGS(list_push)
+ ASSERT_ARGS(Parrot_pmc_array_push)
const INTVAL idx = list->start + list->length++;
- list_append(interp, list, item, type, idx);
+ Parrot_pmc_array_append(interp, list, item, type, idx);
}
/*
-=item C<void list_unshift(PARROT_INTERP, List *list, void *item, int type)>
+=item C<void Parrot_pmc_array_unshift(PARROT_INTERP, List *list, void *item, int
+type)>
Pushes C<item> of type C<type> on to the start of the list.
@@ -1948,9 +1953,9 @@
PARROT_EXPORT
void
-list_unshift(PARROT_INTERP, ARGMOD(List *list), ARGIN(void *item), int type)
+Parrot_pmc_array_unshift(PARROT_INTERP, ARGMOD(List *list), ARGIN(void *item), int type)
{
- ASSERT_ARGS(list_unshift)
+ ASSERT_ARGS(Parrot_pmc_array_unshift)
List_chunk *chunk;
if (list->start == 0) {
@@ -1962,14 +1967,14 @@
else
chunk = list->first;
- list_set(interp, list, item, type, --list->start);
+ Parrot_pmc_array_set(interp, list, item, type, --list->start);
list->length++;
}
/*
-=item C<void * list_pop(PARROT_INTERP, List *list, int type)>
+=item C<void * Parrot_pmc_array_pop(PARROT_INTERP, List *list, int type)>
Removes and returns the last item of type C<type> from the end of the list.
@@ -1980,9 +1985,9 @@
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
void *
-list_pop(PARROT_INTERP, ARGMOD(List *list), int type)
+Parrot_pmc_array_pop(PARROT_INTERP, ARGMOD(List *list), int type)
{
- ASSERT_ARGS(list_pop)
+ ASSERT_ARGS(Parrot_pmc_array_pop)
List_chunk *chunk = list->last;
UINTVAL idx;
@@ -2006,13 +2011,13 @@
rebuild_chunk_list(interp, list);
}
- return list_item(interp, list, type, idx);
+ return Parrot_pmc_array_item(interp, list, type, idx);
}
/*
-=item C<void * list_shift(PARROT_INTERP, List *list, int type)>
+=item C<void * Parrot_pmc_array_shift(PARROT_INTERP, List *list, int type)>
Removes and returns the first item of type C<type> from the start of the list.
@@ -2023,9 +2028,9 @@
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
void *
-list_shift(PARROT_INTERP, ARGMOD(List *list), int type)
+Parrot_pmc_array_shift(PARROT_INTERP, ARGMOD(List *list), int type)
{
- ASSERT_ARGS(list_shift)
+ ASSERT_ARGS(Parrot_pmc_array_shift)
void *ret;
List_chunk *chunk = list->first;
UINTVAL idx;
@@ -2041,7 +2046,7 @@
else
list->start++;
- ret = list_item(interp, list, type, idx);
+ ret = Parrot_pmc_array_item(interp, list, type, idx);
if (list->start >= chunk->items) {
list->cap -= chunk->items;
@@ -2060,8 +2065,8 @@
/*
-=item C<void list_assign(PARROT_INTERP, List *list, INTVAL idx, void *item, int
-type)>
+=item C<void Parrot_pmc_array_assign(PARROT_INTERP, List *list, INTVAL idx, void
+*item, int type)>
Assigns C<item> of type C<type> to index C<idx>.
@@ -2071,9 +2076,9 @@
PARROT_EXPORT
void
-list_assign(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, ARGIN_NULLOK(void *item), int type)
+Parrot_pmc_array_assign(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, ARGIN_NULLOK(void *item), int type)
{
- ASSERT_ARGS(list_assign)
+ ASSERT_ARGS(Parrot_pmc_array_assign)
const INTVAL length = list->length;
if (idx < -length)
@@ -2081,17 +2086,18 @@
else if (idx < 0)
idx += length;
if (idx >= length) {
- list_append(interp, list, item, type, list->start + idx);
+ Parrot_pmc_array_append(interp, list, item, type, list->start + idx);
list->length = idx + 1;
}
else
- list_set(interp, list, item, type, list->start + idx);
+ Parrot_pmc_array_set(interp, list, item, type, list->start + idx);
}
/*
-=item C<void * list_get(PARROT_INTERP, List *list, INTVAL idx, int type)>
+=item C<void * Parrot_pmc_array_get(PARROT_INTERP, List *list, INTVAL idx, int
+type)>
Returns the item of type C<type> at index C<idx>.
@@ -2103,9 +2109,9 @@
PARROT_CAN_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
void *
-list_get(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, int type)
+Parrot_pmc_array_get(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, int type)
{
- ASSERT_ARGS(list_get)
+ ASSERT_ARGS(Parrot_pmc_array_get)
const INTVAL length = list->length;
if (idx >= length || -idx > length)
@@ -2116,14 +2122,14 @@
idx += list->start;
- return list_item(interp, list, type, idx);
+ return Parrot_pmc_array_item(interp, list, type, idx);
}
/*
-=item C<void list_splice(PARROT_INTERP, List *list, List *value_list, INTVAL
-offset, INTVAL count)>
+=item C<void Parrot_pmc_array_splice(PARROT_INTERP, List *list, List
+*value_list, INTVAL offset, INTVAL count)>
Replaces C<count> items starting at C<offset> with the items in C<value>.
@@ -2135,10 +2141,10 @@
PARROT_EXPORT
void
-list_splice(PARROT_INTERP, ARGMOD(List *list), ARGMOD_NULLOK(List *value_list),
+Parrot_pmc_array_splice(PARROT_INTERP, ARGMOD(List *list), ARGMOD_NULLOK(List *value_list),
INTVAL offset, INTVAL count)
{
- ASSERT_ARGS(list_splice)
+ ASSERT_ARGS(Parrot_pmc_array_splice)
const INTVAL value_length = value_list ? value_list->length : 0;
const INTVAL length = list->length;
const int type = list->item_type;
@@ -2165,42 +2171,42 @@
/* replace count items at offset with values */
for (i = j = 0; i < count && j < value_length; i++, j++) {
- void *val = list_get(interp, value_list, j, type);
+ void *val = Parrot_pmc_array_get(interp, value_list, j, type);
/* no clone here, if the HL wants to reuse the values, the HL has to */
/* clone the values */
- /* XXX We don't know that val is non-NULL coming back from list_get. */
+ /* XXX We don't know that val is non-NULL coming back from Parrot_pmc_array_get. */
/* We need to check that we're not dereferencing NULL. */
if (type == enum_type_PMC)
val = *(PMC **)val;
else if (type == enum_type_STRING)
val = *(STRING **)val;
- list_assign(interp, list, offset + i, val, type);
+ Parrot_pmc_array_assign(interp, list, offset + i, val, type);
}
/* if we still have values in value_list, insert them */
if (j < value_length) {
/* make room for the remaining values */
- list_insert(interp, list, offset + i, value_length - j);
+ Parrot_pmc_array_insert(interp, list, offset + i, value_length - j);
for (; j < value_length; i++, j++) {
- void *val = list_get(interp, value_list, j, type);
+ void *val = Parrot_pmc_array_get(interp, value_list, j, type);
/* XXX We don't know that val is non-NULL coming back from
- * list_get; check that we're not dereferencing NULL. */
+ * Parrot_pmc_array_get; check that we're not dereferencing NULL. */
if (type == enum_type_PMC)
val = *(PMC **)val;
else if (type == enum_type_STRING)
val = *(STRING **)val;
- list_assign(interp, list, offset + i, val, type);
+ Parrot_pmc_array_assign(interp, list, offset + i, val, type);
}
}
/* else delete the rest */
else
- Parrot_array_delete(interp, list, offset + i, count - i);
+ Parrot_pmc_array_delete(interp, list, offset + i, count - i);
}
Modified: trunk/src/pmc/array.pmc
==============================================================================
--- trunk/src/pmc/array.pmc Tue Sep 22 20:23:44 2009 (r41413)
+++ trunk/src/pmc/array.pmc Tue Sep 22 21:03:54 2009 (r41414)
@@ -79,7 +79,7 @@
*/
static PMC *Parrot_Array_set_pmc_ptr(PARROT_INTERP, List *list, INTVAL key) {
- void * const ret = list_get(interp, list, key, enum_type_PMC);
+ void * const ret = Parrot_pmc_array_get(interp, list, key, enum_type_PMC);
PMC *value;
if (ret == NULL)
@@ -89,7 +89,7 @@
/* assign into a sparse or not yet set value */
if (ret == (void *)-1 || *(PMC **)ret == NULL) {
value = undef(interp);
- list_assign(interp, list, key, value, enum_type_PMC);
+ Parrot_pmc_array_assign(interp, list, key, value, enum_type_PMC);
}
else
value = *(PMC **)ret;
@@ -110,14 +110,14 @@
=item C<void init()>
-Initializes the PMC by calling the underlying C<list_new()> function.
+Initializes the PMC by calling the underlying C<Parrot_pmc_array_new()> function.
=cut
*/
VTABLE void init() {
- list_pmc_new(INTERP, SELF);
+ Parrot_pmc_array_pmc_new(INTERP, SELF);
PObj_custom_mark_SET(SELF);
}
@@ -133,7 +133,7 @@
*/
VTABLE void init_pmc(PMC *init) {
- list_pmc_new_init(INTERP, SELF, init);
+ Parrot_pmc_array_pmc_new_init(INTERP, SELF, init);
PObj_custom_mark_SET(SELF);
}
@@ -184,7 +184,7 @@
*/
VTABLE void mark() {
- list_mark(INTERP, (List *)PMC_data(SELF));
+ Parrot_pmc_array_mark(INTERP, (List *)PMC_data(SELF));
}
/*
@@ -198,7 +198,7 @@
*/
VTABLE PMC *clone() {
- List *l = list_clone(INTERP, (List *)PMC_data(SELF));
+ List *l = Parrot_pmc_array_clone(INTERP, (List *)PMC_data(SELF));
PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
PObj_custom_mark_SET(dest);
@@ -436,7 +436,7 @@
VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
return retval(INTERP,
- list_get(INTERP, (List *)PMC_data(SELF), key, enum_type_PMC));
+ Parrot_pmc_array_get(INTERP, (List *)PMC_data(SELF), key, enum_type_PMC));
}
/*
@@ -481,7 +481,7 @@
*/
VTABLE void set_integer_native(INTVAL size) {
- list_set_length(INTERP, (List *)PMC_data(SELF), size);
+ Parrot_pmc_array_set_length(INTERP, (List *)PMC_data(SELF), size);
}
/*
@@ -495,7 +495,7 @@
VTABLE void set_integer_same(PMC *value) {
const INTVAL size = VTABLE_elements(INTERP, value);
- list_set_length(INTERP, (List *)PMC_data(SELF), size);
+ Parrot_pmc_array_set_length(INTERP, (List *)PMC_data(SELF), size);
}
/*
@@ -668,7 +668,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
"Array index out of bounds!");
- list_assign(INTERP, (List *)PMC_data(SELF), idx,
+ Parrot_pmc_array_assign(INTERP, (List *)PMC_data(SELF), idx,
(void *)src, enum_type_PMC);
}
@@ -780,7 +780,7 @@
VTABLE void unshift_integer(INTVAL value) {
PMC * const val = undef(INTERP);
- list_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
+ Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
VTABLE_set_integer_native(INTERP, val, value);
}
@@ -798,7 +798,7 @@
VTABLE void unshift_float(FLOATVAL value) {
PMC * const val = undef(INTERP);
- list_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
+ Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
VTABLE_set_number_native(INTERP, val, value);
}
@@ -815,7 +815,7 @@
VTABLE void unshift_string(STRING *value) {
PMC * const val = undef(INTERP);
- list_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
+ Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
VTABLE_set_string_native(INTERP, val, value);
}
@@ -831,7 +831,7 @@
*/
VTABLE void unshift_pmc(PMC *value) {
- list_unshift(INTERP, (List *)PMC_data(SELF), value, enum_type_PMC);
+ Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), value, enum_type_PMC);
}
/*
@@ -891,7 +891,7 @@
VTABLE PMC *pop_pmc() {
return retval(INTERP,
- list_pop(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
+ Parrot_pmc_array_pop(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
}
/*
@@ -951,7 +951,7 @@
VTABLE PMC *shift_pmc() {
return retval(INTERP,
- list_shift(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
+ Parrot_pmc_array_shift(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
}
/*
@@ -973,7 +973,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Type mismatch in splice");
- list_splice(INTERP, (List *)PMC_data(SELF),
+ Parrot_pmc_array_splice(INTERP, (List *)PMC_data(SELF),
(List *)PMC_data(value), offset, count);
}
@@ -990,7 +990,7 @@
VTABLE INTVAL defined_keyed_int(INTVAL key) {
PMC *value;
void * const ret =
- list_get(INTERP, (List *)PMC_data(pmc), key, enum_type_PMC);
+ Parrot_pmc_array_get(INTERP, (List *)PMC_data(pmc), key, enum_type_PMC);
if (ret == NULL || ret == (void *) -1)
return 0;
@@ -1041,7 +1041,7 @@
*/
VTABLE INTVAL exists_keyed_int(INTVAL key) {
- void * ret = list_get(INTERP,
+ void * ret = Parrot_pmc_array_get(INTERP,
(List *)PMC_data(pmc), key, enum_type_PMC);
if (ret == NULL || ret == (void *)-1)
@@ -1088,7 +1088,7 @@
*/
VTABLE void delete_keyed_int(INTVAL key) {
- list_splice(INTERP, (List *)PMC_data(pmc), NULL, key, 1);
+ Parrot_pmc_array_splice(INTERP, (List *)PMC_data(pmc), NULL, key, 1);
}
/*
@@ -1103,7 +1103,7 @@
VTABLE void delete_keyed(PMC *key) {
const INTVAL ix = VTABLE_get_integer(INTERP, key);
- list_splice(INTERP, (List *)PMC_data(pmc), NULL, ix, 1);
+ Parrot_pmc_array_splice(INTERP, (List *)PMC_data(pmc), NULL, ix, 1);
}
/*
@@ -1186,7 +1186,7 @@
*/
VTABLE void visit(visit_info *info) {
- list_visit(INTERP, (List *)PMC_data(SELF), info);
+ Parrot_pmc_array_visit(INTERP, (List *)PMC_data(SELF), info);
SUPER(info);
}
@@ -1257,7 +1257,7 @@
for (i = 0; i < max; ++i) {
PMC * const value =
- (PMC *)list_get(INTERP, PMC_data_typed(ret, List *),
+ (PMC *)Parrot_pmc_array_get(INTERP, PMC_data_typed(ret, List *),
i, enum_type_PMC);
if (!PMC_IS_NULL(value)) {
@@ -1265,7 +1265,7 @@
PMC * const new_value = VTABLE_share_ro(INTERP, value);
if (new_value != value)
- list_assign(INTERP, PMC_data_typed(ret, List *),
+ Parrot_pmc_array_assign(INTERP, PMC_data_typed(ret, List *),
i, new_value, enum_type_PMC);
}
}
Modified: trunk/src/pmc_freeze.c
==============================================================================
--- trunk/src/pmc_freeze.c Tue Sep 22 20:23:44 2009 (r41413)
+++ trunk/src/pmc_freeze.c Tue Sep 22 21:03:54 2009 (r41414)
@@ -887,7 +887,7 @@
return;
}
- pos = (PMC **)list_get(interp, (List *)PMC_data(info->id_list),
+ pos = (PMC **)Parrot_pmc_array_get(interp, (List *)PMC_data(info->id_list),
id, enum_type_PMC);
if (pos == (void *)-1)
@@ -929,10 +929,10 @@
*info->thaw_ptr = pmc;
- list_assign(interp, (List *)PMC_data(info->id_list), id, pmc, enum_type_PMC);
+ Parrot_pmc_array_assign(interp, (List *)PMC_data(info->id_list), id, pmc, enum_type_PMC);
/* remember nested aggregates depth first */
- list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+ Parrot_pmc_array_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
}
/*
@@ -950,7 +950,7 @@
add_pmc_todo_list(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGIN(visit_info *info))
{
ASSERT_ARGS(add_pmc_todo_list)
- list_push(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+ Parrot_pmc_array_push(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
}
@@ -991,7 +991,7 @@
(Hash *)VTABLE_get_pointer(interp, info->seen), pmc, (void *)*id);
/* remember containers */
- list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+ Parrot_pmc_array_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
return 0;
}
@@ -1083,7 +1083,7 @@
/* can't cache upper limit, visit may append items */
again:
- while ((list_item = (PMC **)list_shift(interp, todo, enum_type_PMC))) {
+ while ((list_item = (PMC **)Parrot_pmc_array_shift(interp, todo, enum_type_PMC))) {
current = *list_item;
if (!current)
Parrot_ex_throw_from_c_args(interp, NULL, 1,
@@ -1102,7 +1102,7 @@
if (current == info->thaw_result)
finished_first = 1;
if (current->vtable->thawfinish != interp->vtables[enum_class_default]->thawfinish)
- list_unshift(interp, finish_list, current, enum_type_PMC);
+ Parrot_pmc_array_unshift(interp, finish_list, current, enum_type_PMC);
}
}
@@ -1116,12 +1116,12 @@
/* on thawing call thawfinish for each processed PMC */
if (!finished_first)
- list_unshift(interp, finish_list, info->thaw_result, enum_type_PMC);
+ Parrot_pmc_array_unshift(interp, finish_list, info->thaw_result, enum_type_PMC);
- n = Parrot_array_length(interp, finish_list);
+ n = Parrot_pmc_array_length(interp, finish_list);
for (i = 0; i < n ; ++i) {
- current = *(PMC**)list_get(interp, finish_list, i, enum_type_PMC);
+ current = *(PMC**)Parrot_pmc_array_get(interp, finish_list, i, enum_type_PMC);
if (!PMC_IS_NULL(current))
VTABLE_thawfinish(interp, current, info);
}
More information about the parrot-commits
mailing list