diff options
author | Vas Crabb <vas@vastheman.com> | 2019-11-05 19:28:28 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2019-11-05 19:28:28 +1100 |
commit | 2012b38e1e7cb669ddecf684d0cbdb8c2d214292 (patch) | |
tree | bd23d8d4a01a6e0bb7b4366e085aae67bbeafb94 | |
parent | 76a2e99d6bb80aaf515b8da699255c87498f7ca0 (diff) |
(nw) be strictly POSIX compliant, reduce fragmentation, get rid of an unused member
-rw-r--r-- | src/devices/cpu/dspp/dspp.h | 8 | ||||
-rw-r--r-- | src/devices/cpu/dspp/dsppdasm.h | 6 | ||||
-rw-r--r-- | src/emu/screen.cpp | 32 | ||||
-rw-r--r-- | src/mame/machine/3dom2.cpp | 3 | ||||
-rw-r--r-- | src/mame/machine/3dom2.h | 10 | ||||
-rw-r--r-- | src/mame/video/3dom2_te.h | 1 |
6 files changed, 30 insertions, 30 deletions
diff --git a/src/devices/cpu/dspp/dspp.h b/src/devices/cpu/dspp/dspp.h index 302d141db13..2f44eda22ce 100644 --- a/src/devices/cpu/dspp/dspp.h +++ b/src/devices/cpu/dspp/dspp.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_CPU_DSPP_DSPP_H +#define MAME_CPU_DSPP_DSPP_H -#ifndef DEVICES_CPU_DSPP_DSPP_H -#define DEVICES_CPU_DSPP_DSPP_H +#pragma once #include "cpu/drcfe.h" #include "cpu/drcuml.h" @@ -392,4 +392,4 @@ public: // TODO DECLARE_DEVICE_TYPE(DSPP, dspp_device); -#endif // DEVICES_CPU_DSPP_DSPP_H +#endif // MAME_CPU_DSPP_DSPP_H diff --git a/src/devices/cpu/dspp/dsppdasm.h b/src/devices/cpu/dspp/dsppdasm.h index 0ceae9b117b..538f0a96c0e 100644 --- a/src/devices/cpu/dspp/dsppdasm.h +++ b/src/devices/cpu/dspp/dsppdasm.h @@ -4,8 +4,8 @@ DSPP disassembler shim */ -#ifndef DEVICES_CPU_DSPP_DSPPDASM_H -#define DEVICES_CPU_DSPP_DSPPDASM_H +#ifndef MAME_CPU_DSPP_DSPPDASM_H +#define MAME_CPU_DSPP_DSPPDASM_H #pragma once @@ -19,4 +19,4 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; }; -#endif // DEVICES_CPU_DSPP_DSPPDASM_H +#endif // MAME_CPU_DSPP_DSPPDASM_H diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 52d373fbeb8..45a4ad42107 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -72,7 +72,7 @@ private: NSVGimage *m_image; NSVGrasterizer *m_rasterizer; std::vector<bool> m_key_state; - std::vector<std::list<NSVGshape *>> m_keyed_shapes; + std::vector<std::vector<NSVGshape *>> m_keyed_shapes; std::unordered_map<std::string, int> m_key_ids; int m_key_count; @@ -95,29 +95,29 @@ private: screen_device::svg_renderer::svg_renderer(memory_region *region) { // nanosvg makes assumptions about the global locale - char *s = new char[region->bytes()+1]; - memcpy(s, region->base(), region->bytes()); - s[region->bytes()] = 0; - const char *const lcctype(std::setlocale(LC_CTYPE, nullptr)); - const char *const lcnumeric(std::setlocale(LC_NUMERIC, nullptr)); - std::setlocale(LC_CTYPE, "C"); - std::setlocale(LC_NUMERIC, "C"); - m_image = nsvgParse(s, "px", 72); - std::setlocale(LC_CTYPE, lcctype); - std::setlocale(LC_NUMERIC, lcnumeric); - delete[] s; + { + const std::unique_ptr<char []> s(new char[region->bytes() + 1]); + memcpy(s.get(), region->base(), region->bytes()); + s[region->bytes()] = 0; + const std::string lcctype(std::setlocale(LC_CTYPE, nullptr)); + const std::string lcnumeric(std::setlocale(LC_NUMERIC, nullptr)); + std::setlocale(LC_CTYPE, "C"); + std::setlocale(LC_NUMERIC, "C"); + m_image = nsvgParse(s.get(), "px", 72); + std::setlocale(LC_CTYPE, lcctype.c_str()); + std::setlocale(LC_NUMERIC, lcnumeric.c_str()); + } m_rasterizer = nsvgCreateRasterizer(); m_key_count = 0; - for (NSVGshape *shape = m_image->shapes; shape != nullptr; shape = shape->next) + for (NSVGshape *shape = m_image->shapes; shape; shape = shape->next) if(shape->title[0]) { - auto it = m_key_ids.find(shape->title); + const auto it = m_key_ids.find(shape->title); if(it != m_key_ids.end()) m_keyed_shapes[it->second].push_back(shape); else { - int id = m_key_count; - m_key_count++; + const int id = m_key_count++; m_keyed_shapes.resize(m_key_count); m_keyed_shapes[id].push_back(shape); m_key_ids[shape->title] = id; diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp index 4f838634c9d..b984da8b1ab 100644 --- a/src/mame/machine/3dom2.cpp +++ b/src/mame/machine/3dom2.cpp @@ -8,9 +8,8 @@ #include "emu.h" #include "3dom2.h" -#include <algorithm> // std::min -#include "screen.h" +#include <algorithm> // std::min //************************************************************************** diff --git a/src/mame/machine/3dom2.h b/src/mame/machine/3dom2.h index ed6eabd425b..427dad3073e 100644 --- a/src/mame/machine/3dom2.h +++ b/src/mame/machine/3dom2.h @@ -8,17 +8,19 @@ ***************************************************************************/ -#pragma once - #ifndef MAME_MACHINE_3DOM2_H #define MAME_MACHINE_3DOM2_H -#include "emu.h" +#pragma once + +#include "video/3dom2_te.h" + #include "cpu/dspp/dspp.h" #include "cpu/powerpc/ppc.h" -#include "video/3dom2_te.h" + #include "screen.h" + #define M2_BAD_TIMING 0 // HACK /*************************************************************************** diff --git a/src/mame/video/3dom2_te.h b/src/mame/video/3dom2_te.h index a8b100ff8cb..43012513b91 100644 --- a/src/mame/video/3dom2_te.h +++ b/src/mame/video/3dom2_te.h @@ -190,7 +190,6 @@ private: void load_texture(); m2_bda_device *m_bda; - const address_space_config m_space_config; // TODO: Why is this still here? devcb_write_line m_general_int_handler; devcb_write_line m_dfinstr_int_handler; |