From cf19caadfa3e7e01d3412d83540e8492b52b31d7 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Mon, 17 Nov 2014 15:33:04 -0800 Subject: Removing unnecessary casts from wchar_t* to wchar_t*, by various names. Remove casts that merely cast from wchar_t* to wchar_t*. Sometimes the types or casts are FX_LPCWSTR but the idea is the same. Excess casts can (and have) hidden bugs so removing these may prevent future problems. Original patch from Bruce Dawson(brucedawson@chromium.org) R=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/730993002 --- fpdfsdk/src/jsapi/fxjs_v8.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/src/jsapi') diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index 5eb9873f5c..7d1226e234 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -93,7 +93,7 @@ int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); - CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sMethodName); + CFX_WideString ws = CFX_WideString(sMethodName); CFX_ByteString bsMethodName = ws.UTF8Encode(); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); @@ -113,7 +113,7 @@ int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); - CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sPropName); + CFX_WideString ws = CFX_WideString(sPropName); CFX_ByteString bsPropertyName = ws.UTF8Encode(); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); @@ -153,7 +153,7 @@ int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sC CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); if(!pArray) return 0; - CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sConstName); + CFX_WideString ws = CFX_WideString(sConstName); CFX_ByteString bsConstName = ws.UTF8Encode(); if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; @@ -188,7 +188,7 @@ int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); - CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sMethodName); + CFX_WideString ws = CFX_WideString(sMethodName); CFX_ByteString bsMethodName = ws.UTF8Encode(); v8::Local funTempl = v8::FunctionTemplate::New(isolate, pMethodCall); @@ -212,7 +212,7 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8: v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); - CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sConstName); + CFX_WideString ws = CFX_WideString(sConstName); CFX_ByteString bsConst= ws.UTF8Encode(); v8::Local objTemp; -- cgit v1.2.3