diff options
Diffstat (limited to 'src/lib/util')
| -rw-r--r-- | src/lib/util/chd.h | 2 | ||||
| -rw-r--r-- | src/lib/util/corealloc.c | 10 | ||||
| -rw-r--r-- | src/lib/util/cstrpool.c | 12 | ||||
| -rw-r--r-- | src/lib/util/cstrpool.h | 16 | ||||
| -rw-r--r-- | src/lib/util/options.h | 2 | ||||
| -rw-r--r-- | src/lib/util/palette.c | 64 | ||||
| -rw-r--r-- | src/lib/util/palette.h | 28 | ||||
| -rw-r--r-- | src/lib/util/tagmap.c | 2 | ||||
| -rw-r--r-- | src/lib/util/tagmap.h | 4 |
9 files changed, 70 insertions, 70 deletions
diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h index 872c63d46f8..cc0f493cc0b 100644 --- a/src/lib/util/chd.h +++ b/src/lib/util/chd.h @@ -526,7 +526,7 @@ private: , m_compression(0) , m_codecs(NULL) { } - + osd_work_item * m_osd; // OSD work item running on this block chd_file_compressor *m_compressor; // pointer back to the compressor volatile work_status m_status; // current status of this item diff --git a/src/lib/util/corealloc.c b/src/lib/util/corealloc.c index 69535d8d495..c8a23b73f27 100644 --- a/src/lib/util/corealloc.c +++ b/src/lib/util/corealloc.c @@ -46,7 +46,7 @@ public: const char * m_file; // file the allocation was made from int m_line; // line number within that file UINT64 m_id; // unique id - bool m_array; // array? + bool m_array; // array? // hashing prime number static const int k_hash_prime = 6151; @@ -115,7 +115,7 @@ void *malloc_file_line(size_t size, const char *file, int line, bool array, bool if (clear) memset(result, 0, size); else - { + { #if !__has_feature(memory_sanitizer) && defined(INITIALIZE_ALLOCATED_MEMORY) memset(result, 0xdd, size); #endif @@ -145,7 +145,7 @@ void free_file_line(void *memory, const char *file, int line, bool array) osd_break_into_debugger("Error: attempt to free untracked memory"); return; } - + // warn about mismatched arrays if (!array && entry->m_array) { @@ -182,8 +182,8 @@ void track_memory(bool track) //------------------------------------------------- -// next_memory_id - return the ID of the next -// allocated block +// next_memory_id - return the ID of the next +// allocated block //------------------------------------------------- UINT64 next_memory_id() diff --git a/src/lib/util/cstrpool.c b/src/lib/util/cstrpool.c index 17b43b325a6..874e5192ea0 100644 --- a/src/lib/util/cstrpool.c +++ b/src/lib/util/cstrpool.c @@ -39,7 +39,7 @@ const char *const_string_pool::add(const char *string) if (result != NULL) return result; } - + // no space anywhere, create a new pool and prepend it (so it gets used first) const char *result = m_chunklist.prepend(*global_alloc(pool_chunk)).add(string); assert(result != NULL); @@ -48,7 +48,7 @@ const char *const_string_pool::add(const char *string) //------------------------------------------------- -// contains - determine if the given string +// contains - determine if the given string // pointer lives in the pool //------------------------------------------------- @@ -62,7 +62,7 @@ bool const_string_pool::contains(const char *string) for (pool_chunk *chunk = m_chunklist.first(); chunk != NULL; chunk = chunk->next()) if (chunk->contains(string)) return true; - + return false; } @@ -72,8 +72,8 @@ bool const_string_pool::contains(const char *string) //------------------------------------------------- const_string_pool::pool_chunk::pool_chunk() - : m_next(NULL), - m_used(0) + : m_next(NULL), + m_used(0) { } @@ -87,7 +87,7 @@ const char *const_string_pool::pool_chunk::add(const char *string) // get the length of the string (no string can be longer than a full pool) int bytes = strlen(string) + 1; assert(bytes < POOL_SIZE); - + // if too big, return NULL if (m_used + bytes > POOL_SIZE) return NULL; diff --git a/src/lib/util/cstrpool.h b/src/lib/util/cstrpool.h index c4b4805362d..6058cc43ffb 100644 --- a/src/lib/util/cstrpool.h +++ b/src/lib/util/cstrpool.h @@ -26,23 +26,23 @@ class const_string_pool public: // construction const_string_pool(); - + // operations void reset() { m_chunklist.reset(); } const char *add(const char *string); bool contains(const char *string); - + private: // shared string pool class pool_chunk { static const int POOL_SIZE = 4096; friend class simple_list<pool_chunk>; - + public: // construction pool_chunk(); - + // getters pool_chunk *next() const { return m_next; } @@ -52,11 +52,11 @@ private: private: // internal state - pool_chunk * m_next; - UINT32 m_used; - char m_buffer[POOL_SIZE]; + pool_chunk * m_next; + UINT32 m_used; + char m_buffer[POOL_SIZE]; }; - simple_list<pool_chunk> m_chunklist; + simple_list<pool_chunk> m_chunklist; }; diff --git a/src/lib/util/options.h b/src/lib/util/options.h index f90e56a0a23..573822b73b6 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -175,7 +175,7 @@ private: bool validate_and_set_data(entry &curentry, const char *newdata, int priority, astring &error_string); // internal state - simple_list<entry> m_entrylist; // head of list of entries + simple_list<entry> m_entrylist; // head of list of entries tagmap_t<entry *> m_entrymap; // map for fast lookup astring m_command; // command found static const char *const s_option_unadorned[]; // array of unadorned option "names" diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c index a516b3e4a32..6b3847f61da 100644 --- a/src/lib/util/palette.c +++ b/src/lib/util/palette.c @@ -47,14 +47,14 @@ inline rgb_t palette_t::adjust_palette_entry(rgb_t entry, float brightness, floa palette_client::dirty_state::dirty_state() : m_mindirty(0), - m_maxdirty(0) + m_maxdirty(0) { } //------------------------------------------------- // dirty_list - return the current list and -// min/max values +// min/max values //------------------------------------------------- const UINT32 *palette_client::dirty_state::dirty_list(UINT32 &mindirty, UINT32 &maxdirty) @@ -70,7 +70,7 @@ const UINT32 *palette_client::dirty_state::dirty_list(UINT32 &mindirty, UINT32 & //------------------------------------------------- // resize - resize the dirty array and mark all -// dirty +// dirty //------------------------------------------------- void palette_client::dirty_state::resize(UINT32 colors) @@ -82,7 +82,7 @@ void palette_client::dirty_state::resize(UINT32 colors) // mark all entries dirty m_dirty[dirty_dwords - 1] &= (1 << (colors % 32)) - 1; - // set min/max + // set min/max m_mindirty = 0; m_maxdirty = colors - 1; } @@ -102,7 +102,7 @@ void palette_client::dirty_state::mark_dirty(UINT32 index) //------------------------------------------------- // reset - clear the dirty array to mark all -// entries as clean +// entries as clean //------------------------------------------------- void palette_client::dirty_state::reset() @@ -125,9 +125,9 @@ void palette_client::dirty_state::reset() palette_client::palette_client(palette_t &palette) : m_palette(palette), - m_next(NULL), - m_live(&m_dirty[0]), - m_previous(&m_dirty[1]) + m_next(NULL), + m_live(&m_dirty[0]), + m_previous(&m_dirty[1]) { // add a reference to the palette palette.ref(); @@ -163,7 +163,7 @@ palette_client::~palette_client() //------------------------------------------------- -// dirty_list - atomically get the current dirty +// dirty_list - atomically get the current dirty // list for a client //------------------------------------------------- @@ -206,18 +206,18 @@ palette_t *palette_t::alloc(UINT32 numcolors, UINT32 numgroups) palette_t::palette_t(UINT32 numcolors, UINT32 numgroups) : m_refcount(1), - m_numcolors(numcolors), - m_numgroups(numgroups), - m_brightness(0.0f), - m_contrast(1.0f), - m_gamma(1.0f), - m_entry_color(numcolors), - m_entry_contrast(numcolors), - m_adjusted_color(numcolors * numgroups + 2), - m_adjusted_rgb15(numcolors * numgroups + 2), - m_group_bright(numgroups), - m_group_contrast(numgroups), - m_client_list(NULL) + m_numcolors(numcolors), + m_numgroups(numgroups), + m_brightness(0.0f), + m_contrast(1.0f), + m_gamma(1.0f), + m_entry_color(numcolors), + m_entry_contrast(numcolors), + m_adjusted_color(numcolors * numgroups + 2), + m_adjusted_rgb15(numcolors * numgroups + 2), + m_group_bright(numgroups), + m_group_contrast(numgroups), + m_client_list(NULL) { // initialize gamma map for (UINT32 index = 0; index < 256; index++) @@ -273,7 +273,7 @@ void palette_t::deref() //------------------------------------------------- -// set_brightness - set the overall brightness +// set_brightness - set the overall brightness // for the palette //------------------------------------------------- @@ -295,7 +295,7 @@ void palette_t::set_brightness(float brightness) //------------------------------------------------- -// set_contrast - set the overall contrast for +// set_contrast - set the overall contrast for // the palette //------------------------------------------------- @@ -314,7 +314,7 @@ void palette_t::set_contrast(float contrast) //------------------------------------------------- -// set_gamma - set the overall gamma for the +// set_gamma - set the overall gamma for the // palette //------------------------------------------------- @@ -342,7 +342,7 @@ void palette_t::set_gamma(float gamma) //------------------------------------------------- -// entry_set_color - set the raw RGB color for a +// entry_set_color - set the raw RGB color for a // given palette index //------------------------------------------------- @@ -362,7 +362,7 @@ void palette_t::entry_set_color(UINT32 index, rgb_t rgb) //------------------------------------------------- -// entry_set_contrast - set the contrast +// entry_set_contrast - set the contrast // adjustment for a single palette index //------------------------------------------------- @@ -382,7 +382,7 @@ void palette_t::entry_set_contrast(UINT32 index, float contrast) //------------------------------------------------- -// group_set_brightness - configure overall +// group_set_brightness - configure overall // brightness for a palette group //------------------------------------------------- @@ -405,7 +405,7 @@ void palette_t::group_set_brightness(UINT32 group, float brightness) //------------------------------------------------- -// group_set_contrast - configure overall +// group_set_contrast - configure overall // contrast for a palette group //------------------------------------------------- @@ -425,7 +425,7 @@ void palette_t::group_set_contrast(UINT32 group, float contrast) //------------------------------------------------- -// normalize_range - normalize a range of palette +// normalize_range - normalize a range of palette // entries //------------------------------------------------- @@ -474,9 +474,9 @@ void palette_t::update_adjusted_color(UINT32 group, UINT32 index) { // compute the adjusted value rgb_t adjusted = adjust_palette_entry(m_entry_color[index], - m_group_bright[group] + m_brightness, - m_group_contrast[group] * m_entry_contrast[index] * m_contrast, - m_gamma_map); + m_group_bright[group] + m_brightness, + m_group_contrast[group] * m_entry_contrast[index] * m_contrast, + m_gamma_map); // if not different, ignore UINT32 finalindex = group * m_numcolors + index; diff --git a/src/lib/util/palette.h b/src/lib/util/palette.h index 120da95f87a..30d5ba528e0 100644 --- a/src/lib/util/palette.h +++ b/src/lib/util/palette.h @@ -39,7 +39,7 @@ public: rgb_t(UINT32 data) { m_data = data; } rgb_t(UINT8 r, UINT8 g, UINT8 b) { m_data = (255 << 24) | (r << 16) | (g << 8) | b; } rgb_t(UINT8 a, UINT8 r, UINT8 g, UINT8 b) { m_data = (a << 24) | (r << 16) | (g << 8) | b; } - + // getters UINT8 a() const { return m_data >> 24; } UINT8 r() const { return m_data >> 16; } @@ -53,7 +53,7 @@ public: rgb_t &set_r(UINT8 r) { m_data &= ~0x00ff0000; m_data |= r << 16; return *this; } rgb_t &set_g(UINT8 g) { m_data &= ~0x0000ff00; m_data |= g << 8; return *this; } rgb_t &set_b(UINT8 b) { m_data &= ~0x000000ff; m_data |= b << 0; return *this; } - + // implicit conversion operators operator UINT32() const { return m_data; } @@ -64,11 +64,11 @@ public: rgb_t &operator=(UINT32 rhs) { m_data = rhs; return *this; } rgb_t &operator+=(const rgb_t &rhs) { m_data = rgb_t(clamphi(a() + rhs.a()), clamphi(r() + rhs.r()), clamphi(g() + rhs.g()), clamphi(b() + rhs.b())); return *this; } rgb_t &operator-=(const rgb_t &rhs) { m_data = rgb_t(clamplo(a() - rhs.a()), clamplo(r() - rhs.r()), clamplo(g() - rhs.g()), clamplo(b() - rhs.b())); return *this; } - + // arithmetic operators const rgb_t operator+(const rgb_t &rhs) const { rgb_t result = *this; result += rhs; return result; } const rgb_t operator-(const rgb_t &rhs) const { rgb_t result = *this; result -= rhs; return result; } - + // static helpers static UINT8 clamp(INT32 value) { return (value < 0) ? 0 : (value > 255) ? 255 : value; } static UINT8 clamphi(INT32 value) { return (value > 255) ? 255 : value; } @@ -79,7 +79,7 @@ public: static const rgb_t white; private: - UINT32 m_data; + UINT32 m_data; }; @@ -108,7 +108,7 @@ private: public: // construction dirty_state(); - + // operations const UINT32 *dirty_list(UINT32 &mindirty, UINT32 &maxdirty); void resize(UINT32 colors); @@ -127,7 +127,7 @@ private: palette_client *m_next; // pointer to next client dirty_state * m_live; // live dirty state dirty_state * m_previous; // previous dirty state - dirty_state m_dirty[2]; // two dirty states + dirty_state m_dirty[2]; // two dirty states }; @@ -141,7 +141,7 @@ class palette_t public: // static constructor: used to ensure same new/delete is used static palette_t *alloc(UINT32 numcolors, UINT32 numgroups = 1); - + // reference counting void ref() { m_refcount++; } void deref(); @@ -152,12 +152,12 @@ public: int max_index() const { return m_numcolors * m_numgroups + 2; } UINT32 black_entry() const { return m_numcolors * m_numgroups + 0; } UINT32 white_entry() const { return m_numcolors * m_numgroups + 1; } - + // overall adjustments void set_brightness(float brightness); void set_contrast(float contrast); void set_gamma(float gamma); - + // entry getters rgb_t entry_color(UINT32 index) const { return (index < m_numcolors) ? m_entry_color[index] : rgb_t::black; } rgb_t entry_adjusted_color(UINT32 index) const { return (index < m_numcolors * m_numgroups) ? m_adjusted_color[index] : rgb_t::black; } @@ -166,19 +166,19 @@ public: // entry setters void entry_set_color(UINT32 index, rgb_t rgb); void entry_set_contrast(UINT32 index, float contrast); - + // entry list getters const rgb_t *entry_list_raw() const { return m_entry_color; } const rgb_t *entry_list_adjusted() const { return m_adjusted_color; } const rgb_t *entry_list_adjusted_rgb15() const { return m_adjusted_rgb15; } - + // group adjustments void group_set_brightness(UINT32 group, float brightness); void group_set_contrast(UINT32 group, float contrast); - + // utilities void normalize_range(UINT32 start, UINT32 end, int lum_min = 0, int lum_max = 255); - + private: // construction/destruction palette_t(UINT32 numcolors, UINT32 numgroups = 1); diff --git a/src/lib/util/tagmap.c b/src/lib/util/tagmap.c index 5a447a49487..80218317993 100644 --- a/src/lib/util/tagmap.c +++ b/src/lib/util/tagmap.c @@ -12,4 +12,4 @@ #ifdef MAME_DEBUG INT32 g_tagmap_finds = 0; -#endif
\ No newline at end of file +#endif diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h index d35922a49b0..e31b6671108 100644 --- a/src/lib/util/tagmap.h +++ b/src/lib/util/tagmap.h @@ -203,7 +203,7 @@ class tagged_list tagged_list &operator=(const tagged_list &); public: - class add_exception + class add_exception { public: add_exception(const char *tag) : m_tag(tag) { } @@ -211,7 +211,7 @@ public: private: const char *m_tag; }; - + // construction tagged_list() { } |
