--- nono/vm/dipsw.cpp 2026/04/29 17:05:17 1.1.1.1 +++ nono/vm/dipsw.cpp 2026/04/29 17:05:38 1.1.1.3 @@ -30,27 +30,27 @@ DipswDevice::~DipswDevice() // 値を設定。true/false の意味は機種依存。 void -DipswDevice::Set(int n, bool val) +DipswDevice::Set(uint n, bool val) { - assertmsg(0 <= n && n < dipsw.size(), - "n=%d size=%zd: out of range", n, dipsw.size()); + assertmsg(n < dipsw.size(), + "n=%u size=%zu: out of range", n, dipsw.size()); dipsw[n] = val; } // 値を取得。true/false の意味は機種依存。 bool -DipswDevice::Get(int n) const +DipswDevice::Get(uint n) const { - assertmsg(0 <= n && n < dipsw.size(), - "n=%d size=%zd: out of range", n, dipsw.size()); + assertmsg(n < dipsw.size(), + "n=%u size=%zu: out of range", n, dipsw.size()); return dipsw[n]; } // 位置を設定。pos は 0 が上、1 が下。 void -DipswDevice::SetPosition(int n, int pos) +DipswDevice::SetPosition(uint n, uint pos) { bool val; @@ -64,7 +64,7 @@ DipswDevice::SetPosition(int n, int pos) // 位置を取得。戻り値は 0 が上、1 が下。 int -DipswDevice::GetPosition(int n) const +DipswDevice::GetPosition(uint n) const { bool val = Get(n); int pos; @@ -119,10 +119,6 @@ LunaDipswDevice::~LunaDipswDevice() bool LunaDipswDevice::Init() { - if (inherited::Init() == false) { - return false; - } - const ConfigItem& item1 = gConfig->Find("luna-dipsw1"); const std::string& str1 = item1.AsString(); if (str1.size() != 8) { @@ -198,10 +194,6 @@ NewsDipswDevice::~NewsDipswDevice() bool NewsDipswDevice::Init() { - if (inherited::Init() == false) { - return false; - } - const ConfigItem& item = gConfig->Find("news-dipsw"); const std::string& str = item.AsString(); if (str.size() != 8) {