hrev50865 adds 1 changeset to branch 'master'
old head: 0c5219a1d652da43fd9be235394f2e49f85b0923
new head: bdd02e0d9d4ff4be6c80aeb799a93692467381dc
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=bdd02e0d9d4f+%5E0c5219a1d652
----------------------------------------------------------------------------
bdd02e0d9d4f: BString: rename SetCharAt to SetByteAt
Makes it clear that it operates on bytes, not unicode codepoints.
Thanks to mmlr for remembering me of this subtlety.
[ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev50865
Commit: bdd02e0d9d4ff4be6c80aeb799a93692467381dc
URL: http://cgit.haiku-os.org/haiku/commit/?id=bdd02e0d9d4f
Author: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date: Thu Jan 12 21:03:51 2017 UTC
----------------------------------------------------------------------------
7 files changed, 12 insertions(+), 12 deletions(-)
headers/os/support/String.h | 2 +-
src/apps/deskcalc/ExpressionTextView.cpp | 8 ++++----
src/apps/webpositive/BrowserWindow.cpp | 2 +-
src/kits/mail/HaikuMailFormatFilter.cpp | 2 +-
src/kits/support/String.cpp | 2 +-
src/preferences/mail/DNSQuery.cpp | 6 +++---
src/tests/kits/support/bstring/StringCharAccessTest.cpp | 2 +-
----------------------------------------------------------------------------
diff --git a/headers/os/support/String.h b/headers/os/support/String.h
index 2930b2c..4d45a86 100644
--- a/headers/os/support/String.h
+++ b/headers/os/support/String.h
@@ -309,7 +309,7 @@ public:
// Fast low-level manipulation
char* LockBuffer(int32 maxLength);
BString& UnlockBuffer(int32 length = -1);
- BString& SetCharAt(int32 pos, char to);
+ BString& SetByteAt(int32 pos, char to);
// Upercase <-> Lowercase
BString& ToLower();
diff --git a/src/apps/deskcalc/ExpressionTextView.cpp
b/src/apps/deskcalc/ExpressionTextView.cpp
index 6e527aa..f3fa9f7 100644
--- a/src/apps/deskcalc/ExpressionTextView.cpp
+++ b/src/apps/deskcalc/ExpressionTextView.cpp
@@ -288,13 +288,13 @@ ExpressionTextView::SetValue(BString value)
if (digit != 10)
break;
- value.SetCharAt(offset, '0');
+ value.SetByteAt(offset, '0');
}
if (digit == 10) {
// carry over, shift the result
if (value[firstDigit + 1] == '.') {
- value.SetCharAt(firstDigit + 1, '0');
- value.SetCharAt(firstDigit, '.');
+ value.SetByteAt(firstDigit + 1, '0');
+ value.SetByteAt(firstDigit, '.');
}
value.Insert('1', 1, firstDigit);
@@ -311,7 +311,7 @@ ExpressionTextView::SetValue(BString value)
value << 'E' << exponent;
} else {
// increase the current digit value with one
- value.SetCharAt(offset, char(digit + 48));
+ value.SetByteAt(offset, char(digit + 48));
// set offset to last digit
offset = value.FindFirst('E');
diff --git a/src/apps/webpositive/BrowserWindow.cpp
b/src/apps/webpositive/BrowserWindow.cpp
index 18e0519..49eb6f6 100644
--- a/src/apps/webpositive/BrowserWindow.cpp
+++ b/src/apps/webpositive/BrowserWindow.cpp
@@ -2435,7 +2435,7 @@ BrowserWindow::_EncodeURIComponent(const BString& search)
for (int32 i = 0; i < result.Length(); i++) {
if (escCharList.FindFirst(result[i]) != B_ERROR) {
sprintf(hexcode, "%02X", (unsigned int)result[i]);
- result.SetCharAt(i, '%');
+ result.SetByteAt(i, '%');
result.Insert(hexcode, i + 1);
i += 2;
}
diff --git a/src/kits/mail/HaikuMailFormatFilter.cpp
b/src/kits/mail/HaikuMailFormatFilter.cpp
index 1cdaeab..b168938 100644
--- a/src/kits/mail/HaikuMailFormatFilter.cpp
+++ b/src/kits/mail/HaikuMailFormatFilter.cpp
@@ -247,7 +247,7 @@ HaikuMailFormatFilter::_RemoveExtraWhitespace(BString& name)
if (i == remove + 1 || i == name.Length())
remove++;
else
- name.SetCharAt(i - spaces, ' ');
+ name.SetByteAt(i - spaces, ' ');
name.Remove(i - remove, remove);
i -= remove;
spaces = 0;
diff --git a/src/kits/support/String.cpp b/src/kits/support/String.cpp
index 70a8b37..12c09f8 100644
--- a/src/kits/support/String.cpp
+++ b/src/kits/support/String.cpp
@@ -1904,7 +1904,7 @@ BString::UnlockBuffer(int32 length)
BString&
-BString::SetCharAt(int32 pos, char to)
+BString::SetByteAt(int32 pos, char to)
{
if (pos < Length() && _MakeWritable() == B_OK)
fPrivateData[pos] = to;
diff --git a/src/preferences/mail/DNSQuery.cpp
b/src/preferences/mail/DNSQuery.cpp
index 8826cde..0f76be0 100644
--- a/src/preferences/mail/DNSQuery.cpp
+++ b/src/preferences/mail/DNSQuery.cpp
@@ -229,14 +229,14 @@ DNSTools::ConvertToDNSName(const BString& string)
// set a counts to the dot
diff = dot - 1 - lastDot;
- outString.SetCharAt(lastDot, (char)diff);
+ outString.SetByteAt(lastDot, (char)diff);
lastDot = dot;
}
} else
lastDot = 0;
diff = outString.CountChars() - 1 - lastDot;
- outString.SetCharAt(lastDot, (char)diff);
+ outString.SetByteAt(lastDot, (char)diff);
return outString;
}
@@ -259,7 +259,7 @@ DNSTools::ConvertFromDNSName(const BString& string)
if (dot == 0)
break;
// set a "."
- outString.SetCharAt(nextDot, '.');
+ outString.SetByteAt(nextDot, '.');
nextDot+= dot + 1;
}
return outString;
diff --git a/src/tests/kits/support/bstring/StringCharAccessTest.cpp
b/src/tests/kits/support/bstring/StringCharAccessTest.cpp
index 88fa102..0859508 100644
--- a/src/tests/kits/support/bstring/StringCharAccessTest.cpp
+++ b/src/tests/kits/support/bstring/StringCharAccessTest.cpp
@@ -27,7 +27,7 @@ StringCharAccessTest::PerformTest(void)
//&operator[]
NextSubTest();
- string.SetCharAt(0, 'a');
+ string.SetByteAt(0, 'a');
CPPUNIT_ASSERT(strcmp(string.String(), "a simple string") == 0);
//ByteAt(int32)