diff options
author | 2015-12-13 11:23:55 +0100 | |
---|---|---|
committer | 2015-12-13 11:23:55 +0100 | |
commit | 4e580a77b9da9b78aba1fec8e44b1de5a4a14aaf (patch) | |
tree | df0e1d28daa79b9151088498a933cd1fc37c9c07 /src/lib/util/cstrpool.cpp | |
parent | 1cda42b22e591965ee69561fcf52272bd991b3b2 (diff) | |
parent | 14d5966a379e9783ba724750a5f84a72af62cadc (diff) |
Merge pull request #9 from mamedev/master
Sync to base master
Diffstat (limited to 'src/lib/util/cstrpool.cpp')
-rw-r--r-- | src/lib/util/cstrpool.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/util/cstrpool.cpp b/src/lib/util/cstrpool.cpp index dfb41e25232..242c33380de 100644 --- a/src/lib/util/cstrpool.cpp +++ b/src/lib/util/cstrpool.cpp @@ -37,16 +37,16 @@ const char *const_string_pool::add(const char *string) return string; // scan to find space - for (pool_chunk *chunk = m_chunklist.first(); chunk != NULL; chunk = chunk->next()) + for (pool_chunk *chunk = m_chunklist.first(); chunk != nullptr; chunk = chunk->next()) { const char *result = chunk->add(string); - if (result != NULL) + if (result != nullptr) 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); + assert(result != nullptr); return result; } @@ -63,7 +63,7 @@ bool const_string_pool::contains(const char *string) return true; // scan to find it - for (pool_chunk *chunk = m_chunklist.first(); chunk != NULL; chunk = chunk->next()) + for (pool_chunk *chunk = m_chunklist.first(); chunk != nullptr; chunk = chunk->next()) if (chunk->contains(string)) return true; @@ -79,7 +79,7 @@ bool const_string_pool::contains(const char *string) */ const_string_pool::pool_chunk::pool_chunk() - : m_next(NULL), + : m_next(nullptr), m_used(0) { } @@ -104,7 +104,7 @@ const char *const_string_pool::pool_chunk::add(const char *string) // if too big, return NULL if (m_used + bytes > POOL_SIZE) - return NULL; + return nullptr; // allocate, copy, and return the memory char *dest = &m_buffer[m_used]; |