diff options
Diffstat (limited to 'indra/lscript')
-rw-r--r-- | indra/lscript/lscript_compile/CMakeLists.txt | 9 | ||||
-rw-r--r-- | indra/lscript/lscript_compile/bison.bat | 9 | ||||
-rw-r--r-- | indra/lscript/lscript_compile/indra.l | 29 | ||||
-rw-r--r-- | indra/lscript/lscript_compile/indra.y | 5 | ||||
-rw-r--r-- | indra/lscript/lscript_execute/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/lscript/lscript_execute/lscript_execute.cpp | 11 | ||||
-rw-r--r-- | indra/lscript/lscript_execute/lscript_readlso.cpp | 9 | ||||
-rw-r--r-- | indra/lscript/lscript_library/CMakeLists.txt | 3 |
8 files changed, 57 insertions, 21 deletions
diff --git a/indra/lscript/lscript_compile/CMakeLists.txt b/indra/lscript/lscript_compile/CMakeLists.txt index 3ed2892e0e..07662005b9 100644 --- a/indra/lscript/lscript_compile/CMakeLists.txt +++ b/indra/lscript/lscript_compile/CMakeLists.txt @@ -45,6 +45,9 @@ include_directories( ${LLPRIMITIVE_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS} ) +include_directories(SYSTEM + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} + ) set(lscript_generated_SOURCE_FILES indra.l.cpp @@ -95,6 +98,7 @@ add_custom_command( ${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp COMMAND ${FLEX} ARGS + -P indra_ -o${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp ${CMAKE_CURRENT_SOURCE_DIR}/indra.l DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/indra.l @@ -112,8 +116,10 @@ if (WINDOWS) ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat + ARGS ${BISON} ${M4_PATH} - ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp + -p indra_ + -d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp ${CMAKE_CURRENT_SOURCE_DIR}/indra.y DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat @@ -128,6 +134,7 @@ else (WINDOWS) COMMAND ${BISON} ARGS + -p indra_ -d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp ${CMAKE_CURRENT_SOURCE_DIR}/indra.y DEPENDS diff --git a/indra/lscript/lscript_compile/bison.bat b/indra/lscript/lscript_compile/bison.bat index 0baff4e5ef..d40997225e 100644 --- a/indra/lscript/lscript_compile/bison.bat +++ b/indra/lscript/lscript_compile/bison.bat @@ -2,10 +2,11 @@ @REM find m4, even if neither program is present in PATH.
@set bison=%1
-set M4PATH=%2
+shift
+set M4PATH=%1
+shift
set M4=
-@set output=%3
-@set input=%4
set PATH=%M4PATH%;%PATH%
-%bison% -d -o %output% %input%
+@REM %* does not work with shift...
+%bison% %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 96b7e57e97..9132d5d528 100644 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -56,11 +56,40 @@ void parse_string(); #define ECHO do { } while (0) +#define yyparse indra_parse +#define yyerror indra_error +#define yylval indra_lval +#define yy_create_buffer indra__create_buffer +#define yy_delete_buffer indra__delete_buffer +#define yy_flex_debug indra__flex_debug +#define yy_init_buffer indra__init_buffer +#define yy_flush_buffer indra__flush_buffer +#define yy_load_buffer_state indra__load_buffer_state +#define yy_switch_to_buffer indra__switch_to_buffer +#define yyin indra_in +#define yyleng indra_leng +#define yylex indra_lex +#define yylineno indra_lineno +#define yyout indra_out +#define yyrestart indra_restart +#define yytext indra_text +#define yywrap indra_wrap +#define yyalloc indra_alloc +#define yyrealloc indra_realloc +#define yyfree indra_free + + +#if LL_WINDOWS #if defined(__cplusplus) extern "C" { int yylex( void ); } extern "C" { int yyparse( void ); } extern "C" { int yyerror(const char *fmt, ...); } #endif +#else +int yylex( void ); +int yyparse( void ); +int yyerror(const char *fmt, ...); +#endif %} diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y index e4b10ffdd9..9c2ed02f72 100644 --- a/indra/lscript/lscript_compile/indra.y +++ b/indra/lscript/lscript_compile/indra.y @@ -2,9 +2,11 @@ #include "linden_common.h" #include "lscript_tree.h" + #if LL_WINDOWS #ifdef __cplusplus extern "C" { #endif + #endif int yylex(void); int yyparse( void ); @@ -20,9 +22,12 @@ #pragma warning( disable : 4065 ) // warning: switch statement contains 'default' but no 'case' labels #endif + #if LL_WINDOWS #ifdef __cplusplus } #endif + #endif + %} %union diff --git a/indra/lscript/lscript_execute/CMakeLists.txt b/indra/lscript/lscript_execute/CMakeLists.txt index 3a16ffdc01..49605982a8 100644 --- a/indra/lscript/lscript_execute/CMakeLists.txt +++ b/indra/lscript/lscript_execute/CMakeLists.txt @@ -10,6 +10,9 @@ include_directories( ${LLMATH_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS} ) +include_directories(SYSTEM + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} + ) set(lscript_execute_SOURCE_FILES llscriptresource.cpp diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp index d79e9f8bde..b12d2e4a16 100644 --- a/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/indra/lscript/lscript_execute/lscript_execute.cpp @@ -806,16 +806,7 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, // is there a fault? // if yes, print out message and exit S32 value = getVersion(); - S32 major_version = 0; - if (value == LSL2_VERSION1_END_NUMBER) - { - major_version = 1; - } - else if (value == LSL2_VERSION_NUMBER) - { - major_version = 2; - } - else + if ( (value != LSL2_VERSION1_END_NUMBER) && (value != LSL2_VERSION_NUMBER) ) { setFault(LSRF_VERSION_MISMATCH); } diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp index 35caa41ae1..8b41cb5a72 100644 --- a/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -123,7 +123,7 @@ void LLScriptLSOParse::printRegisters(LLFILE *fp) void LLScriptLSOParse::printGlobals(LLFILE *fp) { // print out registers first - S32 offset, varoffset; + S32 varoffset; S32 ivalue; F32 fpvalue; LLVector3 vvalue; @@ -144,7 +144,7 @@ void LLScriptLSOParse::printGlobals(LLFILE *fp) // get offset to skip past name varoffset = global_v_offset; - offset = bytestream2integer(mRawData, global_v_offset); + bytestream2integer(mRawData, global_v_offset); // get typeexport type = *(mRawData + global_v_offset++); @@ -262,8 +262,6 @@ void LLScriptLSOParse::printGlobalFunctions(LLFILE *fp) fprintf(fp, "[Function #%d] [0x%X] %s\n", function_number, orig_function_offset, name); fprintf(fp, "\tReturn Type: %s\n", LSCRIPTTypeNames[type]); type = *(mRawData + function_offset++); - S32 params; - params = 0; S32 pcount = 0; while (type) { @@ -347,7 +345,6 @@ void LLScriptLSOParse::printStates(LLFILE *fp) read_ahead = event_jump_table; S32 temp_end; - S32 dummy; opcode_end = worst_case_opcode_end; @@ -356,7 +353,7 @@ void LLScriptLSOParse::printStates(LLFILE *fp) if (event_handlers & LSCRIPTStateBitField[k]) { temp_end = bytestream2integer(mRawData, read_ahead); - dummy = bytestream2integer(mRawData, read_ahead); + bytestream2integer(mRawData, read_ahead); if ( (temp_end < opcode_end) &&(temp_end > event_offset)) { diff --git a/indra/lscript/lscript_library/CMakeLists.txt b/indra/lscript/lscript_library/CMakeLists.txt index f6bc67a994..5af850c41b 100644 --- a/indra/lscript/lscript_library/CMakeLists.txt +++ b/indra/lscript/lscript_library/CMakeLists.txt @@ -28,5 +28,8 @@ include_directories( ${LLMATH_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS} ) +include_directories(SYSTEM + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} + ) add_library (lscript_library ${lscript_library_SOURCE_FILES}) |