fix -Wall compiler errors

This commit is contained in:
marketideas 2019-11-15 03:40:35 -08:00
parent 3338ff263d
commit a088831a6a
6 changed files with 42 additions and 5 deletions

View File

@ -3,7 +3,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
project(QAsm)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE RELEASE)
set(APPVERSION "4.0.9")
set(LIBRARY_NAME pal)
set(FIND_LIBRARY_USE_LIB64_PATHS TRUE)

17
asm.cpp
View File

@ -260,6 +260,7 @@ void CLASS::set(std::string line)
clear();
delim=0;
//printf("line: |%s|\n", line.c_str());
while (i < l)
{
@ -441,6 +442,9 @@ void CLASS::process(void)
}
int CLASS::doline(int lineno, std::string line)
{
UNUSED(lineno);
UNUSED(line);
int res = -1;
return (res);
@ -472,7 +476,7 @@ std::string CLASS::processFilename(std::string fn, std::string curDir, int level
{
v = 99;
}
if ((v >= 0) && (v < 10))
if (v < 10)
{
Poco::Path p1 = p.popFrontDirectory();
s = p1.toString();
@ -573,7 +577,7 @@ int CLASS::processfile(std::string p, std::string &newfilename)
// is this the first file in the compilation, or a PUT/USE?
// if first, change CWD to location of file
LOG_DEBUG << "Changing directory to: " << dir << endl;
chdir(dir.c_str()); // change directory to where the file is
if (chdir(dir.c_str())) {} // change directory to where the file is
}
p1 = path.toString();
@ -758,6 +762,8 @@ void CLASS::init(void)
int CLASS::doline(int lineno, std::string line)
{
UNUSED(lineno);
MerlinLine l(line);
lines.push_back(l);
return 0;
@ -1119,7 +1125,7 @@ typedef struct
std::string regEx;
uint16_t addrMode;
std::string text;
std::string expression;
//std::string expression;
} TaddrMode;
// these are the regular expressions that determine the addressing mode
@ -1683,6 +1689,8 @@ int CLASS::doline(int lineno, std::string line)
int x;
std::string op;
UNUSED(lineno);
MerlinLine l(line);
op = Poco::toLower(l.opcode);
@ -1755,6 +1763,9 @@ void CLASS::complete(void)
int CLASS::doline(int lineno, std::string line)
{
UNUSED(lineno);
UNUSED(line);
int res = 0;
return (res);

View File

@ -36,6 +36,7 @@ std::deque<Token> CLASS::exprToTokens(const std::string& expr)
bool numexpect;
Token::Type t;
delim=0;
numexpect = true;
for (const auto* p = expr.c_str(); *p; ++p)
{

View File

@ -24,6 +24,8 @@ void CLASS::setOpcode(MerlinLine &line, uint8_t op)
int CLASS::doPSEUDO(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
int res;
res = psuedoops->ProcessOpcode(*this, line, sym);
@ -32,6 +34,8 @@ int CLASS::doPSEUDO(MerlinLine &line, TSymbol &sym)
int CLASS::doXC(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
std::string s;
int res = 0;
@ -53,6 +57,8 @@ int CLASS::doXC(MerlinLine &line, TSymbol &sym)
int CLASS::doMX(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
if (cpumode < MODE_65816)
{
line.setError(errIncompatibleOpcode);
@ -67,6 +73,7 @@ int CLASS::doMX(MerlinLine &line, TSymbol &sym)
int CLASS::doEQU(MerlinLine &line, TSymbol &sym)
{
UNUSED(sym);
int res = 0;
TSymbol *s;
if (line.lable.length() > 0)
@ -100,6 +107,7 @@ int CLASS::doEQU(MerlinLine &line, TSymbol &sym)
int CLASS::doUNK(MerlinLine &line, TSymbol &sym)
{
int res = -1;
UNUSED(sym);
res = 0;
if (pass > 0)
@ -117,6 +125,7 @@ int CLASS::doPER(MerlinLine &line, TSymbol &sym)
{
int res;
int32_t value = 0;;
UNUSED(sym);
res = 0;
if ((line.addressmode == syn_abs) || (line.addressmode == syn_imm))
@ -147,6 +156,7 @@ int CLASS::doMVN(MerlinLine &line, TSymbol &sym)
{
int res;
uint8_t op;
UNUSED(sym);
if (line.addressmode == syn_bm)
{
@ -197,6 +207,7 @@ int CLASS::doNoPattern(MerlinLine &line, TSymbol &sym)
// STZ = 1
// TSB = 2
// TRB = 3
UNUSED(sym);
int res, i;
uint8_t err;
@ -675,6 +686,9 @@ out:
int CLASS::doEND(MerlinLine & line, TSymbol & sym)
{
UNUSED(sym);
UNUSED(line);
int res = 0;
passcomplete = true;
@ -683,6 +697,8 @@ int CLASS::doEND(MerlinLine & line, TSymbol & sym)
int CLASS::doBYTE(MerlinLine & line, TSymbol & sym)
{
UNUSED(sym);
int res = 1;
if (pass > 0)

View File

@ -19,6 +19,7 @@ constexpr unsigned int strhash(const char *str, int h = 0)
int CLASS::doDATA(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
int outct = 0;
int wordsize = 2;
int endian = 0;
@ -78,6 +79,8 @@ int CLASS::doDATA(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
int CLASS::doDS(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
int res = 0;
int32_t v = line.expr_value;
if (line.eval_result != 0)
@ -111,6 +114,8 @@ int CLASS::doDS(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
int CLASS::doDUM(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
int res = 0;
bool isdend = ((opinfo.opcode == P_DEND) ? true : false);
@ -134,6 +139,8 @@ int CLASS::doDUM(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
int CLASS::doLST(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
std::string s;
if (a.pass > 0)
{
@ -156,6 +163,8 @@ int CLASS::doLST(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
int CLASS::doHEX(T65816Asm &a, MerlinLine &line, TSymbol &opinfo)
{
UNUSED(opinfo);
std::string os = Poco::toUpper(Poco::trim(line.operand));
uint32_t bytect = 0;

View File

@ -162,7 +162,7 @@ int CLASS::runCommandLineApp(void)
delete t;
t = NULL;
}
chdir(startdirectory.c_str()); // return us back to where we were
if (chdir(startdirectory.c_str())) {}; // return us back to where we were
}
else
{