Fix warnings of unused varisables when !ENABLE_UI

This commit is contained in:
David Capello 2019-12-11 12:22:01 -03:00
parent fa013f4b63
commit e553777d24
3 changed files with 6 additions and 1 deletions

View File

@ -1185,7 +1185,6 @@ bool ExportSpriteSheetCommand::onEnabled(Context* context)
void ExportSpriteSheetCommand::onExecute(Context* context)
{
Site site = context->activeSite();
Doc* document = site.document();
auto& params = this->params();
DocExporter exporter;
@ -1197,6 +1196,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
// and when the Preferences::m_docs collection is iterated to save
// all DocumentPreferences, it accesses an invalid Doc* pointer (an
// already removed/deleted document).
Doc* document = site.document();
DocumentPreferences& docPref(Preferences::instance().document(document));
// Show UI if the user specified it explicitly (params.ui=true) or

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2018 David Capello
//
// This program is distributed under the terms of
@ -31,6 +32,7 @@
namespace app {
namespace script {
#ifdef ENABLE_UI
namespace {
// Map from .lua file name -> sha1
@ -65,6 +67,7 @@ std::string get_script_filename(lua_State* L)
}
} // anonymous namespace
#endif // ENABLE_UI
int secure_io_open(lua_State* L)
{

View File

@ -90,7 +90,9 @@ void Transaction::commit()
TX_TRACE("TX: Commit <%s>\n", m_cmds->label().c_str());
m_cmds->updateSpritePositionAfter();
#ifdef ENABLE_UI
const SpritePosition sprPos = m_cmds->spritePositionAfterExecute();
#endif
m_undo->add(m_cmds);
m_cmds = nullptr;