OLD | NEW |
---|---|
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 Loading... | |
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 leas_ one"); |
Robert Sesek
2015/01/06 15:39:44
leas_ -> least
Mostyn Bramley-Moore
2015/01/06 18:41:13
Done.
| |
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_ |
OLD | NEW |