(nw) be strictly POSIX compliant, reduce fragmentation, get rid of an unused member

This commit is contained in:
Vas Crabb 2019-11-05 19:28:28 +11:00
parent 76a2e99d6b
commit 2012b38e1e
6 changed files with 30 additions and 30 deletions

View File

@ -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

View File

@ -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 &params) override;
};
#endif // DEVICES_CPU_DSPP_DSPPDASM_H
#endif // MAME_CPU_DSPP_DSPPDASM_H

View File

@ -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;

View File

@ -8,9 +8,8 @@
#include "emu.h"
#include "3dom2.h"
#include <algorithm> // std::min
#include "screen.h"
#include <algorithm> // std::min
//**************************************************************************

View File

@ -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
/***************************************************************************

View File

@ -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;