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

Side by Side Diff: core/include/fxcrt/fx_coordinates.h

Issue 1077083003: Fix the noisiest variable shadowing warnings in pdfium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Put statements on separate lines. Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FXCRT_COORDINATES_ 7 #ifndef _FXCRT_COORDINATES_
8 #define _FXCRT_COORDINATES_ 8 #define _FXCRT_COORDINATES_
9 9
10 #include "fx_basic.h" 10 #include "fx_basic.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 typedef CFX_PSVTemplate<FX_FLOAT> const * FX_LPCPOINTF; 125 typedef CFX_PSVTemplate<FX_FLOAT> const * FX_LPCPOINTF;
126 #define CFX_FloatPoint CFX_PointF 126 #define CFX_FloatPoint CFX_PointF
127 template<class baseType> 127 template<class baseType>
128 class CFX_VTemplate: public CFX_PSVTemplate<baseType> 128 class CFX_VTemplate: public CFX_PSVTemplate<baseType>
129 { 129 {
130 public: 130 public:
131 typedef CFX_PSVTemplate<baseType> FXT_PSV; 131 typedef CFX_PSVTemplate<baseType> FXT_PSV;
132 typedef CFX_PSVTemplate<baseType> FXT_POINT; 132 typedef CFX_PSVTemplate<baseType> FXT_POINT;
133 typedef CFX_PSVTemplate<baseType> FXT_SIZE; 133 typedef CFX_PSVTemplate<baseType> FXT_SIZE;
134 typedef CFX_VTemplate<baseType> FXT_VECTOR; 134 typedef CFX_VTemplate<baseType> FXT_VECTOR;
135 void» » Set(baseType x, baseType y) 135 void» » Set(baseType newx, baseType newy)
136 { 136 {
137 FXT_PSV::x = x, FXT_PSV::y = y; 137 FXT_PSV::x = newx;
138 FXT_PSV::y = newy;
138 } 139 }
139 void Set(const FXT_PSV &psv) 140 void Set(const FXT_PSV &psv)
140 { 141 {
141 FXT_PSV::x = psv.x, FXT_PSV::y = psv.y; 142 FXT_PSV::x = psv.x, FXT_PSV::y = psv.y;
142 } 143 }
143 void Set(const FXT_POINT &p1, const FXT_POINT &p2) 144 void Set(const FXT_POINT &p1, const FXT_POINT &p2)
144 { 145 {
145 FXT_PSV::x = p2.x - p1.x, FXT_PSV::y = p2.y - p1.y; 146 FXT_PSV::x = p2.x - p1.x, FXT_PSV::y = p2.y - p1.y;
146 } 147 }
147 void Reset() 148 void Reset()
(...skipping 10 matching lines...) Expand all
158 } 159 }
159 void Normalize() 160 void Normalize()
160 { 161 {
161 FX_FLOAT fLen = FXSYS_sqrt(FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PS V::y); 162 FX_FLOAT fLen = FXSYS_sqrt(FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PS V::y);
162 if (fLen < 0.0001f) { 163 if (fLen < 0.0001f) {
163 return; 164 return;
164 } 165 }
165 FXT_PSV::x = ((baseType)FXT_PSV::x) / fLen; 166 FXT_PSV::x = ((baseType)FXT_PSV::x) / fLen;
166 FXT_PSV::y = ((baseType)FXT_PSV::y) / fLen; 167 FXT_PSV::y = ((baseType)FXT_PSV::y) / fLen;
167 } 168 }
168 baseType» DotProduct(baseType x, baseType y) const 169 baseType» DotProduct(baseType otherx, baseType othery) const
169 { 170 {
170 return FXT_PSV::x * x + FXT_PSV::y * y; 171 return FXT_PSV::x * otherx + FXT_PSV::y * othery;
171 } 172 }
172 baseType DotProduct(const FXT_VECTOR &v) const 173 baseType DotProduct(const FXT_VECTOR &v) const
173 { 174 {
174 return FXT_PSV::x * v.x + FXT_PSV::y * v.y; 175 return FXT_PSV::x * v.x + FXT_PSV::y * v.y;
175 } 176 }
176 FX_BOOL» » IsParallel(baseType x, baseType y) const 177 FX_BOOL» » IsParallel(baseType otherx, baseType othery) const
177 { 178 {
178 baseType t = FXT_PSV::x * y - FXT_PSV::y * x; 179 baseType t = FXT_PSV::x * othery - FXT_PSV::y * otherx;
179 return FXSYS_fabs(t) < 0x0001f; 180 return FXSYS_fabs(t) < 0x0001f;
180 } 181 }
181 FX_BOOL IsParallel(const FXT_VECTOR &v) const 182 FX_BOOL IsParallel(const FXT_VECTOR &v) const
182 { 183 {
183 return IsParallel(v.x, v.y); 184 return IsParallel(v.x, v.y);
184 } 185 }
185 FX_BOOL» » IsPerpendicular(baseType x, baseType y) const 186 FX_BOOL» » IsPerpendicular(baseType otherx, baseType othery) const
186 { 187 {
187 baseType t = DotProduct(x, y); 188 baseType t = DotProduct(otherx, othery);
188 return FXSYS_fabs(t) < 0x0001f; 189 return FXSYS_fabs(t) < 0x0001f;
189 } 190 }
190 FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const 191 FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const
191 { 192 {
192 return IsPerpendicular(v.x, v.y); 193 return IsPerpendicular(v.x, v.y);
193 } 194 }
194 void Translate(baseType dx, baseType dy) 195 void Translate(baseType dx, baseType dy)
195 { 196 {
196 FXT_PSV::x += dx, FXT_PSV::y += dy; 197 FXT_PSV::x += dx, FXT_PSV::y += dy;
197 } 198 }
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 public: 897 public:
897 FX_FLOAT a; 898 FX_FLOAT a;
898 FX_FLOAT b; 899 FX_FLOAT b;
899 FX_FLOAT c; 900 FX_FLOAT c;
900 FX_FLOAT d; 901 FX_FLOAT d;
901 FX_FLOAT e; 902 FX_FLOAT e;
902 FX_FLOAT f; 903 FX_FLOAT f;
903 }; 904 };
904 #define CFX_AffineMatrix CFX_Matrix 905 #define CFX_AffineMatrix CFX_Matrix
905 #endif 906 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698