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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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/SkScalerContext_win_dw.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 9
10 #include "SkTFitsIn.h" 10 #include "SkTFitsIn.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 && aID.fLsbSize == bID.fLsbSize 59 && aID.fLsbSize == bID.fLsbSize
60 && aID.fMsbSize == bID.fMsbSize 60 && aID.fMsbSize == bID.fMsbSize
61 && aID.fVolume == bID.fVolume; 61 && aID.fVolume == bID.fVolume;
62 } 62 }
63 63
64 class SkAutoNullKernelHandle : SkNoncopyable { 64 class SkAutoNullKernelHandle : SkNoncopyable {
65 public: 65 public:
66 SkAutoNullKernelHandle(const HANDLE handle) : fHandle(handle) { } 66 SkAutoNullKernelHandle(const HANDLE handle) : fHandle(handle) { }
67 ~SkAutoNullKernelHandle() { CloseHandle(fHandle); } 67 ~SkAutoNullKernelHandle() { CloseHandle(fHandle); }
68 operator HANDLE() const { return fHandle; } 68 operator HANDLE() const { return fHandle; }
69 bool isValid() const { return NULL != fHandle; } 69 bool isValid() const { return SkToBool(fHandle); }
70 private: 70 private:
71 HANDLE fHandle; 71 HANDLE fHandle;
72 }; 72 };
73 typedef SkAutoNullKernelHandle SkAutoWinMMap; 73 typedef SkAutoNullKernelHandle SkAutoWinMMap;
74 74
75 void sk_fmunmap(const void* addr, size_t) { 75 void sk_fmunmap(const void* addr, size_t) {
76 UnmapViewOfFile(addr); 76 UnmapViewOfFile(addr);
77 } 77 }
78 78
79 void* sk_fdmmap(int fileno, size_t* length) { 79 void* sk_fdmmap(int fileno, size_t* length) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 void* sk_fmmap(SkFILE* f, size_t* length) { 115 void* sk_fmmap(SkFILE* f, size_t* length) {
116 int fileno = sk_fileno(f); 116 int fileno = sk_fileno(f);
117 if (fileno < 0) { 117 if (fileno < 0) {
118 return NULL; 118 return NULL;
119 } 119 }
120 120
121 return sk_fdmmap(fileno, length); 121 return sk_fdmmap(fileno, length);
122 } 122 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkScalerContext_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698