--- nono/util/viewcgrom/viewcgrom.cpp 2026/04/29 17:05:31 1.1.1.5 +++ nono/util/viewcgrom/viewcgrom.cpp 2026/04/29 17:05:40 1.1.1.7 @@ -5,11 +5,15 @@ // #include "wxheader.h" +PRAGMA_PUSH_WARNINGS #include #include #include #include #include +PRAGMA_POP_WARNINGS +#include +#include #define TITLE wxT("X680x0 CGROMビューア") #define COPYRIGHT wxT("Copyright (C) 2012-2019 isaki@NetBSD.org") @@ -107,7 +111,7 @@ class MyFrame : public wxFrame class MyApp : public wxApp { public: - virtual bool OnInit(); + bool OnInit() override; wxString filename; private: @@ -115,7 +119,10 @@ class MyApp : public wxApp static const wxCmdLineEntryDesc desc[]; }; +// IMPLEMENT_APP() は闇マクロすぎて clang のちからには耐えられない +PRAGMA_PUSH_WARNINGS IMPLEMENT_APP(MyApp) +PRAGMA_POP_WARNINGS // --- @@ -623,7 +630,7 @@ bool MyFrame::CreateImage() { unsigned char *imagebuf; - unsigned char buf[bytes]; + std::vector buf(bytes); size_t n; int minus_addr; @@ -651,7 +658,7 @@ MyFrame::CreateImage() &imagebuf[((view.x * bdsz.y) * cy + bdsz.x * cx) * 3]; /* ファイルオフセットが正なら1文字分読み込み */ if (minus_addr >= 0) { - n = file.Read(buf, bytes); + n = file.Read(buf.data(), buf.size()); } else { /* 負なら0バイト読んだことにしてカウントだけする */ /* 文字の途中でプラスに転じるケースは面倒なので無視 */