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

Side by Side Diff: src/ports/SkOSFile_posix.cpp

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/ports/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkOSFile_win.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOSFile.h" 8 #include "SkOSFile.h"
9 #include "SkString.h" 9 #include "SkString.h"
10 #include "SkTFitsIn.h" 10 #include "SkTFitsIn.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return sk_fdmmap(fd, size); 95 return sk_fdmmap(fd, size);
96 } 96 }
97 97
98 //////////////////////////////////////////////////////////////////////////// 98 ////////////////////////////////////////////////////////////////////////////
99 99
100 struct SkOSFileIterData { 100 struct SkOSFileIterData {
101 SkOSFileIterData() : fDIR(0) { } 101 SkOSFileIterData() : fDIR(0) { }
102 DIR* fDIR; 102 DIR* fDIR;
103 SkString fPath, fSuffix; 103 SkString fPath, fSuffix;
104 }; 104 };
105 SK_COMPILE_ASSERT(sizeof(SkOSFileIterData) <= SkOSFile::Iter::kStorageSize, not_ enough_space); 105 static_assert(sizeof(SkOSFileIterData) <= SkOSFile::Iter::kStorageSize, "not_eno ugh_space");
106 106
107 SkOSFile::Iter::Iter() { 107 SkOSFile::Iter::Iter() {
108 SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData); 108 SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
109 } 109 }
110 110
111 SkOSFile::Iter::Iter(const char path[], const char suffix[]) { 111 SkOSFile::Iter::Iter(const char path[], const char suffix[]) {
112 SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData); 112 SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
113 this->reset(path, suffix); 113 this->reset(path, suffix);
114 } 114 }
115 115
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 if (entry) { // we broke out with a file 175 if (entry) { // we broke out with a file
176 if (name) { 176 if (name) {
177 name->set(entry->d_name); 177 name->set(entry->d_name);
178 } 178 }
179 return true; 179 return true;
180 } 180 }
181 } 181 }
182 return false; 182 return false;
183 } 183 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkOSFile_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698