Fix compilation errors in GCC.

This commit is contained in:
David Capello 2012-07-09 17:36:45 -03:00
parent 3ae32bf0b6
commit 846fbff4a7
10 changed files with 19 additions and 15 deletions

View File

@ -20,8 +20,7 @@
#define APP_GUI_FIND_WIDGET_H_INCLUDED
#include "app/widget_not_found.h"
namespace ui { class Widget; }
#include "ui/widget.h"
namespace app {

View File

@ -32,6 +32,8 @@
#include "widgets/tabs.h"
#include "widgets/toolbar.h"
#include <cstdio>
using namespace ui;
class AdvancedModeCommand : public Command
@ -84,7 +86,7 @@ void AdvancedModeCommand::onExecute(Context* context)
strcpy(warning, "You can back pressing the \"%s\" key.");
jaccel_to_string(accel, key);
sprintf(buf, warning, key);
std::sprintf(buf, warning, key);
warning_label->setText(buf);

View File

@ -18,8 +18,6 @@
#include "config.h"
#include <allegro.h>
#include "app.h"
#include "app/find_widget.h"
#include "app/load_widget.h"
@ -31,6 +29,9 @@
#include "ui/gui.h"
#include "ui_context.h"
#include <allegro.h>
#include <cstdio>
using namespace ui;
//////////////////////////////////////////////////////////////////////
@ -74,7 +75,7 @@ void DuplicateSpriteCommand::onExecute(Context* context)
src_name->setText(get_filename(document->getFilename()));
sprintf(buf, "%s Copy", document->getFilename());
std::sprintf(buf, "%s Copy", document->getFilename());
dst_name->setText(buf);
if (get_config_bool("DuplicateSprite", "Flatten", false))

View File

@ -31,6 +31,8 @@
#include "undo_transaction.h"
#include "widgets/status_bar.h"
#include <cstdio>
using namespace ui;
//////////////////////////////////////////////////////////////////////
@ -122,7 +124,7 @@ void NewLayerCommand::onExecute(Context* context)
static std::string get_unique_layer_name(Sprite* sprite)
{
char buf[1024];
sprintf(buf, "Layer %d", get_max_layer_num(sprite->getFolder())+1);
std::sprintf(buf, "Layer %d", get_max_layer_num(sprite->getFolder())+1);
return buf;
}

View File

@ -33,6 +33,7 @@
#include "widgets/color_button.h"
#include <allegro/unicode.h>
#include <cstdio>
using namespace ui;
@ -93,7 +94,7 @@ void SpritePropertiesCommand::onExecute(Context* context)
imgtype_text = "Grayscale";
break;
case IMAGE_INDEXED:
sprintf(buf, "Indexed (%d colors)", sprite->getPalette(FrameNumber(0))->size());
std::sprintf(buf, "Indexed (%d colors)", sprite->getPalette(FrameNumber(0))->size());
imgtype_text = buf;
break;
default:

View File

@ -27,6 +27,7 @@
#include "document_undo.h"
#include "file/format_options.h"
#include "flatten.h"
#include "objects_container_impl.h"
#include "raster/cel.h"
#include "raster/layer.h"
#include "raster/mask.h"

View File

@ -23,10 +23,10 @@
#include "base/disable_copying.h"
#include "base/unique_ptr.h"
#include "undo/undo_config_provider.h"
#include "undo/undo_history.h"
namespace undo {
class ObjectsContainer;
class UndoHistory;
class Undoer;
}

View File

@ -19,7 +19,7 @@
#ifndef FLATTEN_H_INCLUDED
#define FLATTEN_H_INCLUDED
#include "gfx/Rect.h"
#include "gfx/rect.h"
#include "raster/frame_number.h"
class Sprite;

View File

@ -101,11 +101,11 @@ void Launcher::openFolder(const std::string& file)
#elif defined ALLEGRO_MACOSX
Alert::show("Problem<<This command is not supported on Mac OS X||&Close");
ui::Alert::show("Problem<<This command is not supported on Mac OS X||&Close");
#else // Linux
Alert::show("Problem<<This command is not supported on Linux||&Close");
ui::Alert::show("Problem<<This command is not supported on Linux||&Close");
#endif
}

View File

@ -13,9 +13,7 @@
#include <cstdarg>
#include <cstring>
#include <queue>
#ifdef REPORT_SIGNALS
# include <cstdio>
#endif
#include <cstdio>
#include <allegro.h>
#include "base/memory.h"