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

Side by Side Diff: src/log-utils.cc

Issue 125125: Fixed pointer vs. va_list overloading problem occuring in gcc 3.3 (used for ARM build). (Closed)
Patch Set: Created 11 years, 6 months 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
« no previous file with comments | « src/log-utils.h ('k') | 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 LogMessageBuilder::LogMessageBuilder(): sl(Log::mutex_), pos_(0) { 208 LogMessageBuilder::LogMessageBuilder(): sl(Log::mutex_), pos_(0) {
209 ASSERT(Log::message_buffer_ != NULL); 209 ASSERT(Log::message_buffer_ != NULL);
210 } 210 }
211 211
212 212
213 void LogMessageBuilder::Append(const char* format, ...) { 213 void LogMessageBuilder::Append(const char* format, ...) {
214 Vector<char> buf(Log::message_buffer_ + pos_, 214 Vector<char> buf(Log::message_buffer_ + pos_,
215 Log::kMessageBufferSize - pos_); 215 Log::kMessageBufferSize - pos_);
216 va_list args; 216 va_list args;
217 va_start(args, format); 217 va_start(args, format);
218 Append(format, args); 218 AppendVA(format, args);
219 va_end(args); 219 va_end(args);
220 ASSERT(pos_ <= Log::kMessageBufferSize); 220 ASSERT(pos_ <= Log::kMessageBufferSize);
221 } 221 }
222 222
223 223
224 void LogMessageBuilder::Append(const char* format, va_list args) { 224 void LogMessageBuilder::AppendVA(const char* format, va_list args) {
225 Vector<char> buf(Log::message_buffer_ + pos_, 225 Vector<char> buf(Log::message_buffer_ + pos_,
226 Log::kMessageBufferSize - pos_); 226 Log::kMessageBufferSize - pos_);
227 int result = v8::internal::OS::VSNPrintF(buf, format, args); 227 int result = v8::internal::OS::VSNPrintF(buf, format, args);
228 228
229 // Result is -1 if output was truncated. 229 // Result is -1 if output was truncated.
230 if (result >= 0) { 230 if (result >= 0) {
231 pos_ += result; 231 pos_ += result;
232 } else { 232 } else {
233 pos_ = Log::kMessageBufferSize; 233 pos_ = Log::kMessageBufferSize;
234 } 234 }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 PrintBackwardReference(backref, best.distance, best.copy_from_pos); 474 PrintBackwardReference(backref, best.distance, best.copy_from_pos);
475 ASSERT(strlen(backref.start()) - best.backref_size == 0); 475 ASSERT(strlen(backref.start()) - best.backref_size == 0);
476 prev_record->Truncate(unchanged_len + best.backref_size); 476 prev_record->Truncate(unchanged_len + best.backref_size);
477 } 477 }
478 return true; 478 return true;
479 } 479 }
480 480
481 #endif // ENABLE_LOGGING_AND_PROFILING 481 #endif // ENABLE_LOGGING_AND_PROFILING
482 482
483 } } // namespace v8::internal 483 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log-utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698