Website Summary Files Commits Branches @commit @diff @stats
path: root / spasm / src
diff options
context:
space:
mode:
3 files changed, 8 insertions, 8 deletions
-rw-r--r--spasm/src/asm/lexer.cpp4
-rw-r--r--spasm/src/asm/lexer.re4
-rw-r--r--spasm/src/spasm.cpp8
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<const char*>(&m_ByteCode[m_PC]);
m_PC += length;
const auto value = m_Strings.Get(s, length);