diff options
author | nyamatongwe <devnull@localhost> | 2001-12-19 09:48:05 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2001-12-19 09:48:05 +0000 |
commit | 9137cb464e09bbd57e0d3b2df9292917e29c85e6 (patch) | |
tree | 70be0aa9007b4cdb320426a833df5235c33a690f | |
parent | dd4b7a472a152477c0a2e70d8fda2126570e7324 (diff) | |
download | scintilla-mirror-9137cb464e09bbd57e0d3b2df9292917e29c85e6.tar.gz |
Fixed some old icorrect uses of 0 rather than measure_length.
-rw-r--r-- | include/SString.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/SString.h b/include/SString.h index 7eac12c0c..bcf0ff170 100644 --- a/include/SString.h +++ b/include/SString.h @@ -87,27 +87,27 @@ public: sSize = 0; sLen = 0; } - void clear(void) { + void clear() { if (s) { *s = '\0'; } sLen = 0; } /** Size of buffer. */ - lenpos_t size(void) const { + lenpos_t size() const { if (s) return sSize; else return 0; } /** Size of string in buffer. */ - int length() const { + lenpos_t length() const { return sLen; } SString &assign(const char *sOther, lenpos_t sSize_=measure_length) { if (!sOther) { sSize_ = 0; - } else if (sSize_ == 0) { + } else if (sSize_ == measure_length) { sSize_ = strlen(sOther); } if (sSize > 0 && sSize_ <= sSize) { // Does not allocate new buffer if the current is big enough @@ -193,7 +193,7 @@ public: if (!sOther) { return *this; } - if (sLenOther == 0) { + if (sLenOther == measure_length) { sLenOther = strlen(sOther); } int lenSep = 0; @@ -229,7 +229,7 @@ public: if (!sOther) { return *this; } - if (sLenOther == 0) { + if (sLenOther == measure_length) { sLenOther = strlen(sOther); } lenpos_t lenNew = sLen + sLenOther; @@ -266,7 +266,7 @@ public: else return 0; } - int search(const char *sFind, lenpos_t start = 0) { + int search(const char *sFind, lenpos_t start=0) { if (start < sLen) { const char *sFound = strstr(s + start, sFind); if (sFound) { @@ -320,7 +320,7 @@ public: if (s == 0) { return 0; } - if (len == 0) { + if (len == measure_length) { len = strlen(s); } char *sNew = new char[len + 1]; |