Use 'const' in string iterations.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-03-31 10:17:50 +02:00
parent 9dad7dbfba
commit c98cb65373
16 changed files with 70 additions and 66 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ re_hex_lookup (re_parser_ctx_t *parser_ctx_p, /**< RegExp parser context */
uint32_t lookup) /**< size of lookup */
{
bool is_digit = true;
lit_utf8_byte_t *curr_p = parser_ctx_p->input_curr_p;
const lit_utf8_byte_t *curr_p = parser_ctx_p->input_curr_p;
for (uint32_t i = 0; is_digit && i < lookup; i++)
{
@@ -259,7 +259,7 @@ re_count_num_of_groups (re_parser_ctx_t *parser_ctx_p) /**< RegExp parser contex
{
int char_class_in = 0;
parser_ctx_p->num_of_groups = 0;
lit_utf8_byte_t *curr_p = (lit_utf8_byte_t *) parser_ctx_p->input_start_p;
const lit_utf8_byte_t *curr_p = parser_ctx_p->input_start_p;
while (curr_p < parser_ctx_p->input_end_p)
{
+1 -1
View File
@@ -93,7 +93,7 @@ typedef struct
typedef struct
{
const lit_utf8_byte_t *input_start_p; /**< start of input pattern */
lit_utf8_byte_t *input_curr_p; /**< current position in input pattern */
const lit_utf8_byte_t *input_curr_p; /**< current position in input pattern */
const lit_utf8_byte_t *input_end_p; /**< end of input pattern */
int num_of_groups; /**< number of groups */
uint32_t num_of_classes; /**< number of character classes */