Fix warnings

This commit is contained in:
Lane Roathe 2019-11-13 15:05:12 -08:00
parent b4c41031a8
commit 380eb7843e
2 changed files with 12 additions and 12 deletions

20
asm.cpp
View File

@ -171,10 +171,10 @@ void CLASS::clear()
void CLASS::set(std::string line) void CLASS::set(std::string line)
{ {
int state = 0; int state = 0;
int l = line.length(); int l = (int)line.length();
int i = 0; int i = 0;
int x; int x;
char c, delim; char c, delim = 0;
clear(); clear();
@ -299,7 +299,7 @@ void CLASS::set(std::string line)
} }
} }
printlable = lable; printlable = lable;
x = lable.length(); x = (int)lable.length();
if (x > 1) if (x > 1)
{ {
while ((x > 1) && (lable[x - 1] == ':')) while ((x > 1) && (lable[x - 1] == ':'))
@ -343,7 +343,7 @@ void CLASS::complete(void)
uint64_t n = GetTickCount(); uint64_t n = GetTickCount();
if (isDebug()) if (isDebug())
{ {
printf("Processing Time: %lu ms\n", n - starttime); printf("Processing Time: %llu ms\n", n - starttime);
} }
} }
@ -509,7 +509,7 @@ void CLASS::process(void)
{ {
uint32_t len, t, pos; uint32_t len, t, pos;
uint32_t ct = lines.size(); uint32_t ct = (uint32_t)lines.size();
for (uint32_t lineno = 0; lineno < ct; lineno++) for (uint32_t lineno = 0; lineno < ct; lineno++)
{ {
@ -967,7 +967,7 @@ void CLASS::complete(void)
std::ofstream f(savepath); std::ofstream f(savepath);
uint32_t lineno = 0; uint32_t lineno = 0;
uint32_t l = lines.size(); uint32_t l = (uint32_t)lines.size();
while (lineno < l) while (lineno < l)
{ {
MerlinLine &line=lines.at(lineno++); MerlinLine &line=lines.at(lineno++);
@ -1011,7 +1011,7 @@ int CLASS::evaluate(std::string expr, int64_t &value)
if (isDebug() > 2) if (isDebug() > 2)
{ {
int c = SetColor(CL_RED); int c = SetColor(CL_RED);
printf("eval Error=%d %08lX |%s|\n", res, result, eval.badsymbol.c_str()); printf("eval Error=%d %08llX |%s|\n", res, result, eval.badsymbol.c_str());
SetColor(c); SetColor(c);
} }
} }
@ -1027,7 +1027,7 @@ int CLASS::evaluate(std::string expr, int64_t &value)
} }
if (isDebug()>=3) if (isDebug()>=3)
{ {
printf("Eval Result: %08lX (status=%d)\n",value,res); printf("Eval Result: %08llX (status=%d)\n",value,res);
} }
return (res); return (res);
} }
@ -1162,7 +1162,7 @@ void CLASS::process(void)
{ {
initpass(); initpass();
l = lines.size(); l = (uint32_t)lines.size();
while ((lineno < l) && (!passcomplete)) while ((lineno < l) && (!passcomplete))
{ {
MerlinLine &line=lines[lineno]; MerlinLine &line=lines[lineno];
@ -1215,7 +1215,7 @@ void CLASS::process(void)
if (x == 0) if (x == 0)
{ {
value &= 0xFFFFFFFF; value &= 0xFFFFFFFF;
line.expr_value = value; line.expr_value = (int32_t)value;
} }
else else
{ {

View File

@ -26,7 +26,7 @@ std::deque<Token> CLASS::exprToTokens(const std::string& expr)
std::deque<Token> tokens; std::deque<Token> tokens;
int state = 0; int state = 0;
char c; char c;
char delim; char delim = 0;
std::string ident, asc; std::string ident, asc;
std::string ops = "+-*//^!.&()"; std::string ops = "+-*//^!.&()";
@ -378,7 +378,7 @@ int CLASS::parseNumber(std::string n, int64_t &val)
i = 0; i = 0;
l = n.length(); l = (int)n.length();
s = ""; s = "";
for (i = 0; i < l; i++) for (i = 0; i < l; i++)
{ {