Fix a bunch of -pedantic stuff

Originally committed to SVN as r6181.
This commit is contained in:
Thomas Goyne 2011-12-28 21:27:06 +00:00
parent cdf8e31e1a
commit cae10121ed
34 changed files with 63 additions and 62 deletions

View file

@ -101,13 +101,13 @@ UnknownElement::~UnknownElement() { delete m_pImp; }
UnknownElement::operator Type const&() const { return CastTo<Type>(); } \ UnknownElement::operator Type const&() const { return CastTo<Type>(); } \
UnknownElement::operator Type&() { return CastTo<Type>(); } UnknownElement::operator Type&() { return CastTo<Type>(); }
DEFINE_UE_TYPE(Object); DEFINE_UE_TYPE(Object)
DEFINE_UE_TYPE(Array); DEFINE_UE_TYPE(Array)
DEFINE_UE_TYPE(Integer); DEFINE_UE_TYPE(Integer)
DEFINE_UE_TYPE(Double); DEFINE_UE_TYPE(Double)
DEFINE_UE_TYPE(Boolean); DEFINE_UE_TYPE(Boolean)
DEFINE_UE_TYPE(String); DEFINE_UE_TYPE(String)
DEFINE_UE_TYPE(Null); DEFINE_UE_TYPE(Null)
UnknownElement& UnknownElement::operator =(const UnknownElement& unknown) UnknownElement& UnknownElement::operator =(const UnknownElement& unknown)
{ {

View file

@ -74,7 +74,6 @@ struct TimecodeRange {
int start; int start;
int end; int end;
double fps; double fps;
double time;
bool operator<(TimecodeRange cmp) { bool operator<(TimecodeRange cmp) {
return start < cmp.start; return start < cmp.start;
} }

View file

@ -56,7 +56,7 @@ public:
/// Options class settings. /// Options class settings.
enum OptionSetting { enum OptionSetting {
NONE = 0x000, ///< Do nothing (default) NONE = 0x000, ///< Do nothing (default)
FLUSH_SKIP = 0x001, ///< Skip writing the config file to disk FLUSH_SKIP = 0x001 ///< Skip writing the config file to disk
}; };
private: private:

View file

@ -114,7 +114,7 @@ public:
virtual std::vector<bool> const& GetDefaultListBool() const { throw ListTypeError("string"); } virtual std::vector<bool> const& GetDefaultListBool() const { throw ListTypeError("string"); }
DEFINE_SIGNAL_ADDERS(ValueChanged, Subscribe); DEFINE_SIGNAL_ADDERS(ValueChanged, Subscribe)
}; };
#define CONFIG_OPTIONVALUE(type_name, type) \ #define CONFIG_OPTIONVALUE(type_name, type) \

View file

@ -113,19 +113,19 @@ std::string Platform::GetVideoInfo(enum Platform::VideoInfo which) {
std::string Platform::ArchName() { std::string Platform::ArchName() {
return std::string(plat.GetArchName()); return std::string(plat.GetArchName());
}; }
std::string Platform::OSFamily() { std::string Platform::OSFamily() {
return std::string(plat.GetOperatingSystemFamilyName()); return std::string(plat.GetOperatingSystemFamilyName());
}; }
std::string Platform::OSName() { std::string Platform::OSName() {
return std::string(plat.GetOperatingSystemIdName()); return std::string(plat.GetOperatingSystemIdName());
}; }
std::string Platform::Endian() { std::string Platform::Endian() {
return std::string(plat.GetEndiannessName()); return std::string(plat.GetEndiannessName());
}; }
int Platform::DisplayDepth() { int Platform::DisplayDepth() {

View file

@ -37,38 +37,38 @@ std::string PlatformUnixBSD::CPUId() {
size_t len = sizeof(id); size_t len = sizeof(id);
sysctlbyname("hw.model", &id, &len, NULL, 0); sysctlbyname("hw.model", &id, &len, NULL, 0);
return id; return id;
}; }
std::string PlatformUnixBSD::CPUSpeed() { std::string PlatformUnixBSD::CPUSpeed() {
return ""; return "";
}; }
int PlatformUnixBSD::CPUCores() { int PlatformUnixBSD::CPUCores() {
return 0; return 0;
}; }
int PlatformUnixBSD::CPUCount() { int PlatformUnixBSD::CPUCount() {
int proc; int proc;
size_t len = sizeof(proc); size_t len = sizeof(proc);
sysctlbyname("hw.ncpu", &proc, &len, NULL, 0); sysctlbyname("hw.ncpu", &proc, &len, NULL, 0);
return proc; return proc;
}; }
std::string PlatformUnixBSD::CPUFeatures() { std::string PlatformUnixBSD::CPUFeatures() {
return ""; return "";
}; }
std::string PlatformUnixBSD::CPUFeatures2() { std::string PlatformUnixBSD::CPUFeatures2() {
return ""; return "";
}; }
uint64_t PlatformUnixBSD::Memory() { uint64_t PlatformUnixBSD::Memory() {
uint64_t memory; uint64_t memory;
size_t len = sizeof(memory); size_t len = sizeof(memory);
sysctlbyname("hw.physmem", &memory, &len, NULL, 0); sysctlbyname("hw.physmem", &memory, &len, NULL, 0);
return memory; return memory;
}; }
std::string PlatformUnixBSD::UnixLibraries() { std::string PlatformUnixBSD::UnixLibraries() {
return ""; return "";
}; }

View file

@ -444,4 +444,4 @@ namespace Endian {
} }
#endif #endif
}; }

View file

@ -194,7 +194,7 @@ public:
COMMIT_DIAG_TIME = 0x40, COMMIT_DIAG_TIME = 0x40,
/// The text of existing dialogue lines have changed /// The text of existing dialogue lines have changed
COMMIT_DIAG_TEXT = 0x80, COMMIT_DIAG_TEXT = 0x80,
COMMIT_DIAG_FULL = COMMIT_DIAG_META | COMMIT_DIAG_TIME | COMMIT_DIAG_TEXT, COMMIT_DIAG_FULL = COMMIT_DIAG_META | COMMIT_DIAG_TIME | COMMIT_DIAG_TEXT
}; };
DEFINE_SIGNAL_ADDERS(AnnounceCommit, AddCommitListener) DEFINE_SIGNAL_ADDERS(AnnounceCommit, AddCommitListener)

View file

@ -74,7 +74,7 @@
enum { enum {
Audio_Horizontal_Zoom = 1600, Audio_Horizontal_Zoom = 1600,
Audio_Vertical_Zoom, Audio_Vertical_Zoom,
Audio_Volume, Audio_Volume
}; };
AudioBox::AudioBox(wxWindow *parent, agi::Context *context) AudioBox::AudioBox(wxWindow *parent, agi::Context *context)
@ -144,7 +144,7 @@ BEGIN_EVENT_TABLE(AudioBox,wxSashWindow)
EVT_COMMAND_SCROLL(Audio_Horizontal_Zoom, AudioBox::OnHorizontalZoom) EVT_COMMAND_SCROLL(Audio_Horizontal_Zoom, AudioBox::OnHorizontalZoom)
EVT_COMMAND_SCROLL(Audio_Vertical_Zoom, AudioBox::OnVerticalZoom) EVT_COMMAND_SCROLL(Audio_Vertical_Zoom, AudioBox::OnVerticalZoom)
EVT_COMMAND_SCROLL(Audio_Volume, AudioBox::OnVolume) EVT_COMMAND_SCROLL(Audio_Volume, AudioBox::OnVolume)
END_EVENT_TABLE(); END_EVENT_TABLE()
void AudioBox::OnMouseWheel(wxMouseEvent &evt) { void AudioBox::OnMouseWheel(wxMouseEvent &evt) {
if (!ForwardMouseWheelEvent(audioDisplay, evt)) if (!ForwardMouseWheelEvent(audioDisplay, evt))

View file

@ -445,6 +445,6 @@ public:
}; };
namespace agi { namespace agi {
DEFINE_BASE_EXCEPTION(AudioControllerError, Exception); DEFINE_BASE_EXCEPTION(AudioControllerError, Exception)
DEFINE_SIMPLE_EXCEPTION(AudioOpenError, AudioControllerError, "audio_controller/open_failed"); DEFINE_SIMPLE_EXCEPTION(AudioOpenError, AudioControllerError, "audio_controller/open_failed")
}; }

View file

@ -853,7 +853,7 @@ BEGIN_EVENT_TABLE(AudioDisplay, wxWindow)
EVT_SET_FOCUS(AudioDisplay::OnFocus) EVT_SET_FOCUS(AudioDisplay::OnFocus)
EVT_KILL_FOCUS(AudioDisplay::OnFocus) EVT_KILL_FOCUS(AudioDisplay::OnFocus)
EVT_KEY_DOWN(AudioDisplay::OnKeyDown) EVT_KEY_DOWN(AudioDisplay::OnKeyDown)
END_EVENT_TABLE(); END_EVENT_TABLE()
void AudioDisplay::OnPaint(wxPaintEvent&) void AudioDisplay::OnPaint(wxPaintEvent&)

View file

@ -59,7 +59,7 @@ static inline size_t last_lt_or_eq(Container const& c, Value const& v) {
if (it == c.end() || *it > v) if (it == c.end() || *it > v)
--it; --it;
return distance(c.begin(), it); return distance(c.begin(), it);
}; }
AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c) AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c)
: wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN) : wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN)

View file

@ -205,7 +205,7 @@ void OSSPlayer::SetEndPosition(int64_t pos)
{ {
end_frame = pos; end_frame = pos;
if (end_frame <= GetCurrentPosition()) { if (pos <= GetCurrentPosition()) {
ioctl(dspdev, SNDCTL_DSP_RESET, NULL); ioctl(dspdev, SNDCTL_DSP_RESET, NULL);
if (thread && thread->IsAlive()) if (thread && thread->IsAlive())
thread->Delete(); thread->Delete();

View file

@ -595,4 +595,4 @@ namespace Automation4 {
: Script(filename) : Script(filename)
{ {
} }
}; }

View file

@ -320,4 +320,4 @@ namespace Automation4 {
std::vector<ExportFilter*> GetFilters() const { return std::vector<ExportFilter*>(); } std::vector<ExportFilter*> GetFilters() const { return std::vector<ExportFilter*>(); }
std::vector<SubtitleFormat*> GetFormats() const { return std::vector<SubtitleFormat*>(); } std::vector<SubtitleFormat*> GetFormats() const { return std::vector<SubtitleFormat*>(); }
}; };
}; }

View file

@ -515,7 +515,6 @@ namespace Automation4 {
int LuaScript::LuaDecodePath(lua_State *L) int LuaScript::LuaDecodePath(lua_State *L)
{ {
const agi::Context *c = get_context(L);
wxString path = check_wxstring(L, 1); wxString path = check_wxstring(L, 1);
lua_pop(L, 1); lua_pop(L, 1);
lua_pushstring(L, StandardPaths::DecodePath(path).utf8_str()); lua_pushstring(L, StandardPaths::DecodePath(path).utf8_str());

View file

@ -335,4 +335,4 @@ namespace Automation4 {
std::vector<ExportFilter*> GetFilters() const { return filters; } std::vector<ExportFilter*> GetFilters() const { return filters; }
std::vector<SubtitleFormat*> GetFormats() const { return std::vector<SubtitleFormat*>(); } std::vector<SubtitleFormat*> GetFormats() const { return std::vector<SubtitleFormat*>(); }
}; };
}; }

View file

@ -732,6 +732,6 @@ namespace Automation4 {
// Leaves userdata object on stack // Leaves userdata object on stack
} }
}; }
#endif // WITH_AUTO4_LUA #endif // WITH_AUTO4_LUA

View file

@ -460,7 +460,7 @@ namespace Automation4 {
lua_pushboolean(L, value); lua_pushboolean(L, value);
} }
}; };
}; }
// LuaDialog // LuaDialog
LuaDialog::LuaDialog(lua_State *L, bool include_buttons) LuaDialog::LuaDialog(lua_State *L, bool include_buttons)
@ -670,6 +670,6 @@ namespace Automation4 {
LOG_D("automation/lua/dialog") << "button_pushed set to: " << button_pushed; LOG_D("automation/lua/dialog") << "button_pushed set to: " << button_pushed;
evt.Skip(); evt.Skip();
} }
}; }
#endif // WITH_AUTO4_LUA #endif // WITH_AUTO4_LUA

View file

@ -47,4 +47,4 @@ namespace Automation4 {
public: public:
LuaScriptFactory(); LuaScriptFactory();
}; };
}; }

View file

@ -63,6 +63,6 @@ namespace Automation4 {
const char* LuaScriptReader::reader_func(lua_State *, void *data, size_t *size) { const char* LuaScriptReader::reader_func(lua_State *, void *data, size_t *size) {
return static_cast<LuaScriptReader*>(data)->Read(size); return static_cast<LuaScriptReader*>(data)->Read(size);
} }
}; }
#endif // WITH_AUTO4_LUA #endif // WITH_AUTO4_LUA

View file

@ -42,4 +42,4 @@ namespace Automation4 {
static const char* reader_func(lua_State *, void *data, size_t *size); static const char* reader_func(lua_State *, void *data, size_t *size);
}; };
}; }

View file

@ -151,7 +151,7 @@ BEGIN_EVENT_TABLE(BaseGrid,wxWindow)
EVT_MOUSE_EVENTS(BaseGrid::OnMouseEvent) EVT_MOUSE_EVENTS(BaseGrid::OnMouseEvent)
EVT_KEY_DOWN(BaseGrid::OnKeyDown) EVT_KEY_DOWN(BaseGrid::OnKeyDown)
EVT_MENU_RANGE(MENU_SHOW_COL,MENU_SHOW_COL+15,BaseGrid::OnShowColMenu) EVT_MENU_RANGE(MENU_SHOW_COL,MENU_SHOW_COL+15,BaseGrid::OnShowColMenu)
END_EVENT_TABLE(); END_EVENT_TABLE()
void BaseGrid::OnSubtitlesCommit(int type) { void BaseGrid::OnSubtitlesCommit(int type) {
if (type == AssFile::COMMIT_NEW) if (type == AssFile::COMMIT_NEW)
@ -221,7 +221,7 @@ void BaseGrid::UpdateStyle() {
// Set column widths // Set column widths
std::vector<bool> column_array(OPT_GET("Subtitle/Grid/Column")->GetListBool()); std::vector<bool> column_array(OPT_GET("Subtitle/Grid/Column")->GetListBool());
assert(column_array.size() == columns); assert(column_array.size() == (size_t)columns);
for (int i = 0; i < columns; ++i) showCol[i] = column_array[i]; for (int i = 0; i < columns; ++i) showCol[i] = column_array[i];
SetColumnWidths(); SetColumnWidths();
@ -806,7 +806,7 @@ void BaseGrid::OnContextMenu(wxContextMenuEvent &evt) {
}; };
wxMenu menu; wxMenu menu;
for (size_t i = 0; i < columns; ++i) for (int i = 0; i < columns; ++i)
menu.Append(MENU_SHOW_COL + i, strings[i], "", wxITEM_CHECK)->Check(showCol[i]); menu.Append(MENU_SHOW_COL + i, strings[i], "", wxITEM_CHECK)->Check(showCol[i]);
PopupMenu(&menu); PopupMenu(&menu);
} }

View file

@ -126,7 +126,7 @@ BEGIN_EVENT_TABLE(DialogAttachments,wxDialog)
EVT_LIST_ITEM_SELECTED(ATTACHMENT_LIST,DialogAttachments::OnListClick) EVT_LIST_ITEM_SELECTED(ATTACHMENT_LIST,DialogAttachments::OnListClick)
EVT_LIST_ITEM_DESELECTED(ATTACHMENT_LIST,DialogAttachments::OnListClick) EVT_LIST_ITEM_DESELECTED(ATTACHMENT_LIST,DialogAttachments::OnListClick)
EVT_LIST_ITEM_FOCUSED(ATTACHMENT_LIST,DialogAttachments::OnListClick) EVT_LIST_ITEM_FOCUSED(ATTACHMENT_LIST,DialogAttachments::OnListClick)
END_EVENT_TABLE(); END_EVENT_TABLE()
void DialogAttachments::AttachFile(wxFileDialog &diag, wxString const& group, wxString const& commit_msg) { void DialogAttachments::AttachFile(wxFileDialog &diag, wxString const& group, wxString const& commit_msg) {
if (diag.ShowModal() == wxID_CANCEL) return; if (diag.ShowModal() == wxID_CANCEL) return;

View file

@ -48,7 +48,7 @@ namespace Automation4 {
class ScriptManager; class ScriptManager;
class AutoloadScriptManager; class AutoloadScriptManager;
class Script; class Script;
}; }
namespace agi { struct Context; } namespace agi { struct Context; }

View file

@ -114,5 +114,5 @@ enum {
Dummy_Video_FPS, Dummy_Video_FPS,
/// DOCME /// DOCME
Dummy_Video_Length, Dummy_Video_Length
}; };

View file

@ -77,5 +77,5 @@ enum {
EDIT_ACTOR_SEPARATOR = 1480, EDIT_ACTOR_SEPARATOR = 1480,
/// DOCME /// DOCME
EDIT_COMMENT_STARTER, EDIT_COMMENT_STARTER
}; };

View file

@ -47,6 +47,8 @@ using namespace agi::hotkey;
/// @class HotkeyModelItem /// @class HotkeyModelItem
/// @brief A base class for things exposed by HotkeyDataViewModel /// @brief A base class for things exposed by HotkeyDataViewModel
class HotkeyModelItem { class HotkeyModelItem {
protected:
~HotkeyModelItem() { }
public: public:
virtual unsigned int GetChildren(wxDataViewItemArray &children) const=0; virtual unsigned int GetChildren(wxDataViewItemArray &children) const=0;
virtual wxDataViewItem GetParent() const=0; virtual wxDataViewItem GetParent() const=0;

View file

@ -103,8 +103,8 @@ public:
static AudioProvider *GetProvider(wxString filename, int cache=-1); static AudioProvider *GetProvider(wxString filename, int cache=-1);
}; };
DEFINE_BASE_EXCEPTION_NOINNER(AudioProviderError, agi::Exception); DEFINE_BASE_EXCEPTION_NOINNER(AudioProviderError, agi::Exception)
DEFINE_SIMPLE_EXCEPTION_NOINNER(AudioOpenError, AudioProviderError, "audio/open/failed"); DEFINE_SIMPLE_EXCEPTION_NOINNER(AudioOpenError, AudioProviderError, "audio/open/failed")
/// Error of some sort occurred while decoding a frame /// Error of some sort occurred while decoding a frame
DEFINE_SIMPLE_EXCEPTION_NOINNER(AudioDecodeError, AudioProviderError, "audio/error"); DEFINE_SIMPLE_EXCEPTION_NOINNER(AudioDecodeError, AudioProviderError, "audio/error")

View file

@ -71,11 +71,11 @@ public:
virtual bool WantsCaching() const { return false; } virtual bool WantsCaching() const { return false; }
}; };
DEFINE_BASE_EXCEPTION_NOINNER(VideoProviderError, agi::Exception); DEFINE_BASE_EXCEPTION_NOINNER(VideoProviderError, agi::Exception)
/// File could be opened, but is not a supported format /// File could be opened, but is not a supported format
DEFINE_SIMPLE_EXCEPTION_NOINNER(VideoNotSupported, VideoProviderError, "video/open/notsupported"); DEFINE_SIMPLE_EXCEPTION_NOINNER(VideoNotSupported, VideoProviderError, "video/open/notsupported")
/// File appears to be a supported format, but could not be opened /// File appears to be a supported format, but could not be opened
DEFINE_SIMPLE_EXCEPTION_NOINNER(VideoOpenError, VideoProviderError, "video/open/failed"); DEFINE_SIMPLE_EXCEPTION_NOINNER(VideoOpenError, VideoProviderError, "video/open/failed")
/// Error of some sort occurred while decoding a frame /// Error of some sort occurred while decoding a frame
DEFINE_SIMPLE_EXCEPTION_NOINNER(VideoDecodeError, VideoProviderError, "video/error"); DEFINE_SIMPLE_EXCEPTION_NOINNER(VideoDecodeError, VideoProviderError, "video/error")

View file

@ -71,7 +71,7 @@ class SrtTagParser {
TAG_STRIKEOUT_OPEN, TAG_STRIKEOUT_OPEN,
TAG_STRIKEOUT_CLOSE, TAG_STRIKEOUT_CLOSE,
TAG_FONT_OPEN, TAG_FONT_OPEN,
TAG_FONT_CLOSE, TAG_FONT_CLOSE
}; };
wxRegEx tag_matcher; wxRegEx tag_matcher;

View file

@ -90,7 +90,8 @@ std::tr1::shared_ptr<AegiVideoFrame> ThreadedFrameSource::ProcFrame(int frameNum
// This will crash if any of the export filters try to use // This will crash if any of the export filters try to use
// anything but the subtitles, but that wouldn't be safe to // anything but the subtitles, but that wouldn't be safe to
// do anyway // do anyway
agi::Context c = { 0 }; agi::Context c;
memset(&c, 0, sizeof c);
c.ass = subs.get(); c.ass = subs.get();
AssExporter exporter(&c); AssExporter exporter(&c);

View file

@ -90,5 +90,5 @@ public:
/// Copy constructor /// Copy constructor
NumValidator(const NumValidator& from); NumValidator(const NumValidator& from);
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE()
}; };

View file

@ -66,7 +66,7 @@ class YUV4MPEGVideoProvider : public VideoProvider {
Y4M_PIXFMT_444, /// 4:4:4, i.e. no chroma subsampling Y4M_PIXFMT_444, /// 4:4:4, i.e. no chroma subsampling
Y4M_PIXFMT_444ALPHA, /// 4:4:4 plus alpha channel Y4M_PIXFMT_444ALPHA, /// 4:4:4 plus alpha channel
Y4M_PIXFMT_MONO, /// luma only (grayscale) Y4M_PIXFMT_MONO /// luma only (grayscale)
}; };
@ -79,7 +79,7 @@ class YUV4MPEGVideoProvider : public VideoProvider {
Y4M_ILACE_BFF, /// interlaced, bottom field first Y4M_ILACE_BFF, /// interlaced, bottom field first
Y4M_ILACE_MIXED, /// mixed interlaced/progressive, possibly with RFF flags Y4M_ILACE_MIXED, /// mixed interlaced/progressive, possibly with RFF flags
Y4M_ILACE_UNKNOWN, /// unknown interlacing mode (not the same as undefined) Y4M_ILACE_UNKNOWN /// unknown interlacing mode (not the same as undefined)
}; };
@ -104,7 +104,7 @@ class YUV4MPEGVideoProvider : public VideoProvider {
/// chroma subsampling flags /// chroma subsampling flags
Y4M_FFLAG_C_P = 0x0200, /// progressive (whole frame subsampled) Y4M_FFLAG_C_P = 0x0200, /// progressive (whole frame subsampled)
Y4M_FFLAG_C_I = 0x0400, /// interlaced (fields subsampled independently) Y4M_FFLAG_C_I = 0x0400, /// interlaced (fields subsampled independently)
Y4M_FFLAG_C_UNKNOWN = 0x0800, /// unknown (only allowed for non-4:2:0 sampling) Y4M_FFLAG_C_UNKNOWN = 0x0800 /// unknown (only allowed for non-4:2:0 sampling)
}; };