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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/fifo_char.cc

Issue 303223007: [NaCl SDK] nacl_io: Run clang-format over nacl_io sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "nacl_io/fifo_char.h" 5 #include "nacl_io/fifo_char.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 namespace nacl_io { 12 namespace nacl_io {
13 13
14 FIFOChar::FIFOChar(size_t size) 14 FIFOChar::FIFOChar(size_t size)
15 : buffer_(NULL), 15 : buffer_(NULL), size_(size), avail_(0), tail_(0) {
16 size_(size),
17 avail_(0),
18 tail_(0) {
19 if (size) 16 if (size)
20 buffer_ = new char[size]; 17 buffer_ = new char[size];
21 } 18 }
22 19
23 FIFOChar::~FIFOChar() { 20 FIFOChar::~FIFOChar() {
24 delete[] buffer_; 21 delete[] buffer_;
25 } 22 }
26 23
27 bool FIFOChar::IsEmpty() { 24 bool FIFOChar::IsEmpty() {
28 return avail_ == 0; 25 return avail_ == 0;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 104
108 out += write_len; 105 out += write_len;
109 len -= write_len; 106 len -= write_len;
110 } 107 }
111 108
112 avail_ += out; 109 avail_ += out;
113 return out; 110 return out;
114 } 111 }
115 112
116 } // namespace nacl_io 113 } // namespace nacl_io
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/fifo_char.h ('k') | native_client_sdk/src/libraries/nacl_io/filesystem.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698