[svn:parrot] r36304 - in branches/pdd28str_part2: include/parrot src/jit/i386 src/ops src/pmc src/string t/tools/ops2pm/samples
allison at svn.parrot.org
allison at svn.parrot.org
Mon Feb 2 23:24:19 UTC 2009
Author: allison
Date: Mon Feb 2 23:24:16 2009
New Revision: 36304
URL: https://trac.parrot.org/parrot/changeset/36304
Log:
[pdd28str] Renaming bitwise and boolean string functions.
Modified:
branches/pdd28str_part2/include/parrot/string_funcs.h
branches/pdd28str_part2/src/jit/i386/core.jit
branches/pdd28str_part2/src/ops/bit.ops
branches/pdd28str_part2/src/ops/core.ops
branches/pdd28str_part2/src/pmc/boolean.pmc
branches/pdd28str_part2/src/pmc/string.pmc
branches/pdd28str_part2/src/string/api.c
branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.original
branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.second
Modified: branches/pdd28str_part2/include/parrot/string_funcs.h
==============================================================================
--- branches/pdd28str_part2/include/parrot/string_funcs.h Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/include/parrot/string_funcs.h Mon Feb 2 23:24:16 2009 (r36304)
@@ -138,7 +138,7 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
-STRING * string_bitwise_and(PARROT_INTERP,
+STRING * Parrot_str_bitwise_and(PARROT_INTERP,
ARGIN_NULLOK(const STRING *s1),
ARGIN_NULLOK(const STRING *s2),
ARGOUT_NULLOK(STRING **dest))
@@ -147,7 +147,7 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
-STRING * string_bitwise_not(PARROT_INTERP,
+STRING * Parrot_str_bitwise_not(PARROT_INTERP,
ARGIN_NULLOK(const STRING *s),
ARGOUT_NULLOK(STRING **dest))
__attribute__nonnull__(1)
@@ -155,7 +155,7 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
-STRING * string_bitwise_or(PARROT_INTERP,
+STRING * Parrot_str_bitwise_or(PARROT_INTERP,
ARGIN_NULLOK(const STRING *s1),
ARGIN_NULLOK(const STRING *s2),
ARGOUT_NULLOK(STRING **dest))
@@ -164,7 +164,7 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
-STRING * string_bitwise_xor(PARROT_INTERP,
+STRING * Parrot_str_bitwise_xor(PARROT_INTERP,
ARGIN_NULLOK(const STRING *s1),
ARGIN_NULLOK(const STRING *s2),
ARGOUT_NULLOK(STRING **dest))
@@ -173,7 +173,7 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
-INTVAL string_bool(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
+INTVAL Parrot_str_boolean(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
__attribute__nonnull__(1);
PARROT_EXPORT
@@ -579,15 +579,15 @@
|| PARROT_ASSERT_ARG(s)
#define ASSERT_ARGS_Parrot_str_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_bitwise_not __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_bitwise_not __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_bitwise_or __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_bitwise_or __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_bitwise_xor __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_bitwise_xor __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_bool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_boolean __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_string_capacity __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(s)
Modified: branches/pdd28str_part2/src/jit/i386/core.jit
==============================================================================
--- branches/pdd28str_part2/src/jit/i386/core.jit Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/src/jit/i386/core.jit Mon Feb 2 23:24:16 2009 (r36304)
@@ -1212,7 +1212,7 @@
push_<typ>(1);
Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
emitm_pushl_r(NATIVECODE, emit_ECX);
- CALL_FUNCTION(jit_info, string_bool);
+ CALL_FUNCTION(jit_info, Parrot_str_boolean);
emitm_addb_i_r(NATIVECODE, 8, emit_ESP);
jit_emit_test_r_i(NATIVECODE, emit_EAX);
jit_emit_jcc(jit_info, <op>, *INT_CONST[2]);
Modified: branches/pdd28str_part2/src/ops/bit.ops
==============================================================================
--- branches/pdd28str_part2/src/ops/bit.ops Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/src/ops/bit.ops Mon Feb 2 23:24:16 2009 (r36304)
@@ -102,7 +102,7 @@
=cut
inline op bands(inout STR, in STR) :base_core {
- string_bitwise_and(interp, $1, $2, &$1);
+ Parrot_str_bitwise_and(interp, $1, $2, &$1);
}
inline op bands(invar PMC, in STR) :base_core {
@@ -114,7 +114,7 @@
}
inline op bands(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_and(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_and(interp, $2, $3, NULL);
}
inline op bands(invar PMC, invar PMC, in STR) :base_core {
@@ -166,11 +166,11 @@
=cut
inline op bnots(inout STR) :base_core {
- string_bitwise_not(interp, $1, &$1);
+ Parrot_str_bitwise_not(interp, $1, &$1);
}
inline op bnots(out STR, in STR) :base_core {
- string_bitwise_not(interp, $2, &$1);
+ Parrot_str_bitwise_not(interp, $2, &$1);
}
inline op bnots(invar PMC) :base_core {
@@ -248,7 +248,7 @@
=cut
inline op bors(inout STR, in STR) :base_core {
- string_bitwise_or(interp, $1, $2, &$1);
+ Parrot_str_bitwise_or(interp, $1, $2, &$1);
}
inline op bors(invar PMC, in STR) :base_core {
@@ -260,7 +260,7 @@
}
inline op bors(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_or(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_or(interp, $2, $3, NULL);
}
inline op bors(invar PMC, invar PMC, in STR) :base_core {
@@ -502,7 +502,7 @@
=cut
inline op bxors(inout STR, in STR) :base_core {
- string_bitwise_xor(interp, $1, $2, &$1);
+ Parrot_str_bitwise_xor(interp, $1, $2, &$1);
}
inline op bxors(invar PMC, in STR) :base_core {
@@ -514,7 +514,7 @@
}
inline op bxors(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_xor(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_xor(interp, $2, $3, NULL);
}
inline op bxors(invar PMC, invar PMC, in STR) :base_core {
Modified: branches/pdd28str_part2/src/ops/core.ops
==============================================================================
--- branches/pdd28str_part2/src/ops/core.ops Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/src/ops/core.ops Mon Feb 2 23:24:16 2009 (r36304)
@@ -377,7 +377,7 @@
}
op if (invar STR, inconst LABEL) {
- if (string_bool(interp, $1))
+ if (Parrot_str_boolean(interp, $1))
goto OFFSET($2);
}
@@ -411,7 +411,7 @@
}
op unless(invar STR, inconst LABEL) {
- if (!string_bool(interp, $1))
+ if (!Parrot_str_boolean(interp, $1))
goto OFFSET($2);
}
Modified: branches/pdd28str_part2/src/pmc/boolean.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/boolean.pmc Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/src/pmc/boolean.pmc Mon Feb 2 23:24:16 2009 (r36304)
@@ -104,7 +104,7 @@
*/
VTABLE void set_string_native(STRING *value) {
- SELF.set_bool(string_bool(INTERP, value));
+ SELF.set_bool(Parrot_str_boolean(INTERP, value));
}
}
Modified: branches/pdd28str_part2/src/pmc/string.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/string.pmc Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/src/pmc/string.pmc Mon Feb 2 23:24:16 2009 (r36304)
@@ -167,7 +167,7 @@
VTABLE INTVAL get_bool() {
STRING * const s = SELF.get_string();
- return string_bool(INTERP, s);
+ return Parrot_str_boolean(INTERP, s);
}
/*
@@ -315,7 +315,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_or(INTERP, s, v, NULL));
+ Parrot_str_bitwise_or(INTERP, s, v, NULL));
return dest;
}
@@ -327,7 +327,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_or(INTERP, s, value, NULL));
+ Parrot_str_bitwise_or(INTERP, s, value, NULL));
return dest;
}
@@ -335,12 +335,12 @@
VTABLE void i_bitwise_ors(PMC *value) {
STRING *s = VTABLE_get_string(INTERP, SELF);
STRING * const v = VTABLE_get_string(INTERP, value);
- SELF.set_string_native(string_bitwise_or(INTERP, s, v, &s));
+ SELF.set_string_native(Parrot_str_bitwise_or(INTERP, s, v, &s));
}
VTABLE void i_bitwise_ors_str(STRING *value) {
STRING *s = VTABLE_get_string(INTERP, SELF);
- SELF.set_string_native(string_bitwise_or(INTERP, s, value, &s));
+ SELF.set_string_native(Parrot_str_bitwise_or(INTERP, s, value, &s));
}
VTABLE PMC *bitwise_ands(PMC *value, PMC *dest) {
@@ -351,7 +351,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_and(INTERP, s, v, NULL));
+ Parrot_str_bitwise_and(INTERP, s, v, NULL));
return dest;
}
@@ -363,7 +363,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_and(INTERP, s, value, NULL));
+ Parrot_str_bitwise_and(INTERP, s, value, NULL));
return dest;
}
@@ -372,12 +372,12 @@
VTABLE void i_bitwise_ands(PMC *value) {
STRING *s = VTABLE_get_string(INTERP, SELF);
STRING * const v = VTABLE_get_string(INTERP, value);
- SELF.set_string_native(string_bitwise_and(INTERP, s, v, &s));
+ SELF.set_string_native(Parrot_str_bitwise_and(INTERP, s, v, &s));
}
VTABLE void i_bitwise_ands_str(STRING *value) {
STRING *s = VTABLE_get_string(INTERP, SELF);
- SELF.set_string_native(string_bitwise_and(INTERP, s, value, &s));
+ SELF.set_string_native(Parrot_str_bitwise_and(INTERP, s, value, &s));
}
VTABLE PMC *bitwise_xors(PMC *value, PMC *dest) {
@@ -388,7 +388,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_xor(INTERP, s, v, NULL));
+ Parrot_str_bitwise_xor(INTERP, s, v, NULL));
return dest;
}
@@ -400,7 +400,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_xor(INTERP, s, value, NULL));
+ Parrot_str_bitwise_xor(INTERP, s, value, NULL));
return dest;
}
@@ -408,12 +408,12 @@
VTABLE void i_bitwise_xors(PMC *value) {
STRING *s = VTABLE_get_string(INTERP, SELF);
STRING * const v = VTABLE_get_string(INTERP, value);
- SELF.set_string_native(string_bitwise_xor(INTERP, s, v, &s));
+ SELF.set_string_native(Parrot_str_bitwise_xor(INTERP, s, v, &s));
}
VTABLE void i_bitwise_xors_str(STRING *value) {
STRING *s = VTABLE_get_string(INTERP, SELF);
- SELF.set_string_native(string_bitwise_xor(INTERP, s, value, &s));
+ SELF.set_string_native(Parrot_str_bitwise_xor(INTERP, s, value, &s));
}
VTABLE PMC *bitwise_nots(PMC *dest) {
@@ -423,7 +423,7 @@
dest = pmc_new(INTERP, SELF->vtable->base_type);
VTABLE_set_string_native(INTERP, dest,
- string_bitwise_not(INTERP, s, NULL));
+ Parrot_str_bitwise_not(INTERP, s, NULL));
return dest;
}
@@ -431,7 +431,7 @@
VTABLE void i_bitwise_nots() {
STRING *s = VTABLE_get_string(INTERP, SELF);
VTABLE_set_string_native(
- INTERP, SELF, string_bitwise_not(INTERP, s, &s));
+ INTERP, SELF, Parrot_str_bitwise_not(INTERP, s, &s));
}
/*
Modified: branches/pdd28str_part2/src/string/api.c
==============================================================================
--- branches/pdd28str_part2/src/string/api.c Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/src/string/api.c Mon Feb 2 23:24:16 2009 (r36304)
@@ -1534,7 +1534,7 @@
/*
-=item C<STRING * string_bitwise_and>
+=item C<STRING * Parrot_str_bitwise_and>
Performs a bitwise C<AND> on two Parrot string, performing type and encoding
conversions if necessary. If the second string is not C<NULL> then it is
@@ -1547,10 +1547,10 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_bitwise_and(PARROT_INTERP, ARGIN_NULLOK(const STRING *s1),
+Parrot_str_bitwise_and(PARROT_INTERP, ARGIN_NULLOK(const STRING *s1),
ARGIN_NULLOK(const STRING *s2), ARGOUT_NULLOK(STRING **dest))
{
- ASSERT_ARGS(string_bitwise_and)
+ ASSERT_ARGS(Parrot_str_bitwise_and)
STRING *res;
size_t minlen;
@@ -1685,7 +1685,7 @@
/*
-=item C<STRING * string_bitwise_or>
+=item C<STRING * Parrot_str_bitwise_or>
Performs a bitwise C<OR> on two Parrot strings, performing type and encoding
conversions if necessary. If the third string is not C<NULL>, then it is
@@ -1698,10 +1698,10 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_bitwise_or(PARROT_INTERP, ARGIN_NULLOK(const STRING *s1),
+Parrot_str_bitwise_or(PARROT_INTERP, ARGIN_NULLOK(const STRING *s1),
ARGIN_NULLOK(const STRING *s2), ARGOUT_NULLOK(STRING **dest))
{
- ASSERT_ARGS(string_bitwise_or)
+ ASSERT_ARGS(Parrot_str_bitwise_or)
STRING *res;
size_t maxlen = 0;
@@ -1760,7 +1760,7 @@
/*
-=item C<STRING * string_bitwise_xor>
+=item C<STRING * Parrot_str_bitwise_xor>
Performs a bitwise C<XOR> on two Parrot strings, performing type and encoding
conversions if necessary. If the second string is not C<NULL>, then it is
@@ -1773,10 +1773,10 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_bitwise_xor(PARROT_INTERP, ARGIN_NULLOK(const STRING *s1),
+Parrot_str_bitwise_xor(PARROT_INTERP, ARGIN_NULLOK(const STRING *s1),
ARGIN_NULLOK(const STRING *s2), ARGOUT_NULLOK(STRING **dest))
{
- ASSERT_ARGS(string_bitwise_xor)
+ ASSERT_ARGS(Parrot_str_bitwise_xor)
STRING *res;
size_t maxlen = 0;
@@ -1847,7 +1847,7 @@
/*
-=item C<STRING * string_bitwise_not>
+=item C<STRING * Parrot_str_bitwise_not>
Performs a bitwise C<NOT> on a Parrot string. If the second string is
not C<NULL> then it is reused, otherwise a new Parrot string is created.
@@ -1859,10 +1859,10 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_bitwise_not(PARROT_INTERP, ARGIN_NULLOK(const STRING *s),
+Parrot_str_bitwise_not(PARROT_INTERP, ARGIN_NULLOK(const STRING *s),
ARGOUT_NULLOK(STRING **dest))
{
- ASSERT_ARGS(string_bitwise_not)
+ ASSERT_ARGS(Parrot_str_bitwise_not)
STRING *res;
size_t len;
@@ -1912,7 +1912,7 @@
/*
-=item C<INTVAL string_bool>
+=item C<INTVAL Parrot_str_boolean>
Returns whether the specified Parrot string is true. A string is true if it is
equal to anything other than C<0>, C<""> or C<"0">.
@@ -1924,9 +1924,9 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL
-string_bool(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
+Parrot_str_boolean(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
{
- ASSERT_ARGS(string_bool)
+ ASSERT_ARGS(Parrot_str_boolean)
const INTVAL len = s ? Parrot_str_byte_length(interp, s) : 0;
if (len == 0)
Modified: branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.original
==============================================================================
--- branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.original Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.original Mon Feb 2 23:24:16 2009 (r36304)
@@ -73,11 +73,11 @@
=cut
inline op bands(inout STR, in STR) :base_core {
- string_bitwise_and(interp, $1, $2, &$1);
+ Parrot_str_bitwise_and(interp, $1, $2, &$1);
}
inline op bands(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_and(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_and(interp, $2, $3, NULL);
}
########################################
@@ -133,11 +133,11 @@
=cut
inline op bnots(inout STR) :base_core {
- string_bitwise_not(interp, $1, &$1);
+ Parrot_str_bitwise_not(interp, $1, &$1);
}
inline op bnots(out STR, in STR) :base_core {
- string_bitwise_not(interp, $2, &$1);
+ Parrot_str_bitwise_not(interp, $2, &$1);
}
inline op bnots(invar PMC) :base_core {
@@ -187,11 +187,11 @@
=cut
inline op bors(inout STR, in STR) :base_core {
- string_bitwise_or(interp, $1, $2, &$1);
+ Parrot_str_bitwise_or(interp, $1, $2, &$1);
}
inline op bors(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_or(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_or(interp, $2, $3, NULL);
}
########################################
@@ -321,11 +321,11 @@
=cut
inline op bxors(inout STR, in STR) :base_core {
- string_bitwise_xor(interp, $1, $2, &$1);
+ Parrot_str_bitwise_xor(interp, $1, $2, &$1);
}
inline op bxors(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_xor(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_xor(interp, $2, $3, NULL);
}
=back
Modified: branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.second
==============================================================================
--- branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.second Mon Feb 2 22:39:59 2009 (r36303)
+++ branches/pdd28str_part2/t/tools/ops2pm/samples/bit_ops.second Mon Feb 2 23:24:16 2009 (r36304)
@@ -73,11 +73,11 @@
=cut
inline op bands(inout STR, in STR) :base_core {
- string_bitwise_and(interp, $1, $2, &$1);
+ Parrot_str_bitwise_and(interp, $1, $2, &$1);
}
inline op bands(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_and(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_and(interp, $2, $3, NULL);
}
########################################
@@ -133,11 +133,11 @@
=cut
inline op bnots(inout STR) :base_core {
- string_bitwise_not(interp, $1, &$1);
+ Parrot_str_bitwise_not(interp, $1, &$1);
}
inline op bnots(out STR, in STR) :base_core {
- string_bitwise_not(interp, $2, &$1);
+ Parrot_str_bitwise_not(interp, $2, &$1);
}
inline op bnots(invar PMC) :base_core {
@@ -187,11 +187,11 @@
=cut
inline op bors(inout STR, in STR) :base_core {
- string_bitwise_or(interp, $1, $2, &$1);
+ Parrot_str_bitwise_or(interp, $1, $2, &$1);
}
inline op bors(out STR, in STR, in STR) :base_core {
- $1 = string_bitwise_or(interp, $2, $3, NULL);
+ $1 = Parrot_str_bitwise_or(interp, $2, $3, NULL);
}
########################################
More information about the parrot-commits
mailing list