summaryrefslogtreecommitdiff
path: root/src/strings_func.h
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/strings_func.h
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/strings_func.h')
-rw-r--r--src/strings_func.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/strings_func.h b/src/strings_func.h
index 0da711bc4..a5e2e1ca2 100644
--- a/src/strings_func.h
+++ b/src/strings_func.h
@@ -60,9 +60,9 @@ static inline StringID MakeStringID(StringTab tab, uint index)
}
class StringParameters {
- StringParameters *parent; ///< If not NULL, this instance references data from this parent instance.
+ StringParameters *parent; ///< If not nullptr, this instance references data from this parent instance.
uint64 *data; ///< Array with the actual data.
- WChar *type; ///< Array with type information about the data. Can be NULL when no type information is needed. See #StringControlCode.
+ WChar *type; ///< Array with type information about the data. Can be nullptr when no type information is needed. See #StringControlCode.
public:
uint offset; ///< Current offset in the data/type arrays.
@@ -70,7 +70,7 @@ public:
/** Create a new StringParameters instance. */
StringParameters(uint64 *data, uint num_param, WChar *type) :
- parent(NULL),
+ parent(nullptr),
data(data),
type(type),
offset(0),
@@ -80,9 +80,9 @@ public:
/** Create a new StringParameters instance. */
template <size_t Tnum_param>
StringParameters(int64 (&data)[Tnum_param]) :
- parent(NULL),
+ parent(nullptr),
data((uint64 *)data),
- type(NULL),
+ type(nullptr),
offset(0),
num_param(Tnum_param)
{
@@ -100,8 +100,8 @@ public:
num_param(size)
{
assert(size <= parent.GetDataLeft());
- if (parent.type == NULL) {
- this->type = NULL;
+ if (parent.type == nullptr) {
+ this->type = nullptr;
} else {
this->type = parent.type + parent.offset;
}
@@ -109,7 +109,7 @@ public:
~StringParameters()
{
- if (this->parent != NULL) {
+ if (this->parent != nullptr) {
this->parent->offset += this->num_param;
}
}
@@ -148,7 +148,7 @@ public:
/** Does this instance store information about the type of the parameters. */
bool HasTypeInformation() const
{
- return this->type != NULL;
+ return this->type != nullptr;
}
/** Get the type of a specific element. */
@@ -250,7 +250,7 @@ public:
/**
* Get the next string to search through.
- * @return The next string or NULL if there is none.
+ * @return The next string or nullptr if there is none.
*/
virtual const char *NextString() = 0;
@@ -281,6 +281,6 @@ public:
bool FindMissingGlyphs(const char **str);
};
-void CheckForMissingGlyphs(bool base_font = true, MissingGlyphSearcher *search = NULL);
+void CheckForMissingGlyphs(bool base_font = true, MissingGlyphSearcher *search = nullptr);
#endif /* STRINGS_FUNC_H */