Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Side by Side Diff: src/string-builder.h

Issue 714413005: Fix windows build (static_cast missing). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_STRING_BUILDER_H_ 5 #ifndef V8_STRING_BUILDER_H_
6 #define V8_STRING_BUILDER_H_ 6 #define V8_STRING_BUILDER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 cursor_ = start_; 319 cursor_ = start_;
320 } 320 }
321 321
322 INLINE(void Append(DestChar c)) { *(cursor_++) = c; } 322 INLINE(void Append(DestChar c)) { *(cursor_++) = c; }
323 INLINE(void AppendCString(const char* s)) { 323 INLINE(void AppendCString(const char* s)) {
324 const uint8_t* u = reinterpret_cast<const uint8_t*>(s); 324 const uint8_t* u = reinterpret_cast<const uint8_t*>(s);
325 while (*u != '\0') Append(*(u++)); 325 while (*u != '\0') Append(*(u++));
326 } 326 }
327 327
328 int written() { return cursor_ - start_; } 328 int written() { return static_cast<int>(cursor_ - start_); }
329 329
330 private: 330 private:
331 DestChar* start_; 331 DestChar* start_;
332 DestChar* cursor_; 332 DestChar* cursor_;
333 DisallowHeapAllocation no_gc_; 333 DisallowHeapAllocation no_gc_;
334 }; 334 };
335 335
336 template <typename DestChar> 336 template <typename DestChar>
337 class NoExtendString : public NoExtend<DestChar> { 337 class NoExtendString : public NoExtend<DestChar> {
338 public: 338 public:
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 DCHECK_EQ(String::TWO_BYTE_ENCODING, encoding_); 421 DCHECK_EQ(String::TWO_BYTE_ENCODING, encoding_);
422 SeqTwoByteString::cast(*current_part_) 422 SeqTwoByteString::cast(*current_part_)
423 ->SeqTwoByteStringSet(current_index_++, c); 423 ->SeqTwoByteStringSet(current_index_++, c);
424 } 424 }
425 if (current_index_ == part_length_) Extend(); 425 if (current_index_ == part_length_) Extend();
426 } 426 }
427 } 427 }
428 } // namespace v8::internal 428 } // namespace v8::internal
429 429
430 #endif // V8_STRING_BUILDER_H_ 430 #endif // V8_STRING_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698