Remove needless casts of (narrow) string literals.
authorTom Sepez <tsepez@chromium.org>
Thu, 4 Dec 2014 18:10:34 +0000 (10:10 -0800)
committerTom Sepez <tsepez@chromium.org>
Thu, 4 Dec 2014 18:10:34 +0000 (10:10 -0800)
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
core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
xfa/src/fgas/src/font/fx_stdfontmgr.cpp
xfa/src/fxfa/src/parser/xfa_script_imp.cpp

index d7c725c..776d82e 100644 (file)
@@ -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;
     }
index 99bb5b8..559d850 100644 (file)
@@ -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;
index ae59cab..7f153b1 100644 (file)
@@ -467,16 +467,16 @@ FX_LPEnumAllFonts FX_GetDefFontEnumerator()
 #else\r
 FX_LPCSTR g_FontFolders[] = {\r
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_\r
-    (FX_LPCSTR)"/usr/share/fonts",\r
-    (FX_LPCSTR)"/usr/share/X11/fonts/Type1",\r
-    (FX_LPCSTR)"/usr/share/X11/fonts/TTF",\r
-    (FX_LPCSTR)"/usr/local/share/fonts",\r
+    "/usr/share/fonts",\r
+    "/usr/share/X11/fonts/Type1",\r
+    "/usr/share/X11/fonts/TTF",\r
+    "/usr/local/share/fonts",\r
 #elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_\r
-    (FX_LPCSTR)"~/Library/Fonts",\r
-    (FX_LPCSTR)"/Library/Fonts",\r
-    (FX_LPCSTR)"/System/Library/Fonts",\r
+    "~/Library/Fonts",\r
+    "/Library/Fonts",\r
+    "/System/Library/Fonts",\r
 #elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_\r
-    (FX_LPCSTR)"/system/fonts",\r
+    "/system/fonts",\r
 #endif\r
 };\r
 CFX_FontSourceEnum_File::CFX_FontSourceEnum_File()\r
index bdf59ca..cd196f5 100644 (file)
@@ -728,8 +728,8 @@ IXFA_ScriptContext* XFA_ScriptContext_Create(CXFA_Document* pDocument)
     return FX_NEW CXFA_ScriptContext(pDocument);\r
 }\r
 static const XFA_JSBUILTININFO gs_JSBUILTINData[] = {\r
-    {0x8108b9a9, (FX_LPCSTR)"Number"},\r
-    {0xe07e3fbe, (FX_LPCSTR)"Date"},\r
+    {0x8108b9a9, "Number"},\r
+    {0xe07e3fbe, "Date"},\r
 };\r
 const FX_INT32 g_iJSBuiltinCount = sizeof(XFA_JSBUILTININFO) / sizeof(XFA_JSBUILTININFO);\r
 XFA_LPCJSBUILTININFO XFA_GetJSBuiltinByHash(FX_UINT32 uHashCode)\r