Fix some type conversion warnings

This commit is contained in:
Lane Roathe 2019-12-03 09:44:50 -07:00
parent 038d1004ea
commit aa5069780c
2 changed files with 12 additions and 12 deletions

20
asm.cpp
View File

@ -343,7 +343,7 @@ std::string commentEx = "^(\\s*)((;|\\/{2}))+(.*)";
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;
@ -491,7 +491,7 @@ void CLASS::set(std::string line)
//printf("%d regex %d match |%s|\n", ct, x, restofline.c_str()); //printf("%d regex %d match |%s|\n", ct, x, restofline.c_str());
operand = strs[0]; operand = strs[0];
//printf("which=%d operand=|%s|\n",ct,operand.c_str()); //printf("which=%d operand=|%s|\n",ct,operand.c_str());
i = operand.length(); i = (int)operand.length();
restofline = restofline.substr(i, restofline.length()); restofline = restofline.substr(i, restofline.length());
comment = Poco::trim(restofline); comment = Poco::trim(restofline);
match = true; match = true;
@ -510,7 +510,7 @@ void CLASS::set(std::string line)
} }
} }
printlable = lable; printlable = lable;
x = lable.length(); x = (int)lable.length();
if (x > 1) if (x > 1)
{ {
// M32 syntax allows a colon after lable, and it is not part of the lable // M32 syntax allows a colon after lable, and it is not part of the lable
@ -941,7 +941,7 @@ int CLASS::doline(int lineno, std::string line)
void CLASS::process(void) void CLASS::process(void)
{ {
uint32_t ct = lines.size(); uint32_t ct = (uint32_t)lines.size();
uint32_t len, t, pos; uint32_t len, t, pos;
@ -1698,7 +1698,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++);
@ -1976,12 +1976,12 @@ restart:
offset = slen; offset = slen;
} }
x = mVec.size(); x = (int)mVec.size();
if (x > 0) if (x > 0)
{ {
res = 0; res = 0;
off = mVec[0].offset; off = (uint32_t)mVec[0].offset;
len = mVec[0].length; len = (uint32_t)mVec[0].length;
s = oper.substr(off, len); s = oper.substr(off, len);
slen = s.length(); slen = s.length();
sym = NULL; sym = NULL;
@ -2043,7 +2043,7 @@ bool CLASS::doOFF(void)
std::stack<TDOstruct> tmpstack; std::stack<TDOstruct> tmpstack;
TDOstruct doitem; TDOstruct doitem;
uint32_t ct = DOstack.size(); uint32_t ct = (uint32_t)DOstack.size();
if (ct > 0) if (ct > 0)
{ {
tmpstack = DOstack; tmpstack = DOstack;
@ -2101,7 +2101,7 @@ void CLASS::process(void)
{ {
initpass(); initpass();
l = lines.size(); l = (uint32_t)lines.size();
bool passdone = false; bool passdone = false;
while ((!passdone) && (!passcomplete)) while ((!passdone) && (!passcomplete))
{ {

View File

@ -391,7 +391,7 @@ int CLASS::parseAscii(std::string n, int64_t &val)
bool high = false; bool high = false;
uint8_t c; uint8_t c;
uint32_t l = n.length(); uint32_t l = (uint32_t)n.length();
for (uint32_t i = 0; i < l - 1; i++) for (uint32_t i = 0; i < l - 1; i++)
{ {
c = n[i]; c = n[i];
@ -442,7 +442,7 @@ int CLASS::parseNumber(std::string n, int64_t &val)
//printf("parseNumber |%s|\n",n.c_str()); //printf("parseNumber |%s|\n",n.c_str());
i = 0; i = 0;
l = n.length(); l = (uint32_t)n.length();
s = ""; s = "";
for (i = 0; i < l; i++) for (i = 0; i < l; i++)
{ {