Adding const qualifier to ecma_string_t* in ecma-string comparison and property search routines.
This commit is contained in:
@@ -257,7 +257,7 @@ ecma_deref_ecma_string (ecma_string_t *string_p) /**< ecma-string */
|
|||||||
* Convert ecma-string to number
|
* Convert ecma-string to number
|
||||||
*/
|
*/
|
||||||
ecma_number_t
|
ecma_number_t
|
||||||
ecma_string_to_number (ecma_string_t *str_p) /**< ecma-string */
|
ecma_string_to_number (const ecma_string_t *str_p) /**< ecma-string */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT (str_p != NULL);
|
JERRY_ASSERT (str_p != NULL);
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ ecma_string_get_required_buffer_size_for_zt_form (const ecma_string_t *string_de
|
|||||||
* as negation of buffer size, that is required to hold the string's content.
|
* as negation of buffer size, that is required to hold the string's content.
|
||||||
*/
|
*/
|
||||||
ssize_t
|
ssize_t
|
||||||
ecma_string_to_zt_string (ecma_string_t *string_desc_p, /**< ecma-string descriptor */
|
ecma_string_to_zt_string (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
|
||||||
ecma_char_t *buffer_p, /**< destination buffer */
|
ecma_char_t *buffer_p, /**< destination buffer */
|
||||||
ssize_t buffer_size) /**< size of buffer */
|
ssize_t buffer_size) /**< size of buffer */
|
||||||
{
|
{
|
||||||
@@ -492,12 +492,12 @@ ecma_compare_ecma_string_to_zt_string (const ecma_string_t *string_p, /**< ecma-
|
|||||||
* false - otherwise.
|
* false - otherwise.
|
||||||
*/
|
*/
|
||||||
static bool __noinline
|
static bool __noinline
|
||||||
ecma_compare_ecma_string_to_ecma_string_longpath (ecma_string_t *string1_p, /* ecma-string */
|
ecma_compare_ecma_string_to_ecma_string_longpath (const ecma_string_t *string1_p, /* ecma-string */
|
||||||
ecma_string_t *string2_p) /* ecma-string */
|
const ecma_string_t *string2_p) /* ecma-string */
|
||||||
{
|
{
|
||||||
if (string1_p->container == ECMA_STRING_CONTAINER_HEAP_CHUNKS)
|
if (string1_p->container == ECMA_STRING_CONTAINER_HEAP_CHUNKS)
|
||||||
{
|
{
|
||||||
ecma_string_t *tmp_string_p = string1_p;
|
const ecma_string_t *tmp_string_p = string1_p;
|
||||||
string1_p = string2_p;
|
string1_p = string2_p;
|
||||||
string2_p = tmp_string_p;
|
string2_p = tmp_string_p;
|
||||||
}
|
}
|
||||||
@@ -602,8 +602,8 @@ ecma_compare_ecma_string_to_ecma_string_longpath (ecma_string_t *string1_p, /* e
|
|||||||
* false - otherwise.
|
* false - otherwise.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ecma_compare_ecma_string_to_ecma_string (ecma_string_t *string1_p, /* ecma-string */
|
ecma_compare_ecma_string_to_ecma_string (const ecma_string_t *string1_p, /* ecma-string */
|
||||||
ecma_string_t *string2_p) /* ecma-string */
|
const ecma_string_t *string2_p) /* ecma-string */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT (string1_p != NULL && string2_p != NULL);
|
JERRY_ASSERT (string1_p != NULL && string2_p != NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ ecma_create_named_accessor_property (ecma_object_t *obj_p, /**< object */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in */
|
ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in */
|
||||||
ecma_string_t *name_p) /**< property's name */
|
const ecma_string_t *name_p) /**< property's name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT(obj_p != NULL);
|
JERRY_ASSERT(obj_p != NULL);
|
||||||
JERRY_ASSERT(name_p != NULL);
|
JERRY_ASSERT(name_p != NULL);
|
||||||
@@ -320,7 +320,7 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_get_named_property (ecma_object_t *obj_p, /**< object to find property in */
|
ecma_get_named_property (ecma_object_t *obj_p, /**< object to find property in */
|
||||||
ecma_string_t *name_p) /**< property's name */
|
const ecma_string_t *name_p) /**< property's name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT(obj_p != NULL);
|
JERRY_ASSERT(obj_p != NULL);
|
||||||
JERRY_ASSERT(name_p != NULL);
|
JERRY_ASSERT(name_p != NULL);
|
||||||
@@ -343,7 +343,7 @@ ecma_get_named_property (ecma_object_t *obj_p, /**< object to find property in *
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_get_named_data_property (ecma_object_t *obj_p, /**< object to find property in */
|
ecma_get_named_data_property (ecma_object_t *obj_p, /**< object to find property in */
|
||||||
ecma_string_t *name_p) /**< property's name */
|
const ecma_string_t *name_p) /**< property's name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT(obj_p != NULL);
|
JERRY_ASSERT(obj_p != NULL);
|
||||||
JERRY_ASSERT(name_p != NULL);
|
JERRY_ASSERT(name_p != NULL);
|
||||||
|
|||||||
@@ -93,13 +93,13 @@ extern ecma_string_t* ecma_new_ecma_string_from_number (ecma_number_t number);
|
|||||||
extern ecma_string_t* ecma_new_ecma_string_from_lit_index (literal_index_t lit_index);
|
extern ecma_string_t* ecma_new_ecma_string_from_lit_index (literal_index_t lit_index);
|
||||||
extern void ecma_ref_ecma_string (ecma_string_t *string_desc_p);
|
extern void ecma_ref_ecma_string (ecma_string_t *string_desc_p);
|
||||||
extern void ecma_deref_ecma_string (ecma_string_t *string_p);
|
extern void ecma_deref_ecma_string (ecma_string_t *string_p);
|
||||||
extern ecma_number_t ecma_string_to_number (ecma_string_t *str_p);
|
extern ecma_number_t ecma_string_to_number (const ecma_string_t *str_p);
|
||||||
extern ssize_t ecma_string_to_zt_string (ecma_string_t *string_desc_p,
|
extern ssize_t ecma_string_to_zt_string (const ecma_string_t *string_desc_p,
|
||||||
ecma_char_t *buffer_p,
|
ecma_char_t *buffer_p,
|
||||||
ssize_t buffer_size);
|
ssize_t buffer_size);
|
||||||
extern int32_t ecma_compare_zt_string_to_zt_string (const ecma_char_t *string1_p, const ecma_char_t *string2_p);
|
extern int32_t ecma_compare_zt_string_to_zt_string (const ecma_char_t *string1_p, const ecma_char_t *string2_p);
|
||||||
extern bool ecma_compare_ecma_string_to_ecma_string (ecma_string_t *string1_p,
|
extern bool ecma_compare_ecma_string_to_ecma_string (const ecma_string_t *string1_p,
|
||||||
ecma_string_t *string2_p);
|
const ecma_string_t *string2_p);
|
||||||
|
|
||||||
/* ecma-helpers-number.c */
|
/* ecma-helpers-number.c */
|
||||||
extern bool ecma_number_is_nan (ecma_number_t num);
|
extern bool ecma_number_is_nan (ecma_number_t num);
|
||||||
@@ -167,11 +167,11 @@ extern ecma_property_t *ecma_create_named_accessor_property (ecma_object_t *obj_
|
|||||||
ecma_property_enumerable_value_t enumerable,
|
ecma_property_enumerable_value_t enumerable,
|
||||||
ecma_property_configurable_value_t configurable);
|
ecma_property_configurable_value_t configurable);
|
||||||
extern ecma_property_t *ecma_find_named_property (ecma_object_t *obj_p,
|
extern ecma_property_t *ecma_find_named_property (ecma_object_t *obj_p,
|
||||||
ecma_string_t *name_p);
|
const ecma_string_t *name_p);
|
||||||
extern ecma_property_t *ecma_get_named_property (ecma_object_t *obj_p,
|
extern ecma_property_t *ecma_get_named_property (ecma_object_t *obj_p,
|
||||||
ecma_string_t *name_p);
|
const ecma_string_t *name_p);
|
||||||
extern ecma_property_t *ecma_get_named_data_property (ecma_object_t *obj_p,
|
extern ecma_property_t *ecma_get_named_data_property (ecma_object_t *obj_p,
|
||||||
ecma_string_t *name_p);
|
const ecma_string_t *name_p);
|
||||||
|
|
||||||
extern void ecma_free_internal_property (ecma_property_t *prop_p);
|
extern void ecma_free_internal_property (ecma_property_t *prop_p);
|
||||||
extern void ecma_free_named_data_property (ecma_property_t *prop_p);
|
extern void ecma_free_named_data_property (ecma_property_t *prop_p);
|
||||||
|
|||||||
Reference in New Issue
Block a user