diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2018-02-24 15:32:06 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2018-02-24 18:20:46 +0100 |
commit | 1c0172cca4f1e90679321912e20436a7f42f122d (patch) | |
tree | 77a544d2c09332ec176f42ebcf58a40d9c5d2b93 /utils/mir_buffer.h | |
parent | dff565f40105b20b0e8e4dba1f48ccc9b8e7ff44 (diff) |
more nullptr
Diffstat (limited to 'utils/mir_buffer.h')
-rw-r--r-- | utils/mir_buffer.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/utils/mir_buffer.h b/utils/mir_buffer.h index f8cfd41fa4..fae75e2d08 100644 --- a/utils/mir_buffer.h +++ b/utils/mir_buffer.h @@ -85,7 +85,7 @@ inline void __bcopy(WCHAR *dest, const char *orig, size_t len) inline void __bcopy(char *dest, const WCHAR *orig, size_t len) { - WideCharToMultiByte(CallService("LangPack/GetCodePage", 0, 0), 0, orig, (int)len, dest, (int)len, NULL, NULL); + WideCharToMultiByte(CallService("LangPack/GetCodePage", 0, 0), 0, orig, (int)len, dest, (int)len, nullptr, nullptr); } @@ -97,13 +97,13 @@ class Buffer size_t len; T *str; - Buffer() : str(NULL), size(0), len(0) + Buffer() : str(nullptr), size(0), len(0) { alloc(1); pack(); } - Buffer(T in) : str(NULL), size(0), len(0) + Buffer(T in) : str(nullptr), size(0), len(0) { if (in == NULL) { @@ -124,7 +124,7 @@ class Buffer void pack() { - if (str != NULL) + if (str != nullptr) memset(&str[len], 0, sizeof(str[len])); } @@ -133,7 +133,7 @@ class Buffer if (total > size) { size = total + 256 - total % 256; - if (str == NULL) + if (str == nullptr) str = (T *) mir_alloc(size * sizeof(T)); else str = (T *) mir_realloc(str, size * sizeof(T)); @@ -142,10 +142,10 @@ class Buffer void free() { - if (str != NULL) + if (str != nullptr) { mir_free(str); - str = NULL; + str = nullptr; len = size = 0; } } @@ -179,7 +179,7 @@ class Buffer void append(const char *app, size_t appLen = -1) { - if (app == NULL) + if (app == nullptr) return; if (appLen == -1) appLen = __blen(app); @@ -194,7 +194,7 @@ class Buffer void append(const WCHAR *app, size_t appLen = -1) { - if (app == NULL) + if (app == nullptr) return; if (appLen == -1) appLen = __blen(app); @@ -209,7 +209,7 @@ class Buffer void append(const Buffer<char> &app) { - if (app.str == NULL) + if (app.str == nullptr) return; size_t appLen = app.len; @@ -304,7 +304,7 @@ class Buffer void translate() { - if (str == NULL || len == 0) + if (str == nullptr || len == 0) return; str[len] = 0; @@ -347,14 +347,14 @@ class Buffer T *detach() { T *ret = str; - str = NULL; + str = nullptr; len = 0; return ret; } void trimRight() { - if (str == NULL) + if (str == nullptr) return; int e; @@ -368,7 +368,7 @@ class Buffer void trimLeft() { - if (str == NULL) + if (str == nullptr) return; int s; |