From f0ec022bd08e02ff176a9f029eb3551915b30b55 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sun, 4 Oct 2020 08:40:20 +0300 Subject: Fix build with GCC 8.3.0 - CheckOpCode takes an int, otherwise it will always return true --- JSImpl/src/ByteCodeGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'JSImpl/src/ByteCodeGenerator.cpp') diff --git a/JSImpl/src/ByteCodeGenerator.cpp b/JSImpl/src/ByteCodeGenerator.cpp index fd85326..39f3bff 100644 --- a/JSImpl/src/ByteCodeGenerator.cpp +++ b/JSImpl/src/ByteCodeGenerator.cpp @@ -97,7 +97,7 @@ private: void PushConst(double c); IPLString CreateRegister(); - bool CheckOpCode(Instruction::Type opcode) { return opcode >= Instruction::Type::FIRST && opcode <= Instruction::Type::LAST; } + bool CheckOpCode(int opcode) { return opcode >= Instruction::Type::FIRST && opcode <= Instruction::Type::LAST; } private: IPLVector m_RegisterTable; IPLVector m_Code; @@ -678,4 +678,4 @@ IPLString GenerateByteCode(ExpressionPtr program, const IPLString& source, const program->Accept(generator); return generator.GetCode(); -} \ No newline at end of file +} -- cgit v1.3.1-23-gd82d From 6f5cc33f6de1e2bf7dbee5e205ff5c53b47eea0e Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sun, 4 Oct 2020 18:17:43 +0300 Subject: Fix builds for Win32 --- JSImpl/src/ByteCodeGenerator.cpp | 4 ++-- appveyor.yml | 4 ++-- spasm/src/asm/lexer.cpp | 4 ++-- spasm/src/asm/lexer.re | 4 ++-- spasm/src/spasm.cpp | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'JSImpl/src/ByteCodeGenerator.cpp') diff --git a/JSImpl/src/ByteCodeGenerator.cpp b/JSImpl/src/ByteCodeGenerator.cpp index 39f3bff..49e734b 100644 --- a/JSImpl/src/ByteCodeGenerator.cpp +++ b/JSImpl/src/ByteCodeGenerator.cpp @@ -646,8 +646,8 @@ IPLString ByteCodeGenerator::GetCode() break; case ByteCodeGenerator::Instruction::DEBUG: { - auto line = i.Values.Int[0]; - auto column = i.Values.Int[1]; + auto line = int(i.Values.Int[0]); + auto column = int(i.Values.Int[1]); result += "D: " + m_Source[line].substr(0, column) + "@@=>" + m_Source[line].substr(column, m_Source[line].size()) + '\n'; } break; diff --git a/appveyor.yml b/appveyor.yml index d96e49e..b657fe2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ configuration: - Release platform: - - x86 + - Win32 - x64 build: @@ -28,7 +28,7 @@ for: only: - image: Ubuntu build_script: - - make -C $APPVEYOR_BUILD_FOLDER/JSImpl/solution -j config=`echo ${CONFIGURATION} | sed -e 'y/DR/dr/'``echo ${PLATFORM} | sed -e 's/x86//' | sed -e 's/x64/64/'` + - make -C $APPVEYOR_BUILD_FOLDER/JSImpl/solution -j config=`echo ${CONFIGURATION} | sed -e 'y/DR/dr/'``echo ${PLATFORM} | sed -e 's/Win32//' | sed -e 's/x64/64/'` test_script: - '$APPVEYOR_BUILD_FOLDER/JSImpl/build/bin/$CONFIGURATION/Test' after_test: diff --git a/spasm/src/asm/lexer.cpp b/spasm/src/asm/lexer.cpp index 996762c..fd522ee 100644 --- a/spasm/src/asm/lexer.cpp +++ b/spasm/src/asm/lexer.cpp @@ -3082,7 +3082,7 @@ void Lexer::read(size_t nbytes) file->read(old_limit, limit - old_limit); if (file->eof()) { - size_t bytes = file->gcount(); + auto bytes = file->gcount(); std::fill(old_limit + bytes, limit, '\0'); } } @@ -3092,7 +3092,7 @@ void Lexer::buffer_init() file->read(buffer, buffer_size); if (file->eof()) { - size_t bytes = file->gcount(); + auto bytes = file->gcount(); std::fill(buffer + bytes, buffer + buffer_size, '\0'); } diff --git a/spasm/src/asm/lexer.re b/spasm/src/asm/lexer.re index bdf792d..7de620d 100644 --- a/spasm/src/asm/lexer.re +++ b/spasm/src/asm/lexer.re @@ -339,7 +339,7 @@ void Lexer::read (size_t nbytes) file->read (old_limit, limit - old_limit); if (file->eof ()) { - size_t bytes = file->gcount (); + auto bytes = file->gcount (); std::fill (old_limit + bytes, limit, '\0'); } } @@ -348,7 +348,7 @@ void Lexer::buffer_init () { file->read (buffer, buffer_size); if (file->eof ()) { - size_t bytes = file->gcount (); + auto bytes = file->gcount (); std::fill (buffer + bytes, buffer + buffer_size, '\0'); } diff --git a/spasm/src/spasm.cpp b/spasm/src/spasm.cpp index 6a62c90..94086a6 100644 --- a/spasm/src/spasm.cpp +++ b/spasm/src/spasm.cpp @@ -331,7 +331,7 @@ void Spasm::gotrue(reg_t a0, reg_t a1) { if (get_local(a0)) { - m_PC = a1; + go(a1); } } @@ -344,7 +344,7 @@ void Spasm::gofalse(reg_t a0, reg_t a1) { if (!get_local(a0)) { - m_PC = a1; + go(a1); } } @@ -354,7 +354,7 @@ void Spasm::gofalse(reg_t a0, reg_t a1) */ void Spasm::go(reg_t a0) { - m_PC = a0; + m_PC = PC_t(a0); } /*! @@ -507,7 +507,7 @@ int64_t Spasm::read_integer(size_t size) data_t Spasm::read_string(size_t size) { - const auto length = read_integer(size); + const auto length = size_t(read_integer(size)); const auto s = reinterpret_cast(&m_ByteCode[m_PC]); m_PC += length; const auto value = m_Strings.Get(s, length); -- cgit v1.3.1-23-gd82d