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

Side by Side Diff: src/utils/win/SkIStream.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/utils/win/SkHRESULT.cpp ('k') | src/utils/win/SkWGL_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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #define WIN32_LEAN_AND_MEAN 10 #define WIN32_LEAN_AND_MEAN
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 SkIStream::SkIStream(SkStream* stream, bool unrefOnRelease) 106 SkIStream::SkIStream(SkStream* stream, bool unrefOnRelease)
107 : SkBaseIStream() 107 : SkBaseIStream()
108 , fSkStream(stream) 108 , fSkStream(stream)
109 , fUnrefOnRelease(unrefOnRelease) 109 , fUnrefOnRelease(unrefOnRelease)
110 , fLocation() 110 , fLocation()
111 { 111 {
112 this->fSkStream->rewind(); 112 this->fSkStream->rewind();
113 } 113 }
114 114
115 SkIStream::~SkIStream() { 115 SkIStream::~SkIStream() {
116 if (NULL != this->fSkStream && fUnrefOnRelease) { 116 if (this->fSkStream && fUnrefOnRelease) {
117 this->fSkStream->unref(); 117 this->fSkStream->unref();
118 } 118 }
119 } 119 }
120 120
121 HRESULT SkIStream::CreateFromSkStream(SkStream* stream 121 HRESULT SkIStream::CreateFromSkStream(SkStream* stream
122 , bool unrefOnRelease 122 , bool unrefOnRelease
123 , IStream ** ppStream) 123 , IStream ** ppStream)
124 { 124 {
125 if (NULL == stream) { 125 if (NULL == stream) {
126 return E_INVALIDARG; 126 return E_INVALIDARG;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 hr = E_FAIL; 189 hr = E_FAIL;
190 } 190 }
191 } 191 }
192 break; 192 break;
193 } 193 }
194 default: 194 default:
195 hr = STG_E_INVALIDFUNCTION; 195 hr = STG_E_INVALIDFUNCTION;
196 break; 196 break;
197 } 197 }
198 198
199 if (NULL != lpNewFilePointer) { 199 if (lpNewFilePointer) {
200 lpNewFilePointer->QuadPart = this->fLocation.QuadPart; 200 lpNewFilePointer->QuadPart = this->fLocation.QuadPart;
201 } 201 }
202 return hr; 202 return hr;
203 } 203 }
204 204
205 HRESULT STDMETHODCALLTYPE SkIStream::Stat(STATSTG* pStatstg 205 HRESULT STDMETHODCALLTYPE SkIStream::Stat(STATSTG* pStatstg
206 , DWORD grfStatFlag) 206 , DWORD grfStatFlag)
207 { 207 {
208 if (0 == (grfStatFlag & STATFLAG_NONAME)) { 208 if (0 == (grfStatFlag & STATFLAG_NONAME)) {
209 return STG_E_INVALIDFLAG; 209 return STG_E_INVALIDFLAG;
(...skipping 11 matching lines...) Expand all
221 221
222 /** 222 /**
223 * SkIWStream 223 * SkIWStream
224 */ 224 */
225 SkWIStream::SkWIStream(SkWStream* stream) 225 SkWIStream::SkWIStream(SkWStream* stream)
226 : SkBaseIStream() 226 : SkBaseIStream()
227 , fSkWStream(stream) 227 , fSkWStream(stream)
228 { } 228 { }
229 229
230 SkWIStream::~SkWIStream() { 230 SkWIStream::~SkWIStream() {
231 if (NULL != this->fSkWStream) { 231 if (this->fSkWStream) {
232 this->fSkWStream->flush(); 232 this->fSkWStream->flush();
233 } 233 }
234 } 234 }
235 235
236 HRESULT SkWIStream::CreateFromSkWStream(SkWStream* stream 236 HRESULT SkWIStream::CreateFromSkWStream(SkWStream* stream
237 , IStream ** ppStream) 237 , IStream ** ppStream)
238 { 238 {
239 *ppStream = new SkWIStream(stream); 239 *ppStream = new SkWIStream(stream);
240 return S_OK; 240 return S_OK;
241 } 241 }
(...skipping 26 matching lines...) Expand all
268 if (0 == (grfStatFlag & STATFLAG_NONAME)) { 268 if (0 == (grfStatFlag & STATFLAG_NONAME)) {
269 return STG_E_INVALIDFLAG; 269 return STG_E_INVALIDFLAG;
270 } 270 }
271 pStatstg->pwcsName = NULL; 271 pStatstg->pwcsName = NULL;
272 pStatstg->cbSize.QuadPart = 0; 272 pStatstg->cbSize.QuadPart = 0;
273 pStatstg->clsid = CLSID_NULL; 273 pStatstg->clsid = CLSID_NULL;
274 pStatstg->type = STGTY_STREAM; 274 pStatstg->type = STGTY_STREAM;
275 pStatstg->grfMode = STGM_WRITE; 275 pStatstg->grfMode = STGM_WRITE;
276 return S_OK; 276 return S_OK;
277 } 277 }
OLDNEW
« no previous file with comments | « src/utils/win/SkHRESULT.cpp ('k') | src/utils/win/SkWGL_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698