Adding src/main.c to cppcheck and vera++ source list.
This commit is contained in:
+2
-2
@@ -365,9 +365,9 @@ all: clean $(JERRY_TARGETS)
|
|||||||
$(JERRY_TARGETS):
|
$(JERRY_TARGETS):
|
||||||
@rm -rf $(TARGET_DIR)
|
@rm -rf $(TARGET_DIR)
|
||||||
@mkdir -p $(TARGET_DIR)
|
@mkdir -p $(TARGET_DIR)
|
||||||
@cppcheck $(DEFINES_JERRY) $(SOURCES_JERRY_C) $(INCLUDES_JERRY) $(INCLUDES_THIRDPARTY) \
|
@cppcheck $(DEFINES_JERRY) $(SOURCES_JERRY_C) $(MAIN_MODULE_SRC) $(INCLUDES_JERRY) $(INCLUDES_THIRDPARTY) \
|
||||||
--error-exitcode=1 --std=c99 --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction 1>/dev/null
|
--error-exitcode=1 --std=c99 --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction 1>/dev/null
|
||||||
@vera++ -r ./tools/vera++ -p jerry $(SOURCES_JERRY_C) $(SOURCES_JERRY_H) -e --no-duplicate 1>$(TARGET_DIR)/vera.log
|
@vera++ -r ./tools/vera++ -p jerry $(SOURCES_JERRY_C) $(MAIN_MODULE_SRC) $(SOURCES_JERRY_H) -e --no-duplicate 1>$(TARGET_DIR)/vera.log
|
||||||
@mkdir -p $(TARGET_DIR)/obj
|
@mkdir -p $(TARGET_DIR)/obj
|
||||||
@source_index=0; \
|
@source_index=0; \
|
||||||
for jerry_src in $(SOURCES_JERRY) $(MAIN_MODULE_SRC); do \
|
for jerry_src in $(SOURCES_JERRY) $(MAIN_MODULE_SRC); do \
|
||||||
|
|||||||
+14
-14
@@ -41,7 +41,7 @@ parser_run (const char *script_source, size_t script_source_size, bool is_show_o
|
|||||||
uint16_t offset;
|
uint16_t offset;
|
||||||
const OPCODE *opcodes;
|
const OPCODE *opcodes;
|
||||||
|
|
||||||
lexer_init ( script_source, script_source_size, is_show_opcodes);
|
lexer_init (script_source, script_source_size, is_show_opcodes);
|
||||||
|
|
||||||
lexer_run_first_pass ();
|
lexer_run_first_pass ();
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ jerry_run (const char *script_source, size_t script_source_size,
|
|||||||
{
|
{
|
||||||
const OPCODE *opcodes;
|
const OPCODE *opcodes;
|
||||||
|
|
||||||
mem_init();
|
mem_init ();
|
||||||
|
|
||||||
serializer_init (is_show_opcodes);
|
serializer_init (is_show_opcodes);
|
||||||
|
|
||||||
@@ -89,9 +89,9 @@ jerry_run (const char *script_source, size_t script_source_size,
|
|||||||
|
|
||||||
bool is_success = run_int ();
|
bool is_success = run_int ();
|
||||||
|
|
||||||
serializer_free();
|
serializer_free ();
|
||||||
|
|
||||||
mem_finalize( is_show_mem_stats);
|
mem_finalize (is_show_mem_stats);
|
||||||
|
|
||||||
return is_success;
|
return is_success;
|
||||||
} /* jerry_run */
|
} /* jerry_run */
|
||||||
@@ -118,42 +118,42 @@ read_sources (const char *script_file_names[],
|
|||||||
jerry_exit (ERR_IO);
|
jerry_exit (ERR_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
int fseek_status = __fseek( file, 0, __SEEK_END);
|
int fseek_status = __fseek (file, 0, __SEEK_END);
|
||||||
|
|
||||||
if ( fseek_status != 0 )
|
if (fseek_status != 0)
|
||||||
{
|
{
|
||||||
jerry_exit (ERR_IO);
|
jerry_exit (ERR_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
long script_len = __ftell( file);
|
long script_len = __ftell (file);
|
||||||
|
|
||||||
if ( script_len < 0 )
|
if (script_len < 0)
|
||||||
{
|
{
|
||||||
jerry_exit (ERR_IO);
|
jerry_exit (ERR_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
__rewind( file);
|
__rewind (file);
|
||||||
|
|
||||||
const size_t current_source_size = (size_t)script_len;
|
const size_t current_source_size = (size_t)script_len;
|
||||||
|
|
||||||
if ( source_buffer_tail + current_source_size >= source_buffer + sizeof(source_buffer) )
|
if (source_buffer_tail + current_source_size >= source_buffer + sizeof (source_buffer))
|
||||||
{
|
{
|
||||||
jerry_exit (ERR_MEMORY);
|
jerry_exit (ERR_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t bytes_read = __fread( source_buffer, 1, current_source_size, file);
|
size_t bytes_read = __fread (source_buffer, 1, current_source_size, file);
|
||||||
if ( bytes_read < current_source_size )
|
if (bytes_read < current_source_size)
|
||||||
{
|
{
|
||||||
jerry_exit (ERR_IO);
|
jerry_exit (ERR_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
__fclose( file);
|
__fclose (file);
|
||||||
|
|
||||||
source_buffer_tail += current_source_size;
|
source_buffer_tail += current_source_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t source_size = (size_t) (source_buffer_tail - source_buffer);
|
const size_t source_size = (size_t) (source_buffer_tail - source_buffer);
|
||||||
JERRY_ASSERT( source_size < sizeof(source_buffer));
|
JERRY_ASSERT(source_size < sizeof (source_buffer));
|
||||||
|
|
||||||
*out_source_size_p = source_size;
|
*out_source_size_p = source_size;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user