Skip to content

Commit

Permalink
set two functions as pure. Use size_t instead of int in loop vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Mar 13, 2011
1 parent f629de3 commit cdeeae0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/parrot/misc.h
Expand Up @@ -33,6 +33,7 @@ typedef int (*reg_move_func)(PARROT_INTERP, unsigned char d, unsigned char s, vo

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
INTVAL Parrot_util_byte_index(SHIM_INTERP,
ARGIN(const STRING *base),
ARGIN(const STRING *search),
Expand All @@ -42,6 +43,7 @@ INTVAL Parrot_util_byte_index(SHIM_INTERP,

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
INTVAL Parrot_util_byte_rindex(SHIM_INTERP,
ARGIN(const STRING *base),
ARGIN(const STRING *search),
Expand Down
6 changes: 4 additions & 2 deletions src/utils.c
Expand Up @@ -594,6 +594,7 @@ Returns an offset value if it is found, or -1 if no match.

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
INTVAL
Parrot_util_byte_index(SHIM_INTERP, ARGIN(const STRING *base),
ARGIN(const STRING *search), UINTVAL start_offset)
Expand Down Expand Up @@ -643,6 +644,7 @@ Returns offset value or -1 (if no match).

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
INTVAL
Parrot_util_byte_rindex(SHIM_INTERP, ARGIN(const STRING *base),
ARGIN(const STRING *search), UINTVAL start_offset)
Expand Down Expand Up @@ -825,8 +827,8 @@ Parrot_util_register_move(PARROT_INTERP,
ARGIN(void *info))
{
ASSERT_ARGS(Parrot_util_register_move)
int i;
int max_reg = 0;
size_t i;
size_t max_reg = 0;
int* nb_succ = NULL;
int* backup = NULL;
int* reg_to_index = NULL;
Expand Down

0 comments on commit cdeeae0

Please sign in to comment.