mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Renaming jerry_* identifiers from 'camelCase' to 'underscore_naming'.
This commit is contained in:
parent
c0df259726
commit
79f3d97434
@ -54,7 +54,7 @@ typedef enum
|
||||
ERR_STRING = -8,
|
||||
ERR_PARSER = -9,
|
||||
ERR_GENERAL = -255
|
||||
} jerry_Status_t;
|
||||
} jerry_status_t;
|
||||
|
||||
/**
|
||||
* Asserts
|
||||
@ -77,12 +77,12 @@ typedef enum
|
||||
*
|
||||
* May be used for static assertion checks.
|
||||
*/
|
||||
extern uint32_t jerry_UnreferencedExpression;
|
||||
extern uint32_t jerry_unreferenced_expression;
|
||||
|
||||
extern void __noreturn jerry_AssertFail( const char *assertion, const char *file, const uint32_t line);
|
||||
extern void __noreturn jerry_assert_fail( const char *assertion, const char *file, const uint32_t line);
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
#define JERRY_ASSERT( x ) do { if ( __builtin_expect( !( x ), 0 ) ) { jerry_AssertFail( #x, __FILE__, __LINE__); } } while(0)
|
||||
#define JERRY_ASSERT( x ) do { if ( __builtin_expect( !( x ), 0 ) ) { jerry_assert_fail( #x, __FILE__, __LINE__); } } while(0)
|
||||
#else /* !JERRY_NDEBUG */
|
||||
#define JERRY_ASSERT( x ) (void) (x)
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
@ -90,10 +90,10 @@ extern void __noreturn jerry_AssertFail( const char *assertion, const char *file
|
||||
/**
|
||||
* Mark for unreachable points and unimplemented cases
|
||||
*/
|
||||
extern void jerry_RefUnusedVariables(int unused_variables_follow, ...);
|
||||
#define JERRY_UNREACHABLE() do { JERRY_ASSERT( false); jerry_Exit( ERR_GENERAL); } while (0)
|
||||
extern void jerry_ref_unused_variables(int unused_variables_follow, ...);
|
||||
#define JERRY_UNREACHABLE() do { JERRY_ASSERT( false); jerry_exit( ERR_GENERAL); } while (0)
|
||||
#define JERRY_UNIMPLEMENTED() JERRY_UNREACHABLE()
|
||||
#define JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(...) do { JERRY_UNIMPLEMENTED(); if ( false ) { jerry_RefUnusedVariables( 0, __VA_ARGS__); } } while (0)
|
||||
#define JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(...) do { JERRY_UNIMPLEMENTED(); if ( false ) { jerry_ref_unused_variables( 0, __VA_ARGS__); } } while (0)
|
||||
|
||||
/**
|
||||
* Conditions' likeliness, unlikeliness.
|
||||
@ -104,7 +104,7 @@ extern void jerry_RefUnusedVariables(int unused_variables_follow, ...);
|
||||
/**
|
||||
* Exit
|
||||
*/
|
||||
extern void __noreturn jerry_Exit( jerry_Status_t code);
|
||||
extern void __noreturn jerry_exit( jerry_status_t code);
|
||||
|
||||
/**
|
||||
* sizeof, offsetof, ...
|
||||
@ -138,9 +138,9 @@ extern void __noreturn jerry_Exit( jerry_Status_t code);
|
||||
/**
|
||||
* Bit-fields
|
||||
*/
|
||||
inline uint32_t jerry_ExtractBitField(uint32_t value, uint32_t lsb,
|
||||
inline uint32_t jerry_extract_bit_field(uint32_t value, uint32_t lsb,
|
||||
uint32_t width);
|
||||
inline uint32_t jerry_SetBitFieldValue(uint32_t value, uint32_t bitFieldValue,
|
||||
inline uint32_t jerry_set_bit_field_value(uint32_t value, uint32_t bitFieldValue,
|
||||
uint32_t lsb, uint32_t width);
|
||||
|
||||
/**
|
||||
@ -149,7 +149,7 @@ inline uint32_t jerry_SetBitFieldValue(uint32_t value, uint32_t bitFieldValue,
|
||||
* @return bit-field's value
|
||||
*/
|
||||
inline uint32_t
|
||||
jerry_ExtractBitField(uint32_t
|
||||
jerry_extract_bit_field(uint32_t
|
||||
container, /**< container to extract bit-field from */
|
||||
uint32_t lsb, /**< least significant bit of the value
|
||||
* to be extracted */
|
||||
@ -162,7 +162,7 @@ jerry_ExtractBitField(uint32_t
|
||||
uint32_t bitFieldMask = (1u << width) - 1;
|
||||
|
||||
return ( shiftedValue & bitFieldMask);
|
||||
} /* jerry_ExtractBitField */
|
||||
} /* jerry_extract_bit_field */
|
||||
|
||||
/**
|
||||
* Extract a bit-field from the integer.
|
||||
@ -170,7 +170,7 @@ jerry_ExtractBitField(uint32_t
|
||||
* @return bit-field's value
|
||||
*/
|
||||
inline uint32_t
|
||||
jerry_SetBitFieldValue(uint32_t
|
||||
jerry_set_bit_field_value(uint32_t
|
||||
container, /**< container to insert bit-field to */
|
||||
uint32_t newBitFieldValue, /**< value of bit-field to insert */
|
||||
uint32_t lsb, /**< least significant bit of the value
|
||||
@ -186,6 +186,6 @@ jerry_SetBitFieldValue(uint32_t
|
||||
uint32_t shiftedNewBitFieldValue = newBitFieldValue << lsb;
|
||||
|
||||
return ( container & ~shiftedBitFieldMask) | shiftedNewBitFieldValue;
|
||||
} /* jerry_SetBitFieldValue */
|
||||
} /* jerry_set_bit_field_value */
|
||||
|
||||
#endif /* !JERRY_GLOBALS_H */
|
||||
|
||||
@ -49,7 +49,7 @@ typedef enum {
|
||||
((size) == 16 ? MEM_POOL_CHUNK_TYPE_16 : \
|
||||
((size) == 32 ? MEM_POOL_CHUNK_TYPE_32 : \
|
||||
((size) == 64 ? MEM_POOL_CHUNK_TYPE_64 : \
|
||||
jerry_UnreferencedExpression)))))
|
||||
jerry_unreferenced_expression)))))
|
||||
|
||||
extern size_t mem_get_chunk_size( mem_pool_chunk_type_t chunkType);
|
||||
|
||||
|
||||
@ -1815,10 +1815,10 @@ parser_init (void)
|
||||
}
|
||||
|
||||
void
|
||||
parser_fatal (jerry_Status_t code)
|
||||
parser_fatal (jerry_status_t code)
|
||||
{
|
||||
__printf ("FATAL: %d\n", code);
|
||||
lexer_dump_buffer_state ();
|
||||
|
||||
jerry_Exit( code);
|
||||
jerry_exit( code);
|
||||
}
|
||||
|
||||
@ -21,6 +21,6 @@
|
||||
void parser_init (void);
|
||||
void parser_parse_program (void);
|
||||
|
||||
void parser_fatal (jerry_Status_t code);
|
||||
void parser_fatal (jerry_status_t code);
|
||||
|
||||
#endif
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* and call assertion fail handler.
|
||||
*/
|
||||
void __noreturn
|
||||
jerry_Exit( jerry_Status_t code) /**< status code */
|
||||
jerry_exit( jerry_status_t code) /**< status code */
|
||||
{
|
||||
#ifndef JERRY_NDEBUG
|
||||
if ( code != ERR_OK )
|
||||
@ -72,10 +72,10 @@ jerry_Exit( jerry_Status_t code) /**< status code */
|
||||
}
|
||||
|
||||
/* The failed assertion is 'Return code is zero' */
|
||||
jerry_AssertFail( "Return code is zero", __FILE__, __LINE__);
|
||||
jerry_assert_fail( "Return code is zero", __FILE__, __LINE__);
|
||||
}
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
__exit( -code );
|
||||
} /* jerry_Exit */
|
||||
} /* jerry_exit */
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
* Handle failed assertion
|
||||
*/
|
||||
void __noreturn
|
||||
jerry_AssertFail(const char *assertion, /**< assertion condition string */
|
||||
jerry_assert_fail(const char *assertion, /**< assertion condition string */
|
||||
const char *file, /**< file name */
|
||||
const uint32_t line) /** line */
|
||||
{
|
||||
@ -28,5 +28,5 @@ jerry_AssertFail(const char *assertion, /**< assertion condition string */
|
||||
assertion, file, line);
|
||||
|
||||
__exit( -ERR_GENERAL);
|
||||
} /* jerry_AssertFail */
|
||||
} /* jerry_assert_fail */
|
||||
|
||||
|
||||
@ -20,9 +20,9 @@
|
||||
* Handle failed assertion
|
||||
*/
|
||||
void __noreturn
|
||||
jerry_AssertFail(const char *assertion __unused, /**< assertion condition string */
|
||||
jerry_assert_fail(const char *assertion __unused, /**< assertion condition string */
|
||||
const char *file __unused, /**< file name */
|
||||
const uint32_t line __unused) /** line */
|
||||
{
|
||||
__exit( -ERR_GENERAL);
|
||||
} /* jerry_AssertFail */
|
||||
} /* jerry_assert_fail */
|
||||
|
||||
@ -113,19 +113,19 @@ main (int argc, char **argv)
|
||||
if (file_name == NULL)
|
||||
file_name = argv[1];
|
||||
else
|
||||
jerry_Exit (ERR_SEVERAL_FILES);
|
||||
jerry_exit (ERR_SEVERAL_FILES);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __HOST
|
||||
if (file_name == NULL)
|
||||
jerry_Exit (ERR_NO_FILES);
|
||||
jerry_exit (ERR_NO_FILES);
|
||||
|
||||
file = __fopen (file_name, "r");
|
||||
|
||||
if (file == NULL)
|
||||
{
|
||||
jerry_Exit (ERR_IO);
|
||||
jerry_exit (ERR_IO);
|
||||
}
|
||||
|
||||
lexer_set_file (file);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user