diff --git a/.gitignore b/.gitignore index d800491d49862aa1e022c5727f63dfa99ea9713e..1423a63c602333f218f654b1b3126d3f4409b8ff 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,6 @@ vendor/luajit/src/luajit .nuget .vs +*.tmp +cscope.files +tags diff --git a/configure.ac b/configure.ac index d366fbfad15ac59e3c8bc52ab5939e3d159120da..7163ab56d34889878ed6c6beb365000adb389fd8 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,7 @@ AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADER([acconf.h]) AC_GNU_SOURCE AC_CANONICAL_HOST +AM_SILENT_RULES([yes]) ########################### # Check host architecture diff --git a/libaegisub/audio/provider_convert.cpp b/libaegisub/audio/provider_convert.cpp index b45d8a852aac9afab585dc112c6005ead5fd4ef4..d767288938236e308bcb4adbfd69e971731866fb 100644 --- a/libaegisub/audio/provider_convert.cpp +++ b/libaegisub/audio/provider_convert.cpp @@ -40,15 +40,16 @@ public: } void FillBuffer(void *buf, int64_t start, int64_t count64) const override { + if (count64 < 0) + abort(); // Convertion is not safe auto count = static_cast<size_t>(count64); - assert(count == count64); src_buf.resize(count * src_bytes_per_sample * channels); source->GetAudio(src_buf.data(), start, count); auto dest = static_cast<int16_t*>(buf); - for (int64_t i = 0; i < count * channels; ++i) { + for (int64_t i = 0; i < static_cast<int64_t>(count) * channels; ++i) { int64_t sample = 0; // 8 bits per sample is assumed to be unsigned with a bias of 127, @@ -84,8 +85,9 @@ public: } void FillBuffer(void *buf, int64_t start, int64_t count64) const override { + if (count64 < 0) + abort(); // Convertion is not safe auto count = static_cast<size_t>(count64); - assert(count == count64); src_buf.resize(count * channels); source->GetAudio(&src_buf[0], start, count); @@ -118,8 +120,9 @@ public: } void FillBuffer(void *buf, int64_t start, int64_t count64) const override { + if (count64 < 0) + abort(); // Convertion is not safe auto count = static_cast<size_t>(count64); - assert(count == count64); src_buf.resize(count * src_channels); source->GetAudio(&src_buf[0], start, count); diff --git a/libaegisub/include/libaegisub/util_osx.h b/libaegisub/include/libaegisub/util_osx.h index 3e4ce599e792bc308b8ad158a0d99ecfa3beff04..9c839e181e16ea1df69d7394895ba6f36b356f9b 100644 --- a/libaegisub/include/libaegisub/util_osx.h +++ b/libaegisub/include/libaegisub/util_osx.h @@ -33,7 +33,7 @@ namespace agi { namespace osx { class AppNapDisabler { - void *handle; + __attribute__((unused)) void *handle; public: AppNapDisabler(std::string reason); ~AppNapDisabler(); diff --git a/libaegisub/unix/util.cpp b/libaegisub/unix/util.cpp index 4cf67211983fabace6b8310baa679844c6416577..7a88bfecbcafc4c13cce0723d679c02be8f61f7d 100644 --- a/libaegisub/unix/util.cpp +++ b/libaegisub/unix/util.cpp @@ -26,11 +26,7 @@ namespace agi { namespace util { void SetThreadName(const char *) { } void sleep_for(int ms) { -#ifdef __clang__ - std::this_thread::sleep_for(std::chrono::milliseconds(ms)); -#else boost::this_thread::sleep_for(boost::chrono::milliseconds(ms)); -#endif } } } diff --git a/src/audio_player_oss.cpp b/src/audio_player_oss.cpp index 93950baef5645fb94fb2d9fb799c9b1438937b6d..2d7abd560bc3e6b1922e83c05d24045252900477 100644 --- a/src/audio_player_oss.cpp +++ b/src/audio_player_oss.cpp @@ -267,7 +267,7 @@ int64_t OSSPlayer::GetCurrentPosition() LOG_D("player/audio/oss") << "cur_frame: " << cur_frame << " delay " << delay; // delay can jitter a bit at the end, detect that - if (cur_frame == end_frame && delay < rate / 20) { + if (cur_frame == end_frame && delay < static_cast<int>(rate / 20)) { return cur_frame; } return MAX(0, (long) cur_frame - delay); diff --git a/src/audio_timing_karaoke.cpp b/src/audio_timing_karaoke.cpp index 932d1125069ab739fd21cd60c9ffbc2ee8de9ff6..5476b8ce0053aa2424904be6808e0796821060ce 100644 --- a/src/audio_timing_karaoke.cpp +++ b/src/audio_timing_karaoke.cpp @@ -562,10 +562,11 @@ void AudioTimingControllerKaraoke::OnMarkerDrag(std::vector<AudioMarker*> const& // Fix rounding error new_position = (new_position + 5) / 10 * 10; int old_position = m[0]->GetPosition(); - int syl = MoveMarker(static_cast<KaraokeMarker *>(m[0]), new_position); - if (syl < 0) return; + int syl_int = MoveMarker(static_cast<KaraokeMarker *>(m[0]), new_position); + if (syl_int < 0) return; + size_t syl = syl_int; - bool announce_primary = (syl == cur_syl || syl == cur_syl + 1); + bool announce_primary = ((syl == cur_syl) || (syl == (cur_syl + 1))); if (m.size() > 1) { int delta = m[0]->GetPosition() - old_position; for (AudioMarker *marker : m | boost::adaptors::sliced(1, m.size())) diff --git a/src/auto4_lua.cpp b/src/auto4_lua.cpp index 6c131902ecb5dd2d46bd2f6b315b5c84aa7ae615..59c1e10af3c9844a67e5f13de66687ae90d4aa25 100644 --- a/src/auto4_lua.cpp +++ b/src/auto4_lua.cpp @@ -244,7 +244,8 @@ namespace { lua_pushvalue(L, 1); std::unique_ptr<AssEntry> et(Automation4::LuaAssFile::LuaToAssEntry(L)); lua_pop(L, 1); - if (typeid(*et) != typeid(AssStyle)) + auto& et_ref = *et; + if (typeid(et_ref) != typeid(AssStyle)) return error(L, "Not a style entry"); double width, height, descent, extlead; @@ -840,7 +841,8 @@ namespace { throw LuaForEachBreak(); } - if (typeid(*lines[cur - 1]) != typeid(AssDialogue)) { + auto &prev_line = lines[cur - 1][0]; + if (typeid(prev_line) != typeid(AssDialogue)) { wxLogError("Selected row %d is not a dialogue line", cur); throw LuaForEachBreak(); } diff --git a/src/auto4_lua_assfile.cpp b/src/auto4_lua_assfile.cpp index 3aef3b76941febfe2910c8822fc9d31a9fe64b09..91e66d932697da943408208ac6476b385b2a233b 100644 --- a/src/auto4_lua_assfile.cpp +++ b/src/auto4_lua_assfile.cpp @@ -744,7 +744,7 @@ namespace Automation4 { , can_modify(can_modify) , can_set_undo(can_set_undo) { - for (auto& line : ass->Info) + for (size_t i = 0; i < ass->Info.size(); ++i) lines.push_back(nullptr); for (auto& line : ass->Styles) lines.push_back(&line); diff --git a/src/dialog_version_check.cpp b/src/dialog_version_check.cpp index dcf2109cd3e897d52fb5c7cc49295f437b5438d1..eaf2f06668a9b4768af95b731b2bfbd4a4ea0f5c 100644 --- a/src/dialog_version_check.cpp +++ b/src/dialog_version_check.cpp @@ -232,7 +232,7 @@ void PostErrorEvent(bool interactive, wxString const& error_text) { } } -static const char * GetOSShortName() { +__attribute__((unused)) static const char * GetOSShortName() { int osver_maj, osver_min; wxOperatingSystemId osid = wxGetOsVersion(&osver_maj, &osver_min); @@ -310,7 +310,7 @@ static wxString GetUILanguage() { return &output[0]; } -static wxString GetSystemLanguage() { +__attribute__((unused)) static wxString GetSystemLanguage() { wxString res = GetUILanguage(); if (!res) // On an old version of Windows, let's just return the LANGID as a string @@ -331,12 +331,12 @@ static wxString GetSystemLanguage() { } #else -static wxString GetSystemLanguage() { +__attribute__((unused)) static wxString GetSystemLanguage() { return wxLocale::GetLanguageInfo(wxLocale::GetSystemLanguage())->CanonicalName; } #endif -static wxString GetAegisubLanguage() { +__attribute__((unused)) static wxString GetAegisubLanguage() { return to_wx(OPT_GET("App/Language")->GetString()); } diff --git a/src/gl/glext.h b/src/gl/glext.h index cfb61d8cd2d207cb5ef29af05c4e7c3993d48e3c..4f5e87f8b5eb67e1563cb0944dd3e9ab0f457064 100644 --- a/src/gl/glext.h +++ b/src/gl/glext.h @@ -31,6 +31,9 @@ extern "C" { /* Header file version number, required by OpenGL ABI for Linux */ /* glext.h last updated $Date: 2010-05-17 09:47:20 -0700 (Mon, 17 May 2010) $ */ /* Current version at http://www.opengl.org/registry/ */ +#ifdef GL_GLEXT_VERSION +#undef GL_GLEXT_VERSION +#endif #define GL_GLEXT_VERSION 62 /* Function declaration macros - to move into glplatform.h */ diff --git a/src/hotkey.cpp b/src/hotkey.cpp index c80d4fe670ba1c50b6777b932d74c296891a30d7..45cbcdeb5ec6a6e0e1ced9790375a168f0bfb074 100644 --- a/src/hotkey.cpp +++ b/src/hotkey.cpp @@ -47,11 +47,6 @@ namespace { {nullptr} }; - const char *added_hotkeys_minimize[][3] = { - {"app/minimize", "Default", "Ctrl-M"}, - {nullptr} - }; - const char *added_hotkeys_time_tap[][3] = { {"time/tap/connect", "Audio", "I"}, {"time/tap/no_connect", "Audio", "O"}, diff --git a/src/main.cpp b/src/main.cpp index 7f6d9162c8e754fa9e32a01034f167a37f135c28..801a3eec8cc31a7bbbddf980f208f19bb37db818 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -148,7 +148,8 @@ bool AegisubApp::OnInit() { boost::filesystem::path::imbue(std::locale()); // Pointless `this` capture required due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51494 - agi::dispatch::Init([this](agi::dispatch::Thunk f) { + // Because GCC 4.8 is VEARY OLD, the pointless capture as been removed... + agi::dispatch::Init([](agi::dispatch::Thunk f) { auto evt = new ValueEvent<agi::dispatch::Thunk>(EVT_CALL_THUNK, -1, std::move(f)); wxTheApp->QueueEvent(evt); }); diff --git a/src/retina_helper.h b/src/retina_helper.h index ec4111955f94ada7538885a80e4d3564abbfdf27..389036d0f260c17e13277b8bc6e127b4b74f4475 100644 --- a/src/retina_helper.h +++ b/src/retina_helper.h @@ -19,8 +19,6 @@ class wxWindow; class RetinaHelper { - wxWindow *window; - void *observer; agi::signal::Signal<int> ScaleFactorChanged; public: RetinaHelper(wxWindow *window); diff --git a/src/video_display.cpp b/src/video_display.cpp index 2df9ec3c05e4cf0f5d40cbbe1e49bd5c5b2a321a..ef8bed67bffe02639dbcd874807978981cc7f508 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -428,7 +428,10 @@ void VideoDisplay::SetTool(std::unique_ptr<VisualToolBase> new_tool) { } bool VideoDisplay::ToolIsType(std::type_info const& type) const { - return tool && typeid(*tool) == type; + if (! tool) + return false; + auto &tool_type = *tool; + return typeid(tool_type) == type; } Vector2D VideoDisplay::GetMousePosition() const {