NOISSUE fix some warnings

This commit is contained in:
Petr Mrázek 2018-02-11 01:21:32 +01:00
parent f259e9f727
commit 604295e6d5
4 changed files with 15 additions and 8 deletions

View File

@ -124,6 +124,8 @@ static LoadResult loadComponent(ComponentPtr component, shared_qobject_ptr<Task>
return result;
}
// FIXME: dead code. determine if this can still be useful?
/*
static LoadResult loadComponentList(ComponentPtr component, shared_qobject_ptr<Task>& loadTask, Net::Mode netmode)
{
if(component->m_loaded)
@ -147,6 +149,7 @@ static LoadResult loadComponentList(ComponentPtr component, shared_qobject_ptr<T
}
return result;
}
*/
static LoadResult loadIndex(shared_qobject_ptr<Task>& loadTask, Net::Mode netmode)
{

View File

@ -354,7 +354,8 @@ void VersionPage::on_downloadBtn_clicked()
}
ProgressDialog tDialog(this);
connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString)));
int ret = tDialog.execWithTask(updateTask.get());
// FIXME: unused return value
tDialog.execWithTask(updateTask.get());
updateButtons();
m_container->refreshContainer();
}

View File

@ -42,6 +42,7 @@ protected:
public:
element_value(element_value_type type, constant_pool &pool) : type(type), pool(pool) {};
virtual ~element_value() {}
element_value_type getElementValueType()
{

View File

@ -21,14 +21,12 @@ public:
j_methodref = 10,
j_interface_methodref = 11,
j_nameandtype = 12
// FIXME: missing some constant types, see https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4
} type;
constant(util::membuffer &buf)
{
buf.read(type);
// invalid constant type!
if (type > j_nameandtype || type == (type_t)0 || type == (type_t)2)
throw new classfile_exception();
// load data depending on type
switch (type)
@ -65,10 +63,13 @@ public:
buf.read_be(name_and_type.name_index);
buf.read_be(name_and_type.descriptor_index);
break;
default:
// invalid constant type!
throw new classfile_exception();
}
}
constant(int fake)
constant(int)
{
type = j_hole;
}
@ -115,6 +116,9 @@ public:
ss << "NameAndType: " << name_and_type.name_index << " "
<< name_and_type.descriptor_index;
break;
default:
ss << "Invalid entry (" << int(type) << ")";
break;
}
return ss.str();
}
@ -166,10 +170,10 @@ public:
*/
void load(util::membuffer &buf)
{
// FIXME: @SANITY this should check for the end of buffer.
uint16_t length = 0;
buf.read_be(length);
length--;
uint16_t index = 1;
const constant *last_constant = nullptr;
while (length)
{
@ -182,12 +186,10 @@ public:
// push in a fake constant to preserve indexing
constants.push_back(constant(0));
length -= 2;
index += 2;
}
else
{
length--;
index++;
}
}
}