diff options
author | Vas Crabb <vas@vastheman.com> | 2018-07-22 20:41:57 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-07-22 20:41:57 +1000 |
commit | c0ab1c5aa4c172aa9e3e0deec5c2cc19d4f278d1 (patch) | |
tree | 359e7b0d6560d05a1872c2e18773a6e2e5038b7f /src/frontend/mame/ui | |
parent | 6d39a913e54c73640e4b5e7493b223c87a14c64a (diff) |
(nw) srcclean and some cleanup:
* Make more #include guards follow standard format - using MAME_ as the prefix makes it easy to see which ones come from our code in a preprocessor dump, and having both src/devices/machine/foo.h and src/mame/machine/foo.h causes issues anyway
* Get #include "emu.h" out of headers - it should only be the first thing in a complilation unit or we get differences in behaviour with PCH on/off
* Add out-of-line destructors to some devices - it forces the compiler to instantiate the vtable in a certain location and avoids some non-deterministic compiler behaviours
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r-- | src/frontend/mame/ui/icorender.h | 8 | ||||
-rw-r--r-- | src/frontend/mame/ui/slider.h | 26 | ||||
-rw-r--r-- | src/frontend/mame/ui/sliderchangednotifier.h | 12 | ||||
-rw-r--r-- | src/frontend/mame/ui/viewgfx.h | 8 |
4 files changed, 26 insertions, 28 deletions
diff --git a/src/frontend/mame/ui/icorender.h b/src/frontend/mame/ui/icorender.h index 864969b616d..17bc5a1d8ea 100644 --- a/src/frontend/mame/ui/icorender.h +++ b/src/frontend/mame/ui/icorender.h @@ -10,10 +10,10 @@ http://vitiy.info/Code/ico.cpp ***************************************************************************/ -#pragma once +#ifndef MAME_FRONTEND_MAME_UI_ICORENDER_H +#define MAME_FRONTEND_MAME_UI_ICORENDER_H -#ifndef __UI_ICORENDER_H__ -#define __UI_ICORENDER_H__ +#pragma once // These next two structs represent how the icon information is stored // in an ICO file. @@ -230,4 +230,4 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d global_free_array(buffer); } -#endif /* __UI_ICORENDER_H__ */ +#endif // MAME_FRONTEND_MAME_UI_ICORENDER_H diff --git a/src/frontend/mame/ui/slider.h b/src/frontend/mame/ui/slider.h index 7c8a1000961..7785518d093 100644 --- a/src/frontend/mame/ui/slider.h +++ b/src/frontend/mame/ui/slider.h @@ -9,29 +9,29 @@ ***************************************************************************/ +#ifndef MAME_FRONTEND_MAME_UI_SLIDER_H +#define MAME_FRONTEND_MAME_UI_SLIDER_H + #pragma once -#ifndef __UI_SLIDER__ -#define __UI_SLIDER__ +#include "sliderchangednotifier.h" #include <functional> -#include "sliderchangednotifier.h" - #define SLIDER_NOCHANGE 0x12345678 -typedef std::function<int32_t(running_machine&, void*, int, std::string*, int32_t)> slider_update; +typedef std::function<std::int32_t (running_machine &, void *, int, std::string *, std::int32_t)> slider_update; struct slider_state { - slider_update update; /* callback */ - void * arg; /* argument */ - int32_t minval; /* minimum value */ - int32_t defval; /* default value */ - int32_t maxval; /* maximum value */ - int32_t incval; /* increment value */ + slider_update update; // callback + void * arg; // argument + std::int32_t minval; // minimum value + std::int32_t defval; // default value + std::int32_t maxval; // maximum value + std::int32_t incval; // increment value int id; - std::string description; /* textual description */ + std::string description; // textual description }; -#endif // __UI_SLIDER__ +#endif // MAME_FRONTEND_MAME_UI_SLIDER_H diff --git a/src/frontend/mame/ui/sliderchangednotifier.h b/src/frontend/mame/ui/sliderchangednotifier.h index 60bcf9c79fe..eedb39684f3 100644 --- a/src/frontend/mame/ui/sliderchangednotifier.h +++ b/src/frontend/mame/ui/sliderchangednotifier.h @@ -6,16 +6,14 @@ // //====================================================================== -#pragma once +#ifndef MAME_FRONTEND_MAME_UI_SLIDERCHANGEDNOTIFIER_H +#define MAME_FRONTEND_MAME_UI_SLIDERCHANGEDNOTIFIER_H -#ifndef __SLIDER_CHANGED_NOTIFIER__ -#define __SLIDER_CHANGED_NOTIFIER__ +#pragma once #include <cstdint> #include <string> -using int32_t = std::int32_t; - class running_machine; class slider_changed_notifier @@ -23,7 +21,7 @@ class slider_changed_notifier public: virtual ~slider_changed_notifier() { } - virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) = 0; + virtual std::int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, std::int32_t newval) = 0; }; -#endif // __SLIDER_CHANGED_NOTIFIER__ +#endif // MAME_FRONTEND_MAME_UI_SLIDERCHANGEDNOTIFIER_H diff --git a/src/frontend/mame/ui/viewgfx.h b/src/frontend/mame/ui/viewgfx.h index 5043ded0a27..a4d2205d7a8 100644 --- a/src/frontend/mame/ui/viewgfx.h +++ b/src/frontend/mame/ui/viewgfx.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_FRONTEND_MAME_UI_VIEWGFX_H +#define MAME_FRONTEND_MAME_UI_VIEWGFX_H -#ifndef __UI_VIEWGFX_H__ -#define __UI_VIEWGFX_H__ +#pragma once @@ -29,4 +29,4 @@ bool ui_gfx_is_relevant(running_machine &machine); uint32_t ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate); -#endif /* __UI_VIEWGFX_H__ */ +#endif // MAME_FRONTEND_MAME_UI_VIEWGFX_H |