[svn:parrot] r41411 - in trunk: include/parrot src
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Tue Sep 22 20:14:31 UTC 2009
Author: NotFound
Date: Tue Sep 22 20:14:29 2009
New Revision: 41411
URL: https://trac.parrot.org/parrot/changeset/41411
Log:
[core] rename list_delete and list_length functions, TT #1057
Modified:
trunk/include/parrot/list.h
trunk/src/list.c
trunk/src/pmc_freeze.c
Modified: trunk/include/parrot/list.h
==============================================================================
--- trunk/include/parrot/list.h Tue Sep 22 18:26:08 2009 (r41410)
+++ trunk/include/parrot/list.h Tue Sep 22 20:14:29 2009 (r41411)
@@ -101,15 +101,6 @@
__attribute__nonnull__(2);
PARROT_EXPORT
-void list_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)
@@ -217,9 +208,18 @@
__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 list_length(SHIM_INTERP, ARGIN(const List *list))
+INTVAL Parrot_array_length(SHIM_INTERP, ARGIN(const List *list))
__attribute__nonnull__(2);
#define ASSERT_ARGS_ld __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
@@ -229,9 +229,6 @@
#define ASSERT_ARGS_list_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(other)
-#define ASSERT_ARGS_list_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- && PARROT_ASSERT_ARG(list)
#define ASSERT_ARGS_list_get __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list)
@@ -276,7 +273,10 @@
PARROT_ASSERT_ARG(interp) \
&& PARROT_ASSERT_ARG(list) \
&& PARROT_ASSERT_ARG(pinfo)
-#define ASSERT_ARGS_list_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#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 = \
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 18:26:08 2009 (r41410)
+++ trunk/src/list.c Tue Sep 22 20:14:29 2009 (r41411)
@@ -1653,7 +1653,7 @@
visit_info * const info = (visit_info*) pinfo;
UINTVAL idx;
- const UINTVAL n = list_length(interp, list);
+ const UINTVAL n = Parrot_array_length(interp, list);
PARROT_ASSERT(list->item_type == enum_type_PMC);
for (idx = 0, chunk = list->first; chunk; chunk = chunk->next) {
@@ -1675,7 +1675,7 @@
/*
-=item C<INTVAL list_length(PARROT_INTERP, const List *list)>
+=item C<INTVAL Parrot_array_length(PARROT_INTERP, const List *list)>
Returns the length of the list.
@@ -1686,9 +1686,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
INTVAL
-list_length(SHIM_INTERP, ARGIN(const List *list))
+Parrot_array_length(SHIM_INTERP, ARGIN(const List *list))
{
- ASSERT_ARGS(list_length)
+ ASSERT_ARGS(Parrot_array_length)
return list->length;
}
@@ -1821,7 +1821,8 @@
/*
-=item C<void list_delete(PARROT_INTERP, List *list, INTVAL idx, INTVAL n_items)>
+=item C<void Parrot_array_delete(PARROT_INTERP, List *list, INTVAL idx, INTVAL
+n_items)>
Deletes C<n_items> at C<idx>.
@@ -1831,9 +1832,9 @@
PARROT_EXPORT
void
-list_delete(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
+Parrot_array_delete(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
{
- ASSERT_ARGS(list_delete)
+ ASSERT_ARGS(Parrot_array_delete)
List_chunk *chunk;
PARROT_ASSERT(idx >= 0);
@@ -2199,7 +2200,7 @@
}
/* else delete the rest */
else
- list_delete(interp, list, offset + i, count - i);
+ Parrot_array_delete(interp, list, offset + i, count - i);
}
Modified: trunk/src/pmc_freeze.c
==============================================================================
--- trunk/src/pmc_freeze.c Tue Sep 22 18:26:08 2009 (r41410)
+++ trunk/src/pmc_freeze.c Tue Sep 22 20:14:29 2009 (r41411)
@@ -1118,7 +1118,7 @@
if (!finished_first)
list_unshift(interp, finish_list, info->thaw_result, enum_type_PMC);
- n = list_length(interp, finish_list);
+ n = Parrot_array_length(interp, finish_list);
for (i = 0; i < n ; ++i) {
current = *(PMC**)list_get(interp, finish_list, i, enum_type_PMC);
More information about the parrot-commits
mailing list