[svn:parrot] r48531 - in branches/substr_eq_at: include/parrot src/ops src/string
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Mon Aug 16 18:55:16 UTC 2010
Author: chromatic
Date: Mon Aug 16 18:55:16 2010
New Revision: 48531
URL: https://trac.parrot.org/parrot/changeset/48531
Log:
[str] Added length to Parrot_str_compare_offset.
Modified:
branches/substr_eq_at/include/parrot/string_funcs.h
branches/substr_eq_at/src/ops/core_ops.c
branches/substr_eq_at/src/ops/experimental.ops
branches/substr_eq_at/src/string/api.c
Modified: branches/substr_eq_at/include/parrot/string_funcs.h
==============================================================================
--- branches/substr_eq_at/include/parrot/string_funcs.h Mon Aug 16 18:55:11 2010 (r48530)
+++ branches/substr_eq_at/include/parrot/string_funcs.h Mon Aug 16 18:55:16 2010 (r48531)
@@ -97,11 +97,12 @@
PARROT_WARN_UNUSED_RESULT
INTVAL Parrot_str_compare_offset(PARROT_INTERP,
ARGIN(const STRING *a),
+ ARGIN(const STRING *b),
INTVAL offset,
- ARGIN(const STRING *b))
+ INTVAL length)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- __attribute__nonnull__(4);
+ __attribute__nonnull__(3);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
Modified: branches/substr_eq_at/src/ops/core_ops.c
==============================================================================
--- branches/substr_eq_at/src/ops/core_ops.c Mon Aug 16 18:55:11 2010 (r48530)
+++ branches/substr_eq_at/src/ops/core_ops.c Mon Aug 16 18:55:16 2010 (r48531)
@@ -26319,112 +26319,112 @@
opcode_t *
Parrot_cmp_str_at_i_s_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_s_i_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_sc_i_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_s_ic_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_sc_ic_i(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_s_i_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_sc_i_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, IREG(4));
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, IREG(4), IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), SREG(3), cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_s_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, SREG(3), cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_s_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, SREG(2), CONST(3).u.string, cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
opcode_t *
Parrot_cmp_str_at_i_sc_sc_ic_ic(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, cur_opcode[4]);
+ IREG(1) = Parrot_str_compare_offset(interp, CONST(2).u.string, CONST(3).u.string, cur_opcode[4], IREG(5));
return (opcode_t *)cur_opcode + 6;}
Modified: branches/substr_eq_at/src/ops/experimental.ops
==============================================================================
--- branches/substr_eq_at/src/ops/experimental.ops Mon Aug 16 18:55:11 2010 (r48530)
+++ branches/substr_eq_at/src/ops/experimental.ops Mon Aug 16 18:55:16 2010 (r48531)
@@ -424,7 +424,7 @@
=cut
op cmp_str_at(out INT, in STR, in STR, in INT, in INT) {
- $1 = Parrot_str_compare_offset(interp, $2, $3, $4);
+ $1 = Parrot_str_compare_offset(interp, $2, $3, $4, $5);
}
=back
Modified: branches/substr_eq_at/src/string/api.c
==============================================================================
--- branches/substr_eq_at/src/string/api.c Mon Aug 16 18:55:11 2010 (r48530)
+++ branches/substr_eq_at/src/string/api.c Mon Aug 16 18:55:16 2010 (r48531)
@@ -1328,8 +1328,8 @@
/*
-=item C<INTVAL Parrot_str_compare_offset(PARROT_INTERP, const STRING *a, INTVAL
-offset, const STRING *b)>
+=item C<INTVAL Parrot_str_compare_offset(PARROT_INTERP, const STRING *a, const
+STRING *b, INTVAL offset, INTVAL length)>
Compares two strings to each other. If s1 is less than s2, returns -1. If the
strings are equal, returns 0. If s1 is greater than s2, returns 2. This
@@ -1345,8 +1345,8 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL
-Parrot_str_compare_offset(PARROT_INTERP, ARGIN(const STRING *a), INTVAL offset,
- ARGIN(const STRING *b))
+Parrot_str_compare_offset(PARROT_INTERP, ARGIN(const STRING *a),
+ ARGIN(const STRING *b), INTVAL offset, INTVAL length)
{
ASSERT_ARGS(Parrot_str_compare_offset)
More information about the parrot-commits
mailing list