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

Side by Side Diff: src/wasm/wasm-result.h

Issue 1872203005: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unused param found by GC mole Created 4 years, 8 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/wasm/decoder.h ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_WASM_RESULT_H_ 5 #ifndef V8_WASM_RESULT_H_
6 #define V8_WASM_RESULT_H_ 6 #define V8_WASM_RESULT_H_
7 7
8 #include "src/base/compiler-specific.h"
8 #include "src/base/smart-pointers.h" 9 #include "src/base/smart-pointers.h"
9 10
10 #include "src/globals.h" 11 #include "src/globals.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 15
15 class Isolate; 16 class Isolate;
16 17
17 namespace wasm { 18 namespace wasm {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 87 }
87 88
88 std::ostream& operator<<(std::ostream& os, const ErrorCode& error_code); 89 std::ostream& operator<<(std::ostream& os, const ErrorCode& error_code);
89 90
90 // A helper for generating error messages that bubble up to JS exceptions. 91 // A helper for generating error messages that bubble up to JS exceptions.
91 class ErrorThrower { 92 class ErrorThrower {
92 public: 93 public:
93 ErrorThrower(Isolate* isolate, const char* context) 94 ErrorThrower(Isolate* isolate, const char* context)
94 : isolate_(isolate), context_(context), error_(false) {} 95 : isolate_(isolate), context_(context), error_(false) {}
95 96
96 void Error(const char* fmt, ...); 97 PRINTF_FORMAT(2, 3) void Error(const char* fmt, ...);
97 98
98 template <typename T> 99 template <typename T>
99 void Failed(const char* error, Result<T>& result) { 100 void Failed(const char* error, Result<T>& result) {
100 std::ostringstream str; 101 std::ostringstream str;
101 str << error << result; 102 str << error << result;
102 return Error(str.str().c_str()); 103 return Error("%s", str.str().c_str());
103 } 104 }
104 105
105 bool error() const { return error_; } 106 bool error() const { return error_; }
106 107
107 private: 108 private:
108 Isolate* isolate_; 109 Isolate* isolate_;
109 const char* context_; 110 const char* context_;
110 bool error_; 111 bool error_;
111 }; 112 };
112 } // namespace wasm 113 } // namespace wasm
113 } // namespace internal 114 } // namespace internal
114 } // namespace v8 115 } // namespace v8
115 116
116 #endif 117 #endif
OLDNEW
« no previous file with comments | « src/wasm/decoder.h ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698