Fix compilation with clang (but not linking because wxAny is currently broken with it)

Originally committed to SVN as r5826.
This commit is contained in:
Thomas Goyne 2011-11-07 06:18:34 +00:00
parent 8b5545c98f
commit 2f394a7792
12 changed files with 21 additions and 22 deletions

View file

@ -34,7 +34,7 @@
#include "libaegisub/line_iterator.h" #include "libaegisub/line_iterator.h"
namespace std { namespace std {
template<> void swap(agi::vfr::Framerate &lft, agi::vfr::Framerate &rgt) throw() { template<> void swap(agi::vfr::Framerate &lft, agi::vfr::Framerate &rgt) {
lft.swap(rgt); lft.swap(rgt);
} }
} }

View file

@ -95,7 +95,7 @@ public:
/// @brief DOCME /// @brief DOCME
/// ///
ASS_EntryType GetType() { return ENTRY_ATTACHMENT; } ASS_EntryType GetType() const { return ENTRY_ATTACHMENT; }
AssEntry *Clone() const; AssEntry *Clone() const;
AssAttachment(wxString name); AssAttachment(wxString name);

View file

@ -91,7 +91,7 @@ namespace Aegisub {
/// @brief DOCME /// @brief DOCME
/// @return /// @return
/// ///
const char *GetName() { return "internal_error/invalid_margin_id"; } const char *GetName() const { return "internal_error/invalid_margin_id"; }
}; };
} }

View file

@ -60,8 +60,8 @@
#include "video_context.h" #include "video_context.h"
class AudioMarkerKeyframe : public AudioMarker { class AudioMarkerKeyframe : public AudioMarker {
int64_t position;
Pen *style; Pen *style;
int64_t position;
public: public:
AudioMarkerKeyframe(Pen *style, int64_t position) : style(style), position(position) { } AudioMarkerKeyframe(Pen *style, int64_t position) : style(style), position(position) { }
int64_t GetPosition() const { return position; } int64_t GetPosition() const { return position; }
@ -140,8 +140,8 @@ public:
}; };
class VideoPositionMarker : public AudioMarker { class VideoPositionMarker : public AudioMarker {
int64_t position;
Pen style; Pen style;
int64_t position;
public: public:
VideoPositionMarker() VideoPositionMarker()

View file

@ -93,9 +93,9 @@ public:
} }
} }
if (src_bytes_per_sample > sizeof(Target)) if (static_cast<size_t>(src_bytes_per_sample) > sizeof(Target))
sample >>= (src_bytes_per_sample - sizeof(Target)) * 8; sample >>= (src_bytes_per_sample - sizeof(Target)) * 8;
else if (src_bytes_per_sample < sizeof(Target)) else if (static_cast<size_t>(src_bytes_per_sample) < sizeof(Target))
sample <<= (sizeof(Target) - src_bytes_per_sample ) * 8; sample <<= (sizeof(Target) - src_bytes_per_sample ) * 8;
dest[i] = (Target)sample; dest[i] = (Target)sample;

View file

@ -208,7 +208,7 @@ namespace Automation4 {
config_dialog = 0; config_dialog = 0;
} }
if (config_dialog = GenerateConfigDialog(parent, c)) { if ((config_dialog = GenerateConfigDialog(parent, c))) {
wxString val = c->ass->GetScriptInfo(GetScriptSettingsIdentifier()); wxString val = c->ass->GetScriptInfo(GetScriptSettingsIdentifier());
if (!val.empty()) if (!val.empty())
config_dialog->Unserialise(val); config_dialog->Unserialise(val);

View file

@ -183,7 +183,7 @@ struct grid_swap_up : public Command {
STR_HELP("Move the selected line up one row") STR_HELP("Move the selected line up one row")
CMD_TYPE(COMMAND_VALIDATE) CMD_TYPE(COMMAND_VALIDATE)
bool Validate(agi::Context *c) { bool Validate(const agi::Context *c) {
return c->selectionController->GetActiveLine() != 0; return c->selectionController->GetActiveLine() != 0;
} }
@ -203,7 +203,7 @@ struct grid_swap_down : public Command {
STR_HELP("Move the selected line down one row") STR_HELP("Move the selected line down one row")
CMD_TYPE(COMMAND_VALIDATE) CMD_TYPE(COMMAND_VALIDATE)
bool Validate(agi::Context *c) { bool Validate(const agi::Context *c) {
return c->selectionController->GetActiveLine() != 0; return c->selectionController->GetActiveLine() != 0;
} }

View file

@ -149,7 +149,7 @@ struct tool_style_assistant : public Command {
struct tool_styling_assistant_validator : public Command { struct tool_styling_assistant_validator : public Command {
CMD_TYPE(COMMAND_VALIDATE) CMD_TYPE(COMMAND_VALIDATE)
bool Validate(agi::Context *c) { bool Validate(const agi::Context *c) {
return !!c->stylingAssistant; return !!c->stylingAssistant;
} }
}; };
@ -237,7 +237,7 @@ struct tool_translation_assistant : public Command {
struct tool_translation_assistant_validator : public Command { struct tool_translation_assistant_validator : public Command {
CMD_TYPE(COMMAND_VALIDATE) CMD_TYPE(COMMAND_VALIDATE)
bool Validate(agi::Context *c) { bool Validate(const agi::Context *c) {
return !!c->translationAssistant; return !!c->translationAssistant;
} }
}; };

View file

@ -180,7 +180,7 @@ void DialogExport::OnChange(wxCommandEvent &) {
// Swap the items at idx and idx + 1 // Swap the items at idx and idx + 1
static void swap(wxCheckListBox *list, int idx, int sel_dir) { static void swap(wxCheckListBox *list, int idx, int sel_dir) {
if (idx < 0 || idx + 1 == list->GetCount()) return; if (idx < 0 || idx + 1 == (int)list->GetCount()) return;
list->Freeze(); list->Freeze();
wxString tempname = list->GetString(idx); wxString tempname = list->GetString(idx);

View file

@ -116,7 +116,7 @@ public:
template<class T> template<class T>
static void Register(std::string name, bool hide = false, std::vector<std::string> subTypes = std::vector<std::string>()) { static void Register(std::string name, bool hide = false, std::vector<std::string> subTypes = std::vector<std::string>()) {
DoRegister(&Factory0<Base>::template create<T>, name, hide, subTypes); FactoryBase<func>::DoRegister(&Factory0<Base>::template create<T>, name, hide, subTypes);
} }
}; };
@ -140,6 +140,6 @@ public:
template<class T> template<class T>
static void Register(std::string name, bool hide = false, std::vector<std::string> subTypes = std::vector<std::string>()) { static void Register(std::string name, bool hide = false, std::vector<std::string> subTypes = std::vector<std::string>()) {
DoRegister(&Factory1<Base, Arg1>::template create<T>, name, hide, subTypes); FactoryBase<func>::DoRegister(&Factory1<Base, Arg1>::template create<T>, name, hide, subTypes);
} }
}; };

View file

@ -45,7 +45,6 @@ void clear() {
static std::vector<std::string> keycode_names; static std::vector<std::string> keycode_names;
static std::string const& get_keycode_name(int code);
static void init_keycode_names(); static void init_keycode_names();
static std::string const& keycode_name(int code) { static std::string const& keycode_name(int code) {

View file

@ -704,7 +704,7 @@ void SubsEditBox::SetTag(wxString tag, wxString value, bool atEnd) {
AssDialogueBlock *block = line->Blocks[blockn]; AssDialogueBlock *block = line->Blocks[blockn];
if (dynamic_cast<AssDialogueBlockDrawing*>(block)) if (dynamic_cast<AssDialogueBlockDrawing*>(block))
--blockn; --blockn;
else if (plain = dynamic_cast<AssDialogueBlockPlain*>(block)) { else if ((plain = dynamic_cast<AssDialogueBlockPlain*>(block))) {
// Cursor is in a comment block, so try the previous block instead // Cursor is in a comment block, so try the previous block instead
if (plain->GetText().StartsWith("{")) { if (plain->GetText().StartsWith("{")) {
--blockn; --blockn;