[svn:parrot] r45342 - in branches/avl_string_cache: include/parrot src/string
bacek at svn.parrot.org
bacek at svn.parrot.org
Wed Mar 31 07:18:05 UTC 2010
Author: bacek
Date: Wed Mar 31 07:18:04 2010
New Revision: 45342
URL: https://trac.parrot.org/parrot/changeset/45342
Log:
Made string_node_compare non-static
Modified:
branches/avl_string_cache/include/parrot/string.h
branches/avl_string_cache/include/parrot/string_funcs.h
branches/avl_string_cache/src/string/api.c
Modified: branches/avl_string_cache/include/parrot/string.h
==============================================================================
--- branches/avl_string_cache/include/parrot/string.h Wed Mar 31 06:19:01 2010 (r45341)
+++ branches/avl_string_cache/include/parrot/string.h Wed Mar 31 07:18:04 2010 (r45342)
@@ -72,6 +72,7 @@
TREE_ENTRY(avl_string_node_t) tree;
};
+typedef TREE_HEAD(_Tree, avl_string_node_t) ConstStringTree;
#endif /* PARROT_IN_CORE */
#endif /* PARROT_STRING_H_GUARD */
Modified: branches/avl_string_cache/include/parrot/string_funcs.h
==============================================================================
--- branches/avl_string_cache/include/parrot/string_funcs.h Wed Mar 31 06:19:01 2010 (r45341)
+++ branches/avl_string_cache/include/parrot/string_funcs.h Wed Mar 31 07:18:04 2010 (r45342)
@@ -575,6 +575,12 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*tc);
+int Parrot_str_string_node_compare(
+ ARGIN(AVLStringNode *lhs),
+ ARGIN(AVLStringNode *rhs))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
#define ASSERT_ARGS_Parrot_str_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_str_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -750,6 +756,10 @@
#define ASSERT_ARGS_Parrot_str_from_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(tc))
+#define ASSERT_ARGS_Parrot_str_string_node_compare \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(lhs) \
+ , PARROT_ASSERT_ARG(rhs))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/string/api.c */
Modified: branches/avl_string_cache/src/string/api.c
==============================================================================
--- branches/avl_string_cache/src/string/api.c Wed Mar 31 06:19:01 2010 (r45341)
+++ branches/avl_string_cache/src/string/api.c Wed Mar 31 07:18:04 2010 (r45342)
@@ -49,7 +49,6 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*s);
-static int string_node_compare(AVLStringNode *lhs, AVLStringNode *rhs);
PARROT_INLINE
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
@@ -65,7 +64,6 @@
#define ASSERT_ARGS_make_writable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
-#define ASSERT_ARGS_string_node_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_string_rep_compatible __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(a) \
, PARROT_ASSERT_ARG(b) \
@@ -715,10 +713,19 @@
"invalid string representation");
}
-static int
-string_node_compare(ARGIN(AVLStringNode *lhs), ARGIN(AVLStringNode *rhs))
+/*
+=item C<int Parrot_str_string_node_compare(AVLStringNode *lhs, AVLStringNode
+*rhs)>
+
+Compare nodes in AVL cache.
+
+=cut
+*/
+
+int
+Parrot_str_string_node_compare(ARGIN(AVLStringNode *lhs), ARGIN(AVLStringNode *rhs))
{
- ASSERT_ARGS(string_node_compare)
+ ASSERT_ARGS(Parrot_str_string_node_compare)
if (lhs->length < rhs->length)
return -1;
else if (lhs->length > rhs->length)
@@ -740,7 +747,6 @@
return memcmp(lhs->str, rhs->str, lhs->length);
}
-typedef TREE_HEAD(_Tree, avl_string_node_t) ConstStringTree;
TREE_DEFINE(avl_string_node_t, tree);
@@ -780,7 +786,7 @@
ARGIN(const ENCODING *encoding), ARGIN(const CHARSET *charset), UINTVAL flags)
{
ASSERT_ARGS(Parrot_str_new_constant_ex)
- static ConstStringTree tree = TREE_INITIALIZER(string_node_compare);
+ static ConstStringTree tree = TREE_INITIALIZER(Parrot_str_string_node_compare);
/* Lookup old value */
AVLStringNode node = {
More information about the parrot-commits
mailing list