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)
{
int state = 0;
int l = line.length();
int l = (int)line.length();
int i = 0;
int x;
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());
operand = strs[0];
//printf("which=%d operand=|%s|\n",ct,operand.c_str());
i = operand.length();
i = (int)operand.length();
restofline = restofline.substr(i, restofline.length());
comment = Poco::trim(restofline);
match = true;
@ -510,7 +510,7 @@ void CLASS::set(std::string line)
}
}
printlable = lable;
x = lable.length();
x = (int)lable.length();
if (x > 1)
{
// 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)
{
uint32_t ct = lines.size();
uint32_t ct = (uint32_t)lines.size();
uint32_t len, t, pos;
@ -1698,7 +1698,7 @@ void CLASS::complete(void)
std::ofstream f(savepath);
uint32_t lineno = 0;
uint32_t l = lines.size();
uint32_t l = (uint32_t)lines.size();
while (lineno < l)
{
MerlinLine &line = lines.at(lineno++);
@ -1976,12 +1976,12 @@ restart:
offset = slen;
}
x = mVec.size();
x = (int)mVec.size();
if (x > 0)
{
res = 0;
off = mVec[0].offset;
len = mVec[0].length;
off = (uint32_t)mVec[0].offset;
len = (uint32_t)mVec[0].length;
s = oper.substr(off, len);
slen = s.length();
sym = NULL;
@ -2043,7 +2043,7 @@ bool CLASS::doOFF(void)
std::stack<TDOstruct> tmpstack;
TDOstruct doitem;
uint32_t ct = DOstack.size();
uint32_t ct = (uint32_t)DOstack.size();
if (ct > 0)
{
tmpstack = DOstack;
@ -2101,7 +2101,7 @@ void CLASS::process(void)
{
initpass();
l = lines.size();
l = (uint32_t)lines.size();
bool passdone = false;
while ((!passdone) && (!passcomplete))
{

View File

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