--- nono/util/viewcgrom/viewcgrom.cpp 2026/04/29 17:05:27 1.1.1.4 +++ nono/util/viewcgrom/viewcgrom.cpp 2026/04/29 17:05:36 1.1.1.6 @@ -10,6 +10,7 @@ #include #include #include +#include #define TITLE wxT("X680x0 CGROMビューア") #define COPYRIGHT wxT("Copyright (C) 2012-2019 isaki@NetBSD.org") @@ -49,7 +50,7 @@ class ViewCtrl : public wxWindow unsigned char *imagebuf; private: void OnPaint(wxPaintEvent& event); - DECLARE_EVENT_TABLE(); + wxDECLARE_EVENT_TABLE(); }; class MyFrame : public wxFrame @@ -101,7 +102,7 @@ class MyFrame : public wxFrame static ctxmenu_t ctxmenu[]; - DECLARE_EVENT_TABLE(); + wxDECLARE_EVENT_TABLE(); }; class MyApp : public wxApp @@ -623,7 +624,7 @@ bool MyFrame::CreateImage() { unsigned char *imagebuf; - unsigned char buf[bytes]; + std::vector buf(bytes); size_t n; int minus_addr; @@ -651,7 +652,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バイト読んだことにしてカウントだけする */ /* 文字の途中でプラスに転じるケースは面倒なので無視 */