Summary: | Add an overload to makeString for Vector<char> | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Patrick R. Gansterer <paroga> | ||||||
Component: | Web Template Framework | Assignee: | Patrick R. Gansterer <paroga> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, darin, eric, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Patrick R. Gansterer
2010-11-27 09:14:26 PST
Created attachment 74963 [details]
Patch
Darin or or Maciej are better reviewers here. Comment on attachment 74963 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=74963&action=review > JavaScriptCore/wtf/text/StringConcatenate.h:124 > + unsigned length() { return m_buffer.size(); } > + > + void writeTo(UChar* destination) > + { > + for (unsigned i = 0; i < m_buffer.size(); ++i) > + destination[i] = m_buffer[i]; It’s better style to use size_t, which makes the type of vector’s size than unsigned, which can be narrower. This will widen characters to UChar based on the signed-ness of characters on a particular platform. If the characters are all ASCII, that’s OK, but if there are non-ASCII characters we probably want the characters treated as Latin-1 as we do in most other contexts. To accomplish that, we will need to cast the characters to unsigned char before letting them get widened to UChar. The same applies for const char*. We should either have an isASCII assertion or a typecast to unsigned char. Created attachment 76299 [details]
Patch for landing
Comment on attachment 76299 [details] Patch for landing Clearing flags on attachment: 76299 Committed r73853: <http://trac.webkit.org/changeset/73853> All reviewed patches have been landed. Closing bug. |