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

Side by Side Diff: tools/android/forwarder2/common.h

Issue 825323002: replace COMPILE_ASSERT with static_assert in tools/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add fixups Created 5 years, 11 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 | « no previous file | tools/android/memdump/memdump.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 // Common helper functions/classes used both in the host and device forwarder. 5 // Common helper functions/classes used both in the host and device forwarder.
6 6
7 #ifndef TOOLS_ANDROID_FORWARDER2_COMMON_H_ 7 #ifndef TOOLS_ANDROID_FORWARDER2_COMMON_H_
8 #define TOOLS_ANDROID_FORWARDER2_COMMON_H_ 8 #define TOOLS_ANDROID_FORWARDER2_COMMON_H_
9 9
10 #include <stdarg.h> 10 #include <stdarg.h>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 va_end(ap); 73 va_end(ap);
74 if (bytes_written > 0) 74 if (bytes_written > 0)
75 write_ptr_ += bytes_written; 75 write_ptr_ += bytes_written;
76 return bytes_written; 76 return bytes_written;
77 } 77 }
78 78
79 private: 79 private:
80 char* write_ptr_; 80 char* write_ptr_;
81 char buffer_[BufferSize]; 81 char buffer_[BufferSize];
82 82
83 COMPILE_ASSERT(BufferSize >= 1, Size_of_buffer_must_be_at_least_one); 83 static_assert(BufferSize >= 1, "size of buffer must be at least one");
84 DISALLOW_COPY_AND_ASSIGN(FixedSizeStringBuilder); 84 DISALLOW_COPY_AND_ASSIGN(FixedSizeStringBuilder);
85 }; 85 };
86 86
87 } // namespace forwarder2 87 } // namespace forwarder2
88 88
89 #endif // TOOLS_ANDROID_FORWARDER2_COMMON_H_ 89 #endif // TOOLS_ANDROID_FORWARDER2_COMMON_H_
OLDNEW
« no previous file with comments | « no previous file | tools/android/memdump/memdump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698