diff options
author | Bruce Dawson <brucedawson@google.com> | 2014-11-17 15:33:04 -0800 |
---|---|---|
committer | Bruce Dawson <brucedawson@google.com> | 2014-11-17 15:33:04 -0800 |
commit | cf19caadfa3e7e01d3412d83540e8492b52b31d7 (patch) | |
tree | f100f6946c18e387b6a0eaf14b396e79d564ac9c /fpdfsdk/src/jsapi/fxjs_v8.cpp | |
parent | 9ae02acf2f33fc68a6f3c00c3ad86e15725b8941 (diff) | |
download | pdfium-cf19caadfa3e7e01d3412d83540e8492b52b31d7.tar.xz |
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
Diffstat (limited to 'fpdfsdk/src/jsapi/fxjs_v8.cpp')
-rw-r--r-- | fpdfsdk/src/jsapi/fxjs_v8.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<v8::FunctionTemplate> 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<v8::ObjectTemplate> objTemp; |