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

Side by Side Diff: core/fxcrt/fx_system.h

Issue 2482373002: Define IsFloatEqual macro properly. (Closed)
Patch Set: Created 4 years, 1 month 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 CORE_FXCRT_FX_SYSTEM_H_ 7 #ifndef CORE_FXCRT_FX_SYSTEM_H_
8 #define CORE_FXCRT_FX_SYSTEM_H_ 8 #define CORE_FXCRT_FX_SYSTEM_H_
9 9
10 #include <assert.h> 10 #include <assert.h>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 typedef void* FX_POSITION; // Keep until fxcrt containers gone 70 typedef void* FX_POSITION; // Keep until fxcrt containers gone
71 typedef float FX_FLOAT; // Keep, allow upgrade to doubles. 71 typedef float FX_FLOAT; // Keep, allow upgrade to doubles.
72 typedef double FX_DOUBLE; // Keep, allow downgrade to floats. 72 typedef double FX_DOUBLE; // Keep, allow downgrade to floats.
73 typedef char FX_CHAR; // Keep, questionable signedness. 73 typedef char FX_CHAR; // Keep, questionable signedness.
74 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. 74 typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars.
75 75
76 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) 76 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
77 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) 77 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
78 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) 78 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
79 #define IsFloatEqual(fa, fb) IsFloatZero(fa - fb) 79 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb))
dsinclair 2016/11/09 03:33:23 Should these just be real methods instead of macro
Lei Zhang 2016/11/09 05:34:09 We can, but the behavior of this CL won't change f
80 80
81 // PDFium string sizes are limited to 2^31-1, and the value is signed to 81 // PDFium string sizes are limited to 2^31-1, and the value is signed to
82 // allow -1 as a placeholder for "unknown". 82 // allow -1 as a placeholder for "unknown".
83 // TODO(palmer): it should be a |size_t|, or at least unsigned. 83 // TODO(palmer): it should be a |size_t|, or at least unsigned.
84 typedef int FX_STRSIZE; 84 typedef int FX_STRSIZE;
85 85
86 #ifndef ASSERT 86 #ifndef ASSERT
87 #ifndef NDEBUG 87 #ifndef NDEBUG
88 #define ASSERT assert 88 #define ASSERT assert
89 #else 89 #else
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 // Prevent a function from ever being inlined, typically because we'd 321 // Prevent a function from ever being inlined, typically because we'd
322 // like it to appear in stack traces. 322 // like it to appear in stack traces.
323 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 323 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
324 #define NEVER_INLINE __declspec(noinline) 324 #define NEVER_INLINE __declspec(noinline)
325 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 325 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
326 #define NEVER_INLINE __attribute__((__noinline__)) 326 #define NEVER_INLINE __attribute__((__noinline__))
327 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 327 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
328 328
329 #endif // CORE_FXCRT_FX_SYSTEM_H_ 329 #endif // CORE_FXCRT_FX_SYSTEM_H_
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