From 04fd27b3742ace6e76d70e19ca7a4ff178c4cdc5 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 30 Mar 2016 12:59:04 -0700 Subject: Replace FXJSE_DOUBLE with double FXJSE_DOUBLE was just defined as double. Replace with actual type to make things clearer. BUG=pdfium:81 Review URL: https://codereview.chromium.org/1842013003 --- xfa/fxjse/include/fxjse.h | 7 +++---- xfa/fxjse/value.cpp | 8 ++++---- xfa/fxjse/value.h | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/xfa/fxjse/include/fxjse.h b/xfa/fxjse/include/fxjse.h index 2bf4d7ea69..54901704be 100644 --- a/xfa/fxjse/include/fxjse.h +++ b/xfa/fxjse/include/fxjse.h @@ -19,7 +19,6 @@ typedef struct FXJSE_HCLASS_ { void* pData; } * FXJSE_HCLASS; typedef struct FXJSE_HVALUE_ { void* pData; } * FXJSE_HVALUE; // NOLINTNEXTLINE typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_{} * FXJSE_HOBJECT; -typedef double FXJSE_DOUBLE; typedef void (*FXJSE_FuncCallback)(FXJSE_HOBJECT hThis, const CFX_ByteStringC& szFuncName, @@ -110,7 +109,7 @@ FX_BOOL FXJSE_Value_IsDate(FXJSE_HVALUE hValue); FX_BOOL FXJSE_Value_ToBoolean(FXJSE_HVALUE hValue); FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue); -FXJSE_DOUBLE FXJSE_Value_ToDouble(FXJSE_HVALUE hValue); +double FXJSE_Value_ToDouble(FXJSE_HVALUE hValue); int32_t FXJSE_Value_ToInteger(FXJSE_HVALUE hValue); void FXJSE_Value_ToUTF8String(FXJSE_HVALUE hValue, CFX_ByteString& szStrOutput); void* FXJSE_Value_ToObject(FXJSE_HVALUE hValue, FXJSE_HCLASS hClass); @@ -122,14 +121,14 @@ void FXJSE_Value_SetUTF8String(FXJSE_HVALUE hValue, const CFX_ByteStringC& szString); void FXJSE_Value_SetInteger(FXJSE_HVALUE hValue, int32_t nInteger); void FXJSE_Value_SetFloat(FXJSE_HVALUE hValue, FX_FLOAT fFloat); -void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble); +void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, double dDouble); void FXJSE_Value_SetObject(FXJSE_HVALUE hValue, void* lpObject, FXJSE_HCLASS hClass); void FXJSE_Value_SetArray(FXJSE_HVALUE hValue, uint32_t uValueCount, FXJSE_HVALUE* rgValues); -void FXJSE_Value_SetDate(FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble); +void FXJSE_Value_SetDate(FXJSE_HVALUE hValue, double dDouble); void FXJSE_Value_Set(FXJSE_HVALUE hValue, FXJSE_HVALUE hOriginalValue); FX_BOOL FXJSE_Value_GetObjectProp(FXJSE_HVALUE hValue, diff --git a/xfa/fxjse/value.cpp b/xfa/fxjse/value.cpp index 7732026fe6..f9214813c2 100644 --- a/xfa/fxjse/value.cpp +++ b/xfa/fxjse/value.cpp @@ -69,7 +69,7 @@ FX_FLOAT FXJSE_Value_ToFloat(FXJSE_HVALUE hValue) { return reinterpret_cast(hValue)->ToFloat(); } -FXJSE_DOUBLE FXJSE_Value_ToDouble(FXJSE_HVALUE hValue) { +double FXJSE_Value_ToDouble(FXJSE_HVALUE hValue) { return reinterpret_cast(hValue)->ToDouble(); } @@ -112,7 +112,7 @@ void FXJSE_Value_SetFloat(FXJSE_HVALUE hValue, FX_FLOAT fFloat) { reinterpret_cast(hValue)->SetFloat(fFloat); } -void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble) { +void FXJSE_Value_SetDouble(FXJSE_HVALUE hValue, double dDouble) { reinterpret_cast(hValue)->SetDouble(dDouble); } @@ -136,7 +136,7 @@ void FXJSE_Value_SetArray(FXJSE_HVALUE hValue, ->SetArray(uValueCount, reinterpret_cast(rgValues)); } -void FXJSE_Value_SetDate(FXJSE_HVALUE hValue, FXJSE_DOUBLE dDouble) { +void FXJSE_Value_SetDate(FXJSE_HVALUE hValue, double dDouble) { reinterpret_cast(hValue)->SetDate(dDouble); } @@ -361,7 +361,7 @@ void CFXJSE_Value::SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues) { m_hValue.Reset(m_pIsolate, hArrayObject); } -void CFXJSE_Value::SetDate(FXJSE_DOUBLE dDouble) { +void CFXJSE_Value::SetDate(double dDouble) { CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hDate = v8::Date::New(m_pIsolate, dDouble); m_hValue.Reset(m_pIsolate, hDate); diff --git a/xfa/fxjse/value.h b/xfa/fxjse/value.h index 7e140d7975..e728b8d857 100644 --- a/xfa/fxjse/value.h +++ b/xfa/fxjse/value.h @@ -125,12 +125,12 @@ class CFXJSE_Value { v8::Local::New(m_pIsolate, m_hValue); return static_cast(hValue->NumberValue()); } - V8_INLINE FXJSE_DOUBLE ToDouble() const { + V8_INLINE double ToDouble() const { ASSERT(!m_hValue.IsEmpty()); CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate); v8::Local hValue = v8::Local::New(m_pIsolate, m_hValue); - return static_cast(hValue->NumberValue()); + return static_cast(hValue->NumberValue()); } V8_INLINE int32_t ToInteger() const { ASSERT(!m_hValue.IsEmpty()); @@ -172,7 +172,7 @@ class CFXJSE_Value { v8::Local hValue = v8::Integer::New(m_pIsolate, nInteger); m_hValue.Reset(m_pIsolate, hValue); } - V8_INLINE void SetDouble(FXJSE_DOUBLE dDouble) { + V8_INLINE void SetDouble(double dDouble) { CFXJSE_ScopeUtil_IsolateHandle scope(m_pIsolate); v8::Local hValue = v8::Number::New(m_pIsolate, dDouble); m_hValue.Reset(m_pIsolate, hValue); @@ -192,7 +192,7 @@ class CFXJSE_Value { } void SetHostObject(void* lpObject, CFXJSE_Class* lpClass); void SetArray(uint32_t uValueCount, CFXJSE_Value** rgValues); - void SetDate(FXJSE_DOUBLE dDouble); + void SetDate(double dDouble); public: FX_BOOL GetObjectProperty(const CFX_ByteStringC& szPropName, -- cgit v1.2.3