From df448f5c421440c8884c87da6055c0b5cc62c5ca Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 4 Dec 2014 10:10:34 -0800 Subject: Remove needless casts of (narrow) string literals. Follow-up to work on (wide) string literals. R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/751113003 --- core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp | 2 +- core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp | 2 +- xfa/src/fgas/src/font/fx_stdfontmgr.cpp | 16 ++++++++-------- xfa/src/fxfa/src/parser/xfa_script_imp.cpp | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp index d7c725cc2f..776d82e21c 100644 --- a/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp +++ b/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp @@ -17,7 +17,7 @@ typedef struct { } FXFC_PACKAGE; FX_LPVOID FXFC_LoadPackage(FX_LPCSTR name) { - FXSYS_FILE* file = FXSYS_fopen(name, (FX_LPCSTR)"rb"); + FXSYS_FILE* file = FXSYS_fopen(name, "rb"); if (file == NULL) { return NULL; } diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp index 99bb5b89cd..559d8500b1 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp @@ -355,7 +355,7 @@ FX_FLOAT CPDF_TextState::GetShearAngle() const CPDF_GeneralStateData::CPDF_GeneralStateData() { FXSYS_memset32(this, 0, sizeof(CPDF_GeneralStateData)); - FXSYS_strcpy((FX_LPSTR)m_BlendMode, (FX_LPCSTR)"Normal"); + FXSYS_strcpy((FX_LPSTR)m_BlendMode, "Normal"); m_StrokeAlpha = 1.0f; m_FillAlpha = 1.0f; m_Flatness = 1.0f; diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp index ae59cab2e5..7f153b16d3 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp @@ -467,16 +467,16 @@ FX_LPEnumAllFonts FX_GetDefFontEnumerator() #else FX_LPCSTR g_FontFolders[] = { #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ - (FX_LPCSTR)"/usr/share/fonts", - (FX_LPCSTR)"/usr/share/X11/fonts/Type1", - (FX_LPCSTR)"/usr/share/X11/fonts/TTF", - (FX_LPCSTR)"/usr/local/share/fonts", + "/usr/share/fonts", + "/usr/share/X11/fonts/Type1", + "/usr/share/X11/fonts/TTF", + "/usr/local/share/fonts", #elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - (FX_LPCSTR)"~/Library/Fonts", - (FX_LPCSTR)"/Library/Fonts", - (FX_LPCSTR)"/System/Library/Fonts", + "~/Library/Fonts", + "/Library/Fonts", + "/System/Library/Fonts", #elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ - (FX_LPCSTR)"/system/fonts", + "/system/fonts", #endif }; CFX_FontSourceEnum_File::CFX_FontSourceEnum_File() diff --git a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp index bdf59ca082..cd196f585d 100644 --- a/xfa/src/fxfa/src/parser/xfa_script_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_script_imp.cpp @@ -728,8 +728,8 @@ IXFA_ScriptContext* XFA_ScriptContext_Create(CXFA_Document* pDocument) return FX_NEW CXFA_ScriptContext(pDocument); } static const XFA_JSBUILTININFO gs_JSBUILTINData[] = { - {0x8108b9a9, (FX_LPCSTR)"Number"}, - {0xe07e3fbe, (FX_LPCSTR)"Date"}, + {0x8108b9a9, "Number"}, + {0xe07e3fbe, "Date"}, }; const FX_INT32 g_iJSBuiltinCount = sizeof(XFA_JSBUILTININFO) / sizeof(XFA_JSBUILTININFO); XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(FX_UINT32 uHashCode) -- cgit v1.2.3