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

Side by Side Diff: src/utils/SkBase64.cpp

Issue 1777213003: Remove version checks for _MSC_VER < 1800 (msvs2013). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 11 matching lines...) Expand all
22 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, DecodePad, -1, -1, 22 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, DecodePad, -1, -1,
23 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
24 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, 24 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
25 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 25 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
26 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 26 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
27 }; 27 };
28 28
29 SkBase64::SkBase64() : fLength((size_t) -1), fData(nullptr) { 29 SkBase64::SkBase64() : fLength((size_t) -1), fData(nullptr) {
30 } 30 }
31 31
32 #if defined _WIN32 && _MSC_VER >= 1300 // disable 'two', etc. may be used witho ut having been initialized 32 #if defined _WIN32 // disable 'two', etc. may be used without having been initi alized
33 #pragma warning ( push ) 33 #pragma warning ( push )
34 #pragma warning ( disable : 4701 ) 34 #pragma warning ( disable : 4701 )
35 #endif 35 #endif
36 36
37 SkBase64::Error SkBase64::decode(const void* srcPtr, size_t size, bool writeDest ination) { 37 SkBase64::Error SkBase64::decode(const void* srcPtr, size_t size, bool writeDest ination) {
38 unsigned char* dst = (unsigned char*) fData; 38 unsigned char* dst = (unsigned char*) fData;
39 const unsigned char* dstStart = (const unsigned char*) fData; 39 const unsigned char* dstStart = (const unsigned char*) fData;
40 const unsigned char* src = (const unsigned char*) srcPtr; 40 const unsigned char* src = (const unsigned char*) srcPtr;
41 bool padTwo = false; 41 bool padTwo = false;
42 bool padThree = false; 42 bool padThree = false;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 break; 98 break;
99 if (writeDestination) 99 if (writeDestination)
100 *dst = (unsigned char) three; 100 *dst = (unsigned char) three;
101 dst++; 101 dst++;
102 } 102 }
103 goHome: 103 goHome:
104 fLength = dst - dstStart; 104 fLength = dst - dstStart;
105 return kNoError; 105 return kNoError;
106 } 106 }
107 107
108 #if defined _WIN32 && _MSC_VER >= 1300 108 #if defined _WIN32
109 #pragma warning ( pop ) 109 #pragma warning ( pop )
110 #endif 110 #endif
111 111
112 size_t SkBase64::Encode(const void* srcPtr, size_t length, void* dstPtr, const c har* encodeMap) { 112 size_t SkBase64::Encode(const void* srcPtr, size_t length, void* dstPtr, const c har* encodeMap) {
113 const char* encode; 113 const char* encode;
114 if (nullptr == encodeMap) { 114 if (nullptr == encodeMap) {
115 encode = default_encode; 115 encode = default_encode;
116 } else { 116 } else {
117 encode = encodeMap; 117 encode = encodeMap;
118 } 118 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 SkBase64::Error SkBase64::decode(const char* src, size_t len) { 156 SkBase64::Error SkBase64::decode(const char* src, size_t len) {
157 Error err = decode(src, len, false); 157 Error err = decode(src, len, false);
158 SkASSERT(err == kNoError); 158 SkASSERT(err == kNoError);
159 if (err != kNoError) 159 if (err != kNoError)
160 return err; 160 return err;
161 fData = new char[fLength]; // should use sk_malloc/sk_free 161 fData = new char[fLength]; // should use sk_malloc/sk_free
162 decode(src, len, true); 162 decode(src, len, true);
163 return kNoError; 163 return kNoError;
164 } 164 }
OLDNEW
« src/effects/gradients/SkLinearGradient.cpp ('K') | « src/sfnt/SkTypedEnum.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698