Merge to XFA: Remove typdefs for pointer types in fx_system.h.
[pdfium.git] / xfa / src / fxfa / src / fm2js / xfa_fmparse.cpp
index a3e127f..590fa3f 100644 (file)
@@ -48,14 +48,14 @@ void CXFA_FMParse::Check( XFA_FM_TOKEN op )
 {\r
     if (m_pToken->m_type != op) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(op), FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(op), ws_TempString.c_str());\r
     }\r
     NextToken();\r
 }\r
 void CXFA_FMParse::Error(FX_DWORD lineNum, XFA_FM_ERRMSG msg, ...)\r
 {\r
     m_pErrorInfo->linenum = lineNum;\r
-    FX_LPCWSTR lpMessageInfo = XFA_FM_ErrorMsg(msg);\r
+    const FX_WCHAR* lpMessageInfo = XFA_FM_ErrorMsg(msg);\r
     va_list ap;\r
     va_start(ap, msg);\r
     m_pErrorInfo->message.FormatV(lpMessageInfo, ap);\r
@@ -109,7 +109,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseFunction()
     NextToken();\r
     if (m_pToken->m_type != TOKidentifier) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, ws_TempString.c_str());\r
     } else {\r
         ident = m_pToken->m_wstring;\r
         NextToken();\r
@@ -137,7 +137,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseFunction()
                 }\r
             } else {\r
                 CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-                Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, FX_LPCWSTR(ws_TempString));\r
+                Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, ws_TempString.c_str());\r
                 NextToken();\r
                 break;\r
             }\r
@@ -219,7 +219,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseExpression()
             break;\r
         default:\r
             CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-            Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, FX_LPCWSTR(ws_TempString));\r
+            Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, ws_TempString.c_str());\r
             NextToken();\r
             break;\r
     }\r
@@ -233,7 +233,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseVarExpression()
     NextToken();\r
     if (m_pToken->m_type != TOKidentifier) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, ws_TempString.c_str());\r
     } else {\r
         ident = m_pToken->m_wstring;\r
         NextToken();\r
@@ -571,7 +571,7 @@ CXFA_FMSimpleExpression * CXFA_FMParse::ParsePrimaryExpression()
             break;\r
         default:\r
             CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-            Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, FX_LPCWSTR(ws_TempString));\r
+            Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, ws_TempString.c_str());\r
             NextToken();\r
             break;\r
     }\r
@@ -605,7 +605,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi
                         }\r
                         if (m_pToken->m_type != TOKrparen) {\r
                             CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-                            Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), FX_LPCWSTR(ws_TempString));\r
+                            Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str());\r
                         }\r
                     }\r
                     if (m_pErrorInfo->message.IsEmpty()) {\r
@@ -658,7 +658,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi
                             }\r
                             if (m_pToken->m_type != TOKrparen) {\r
                                 CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-                                Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), FX_LPCWSTR(ws_TempString));\r
+                                Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str());\r
                             }\r
                         }\r
                         if (m_pErrorInfo->message.IsEmpty()) {\r
@@ -707,7 +707,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi
                     }\r
                 } else {\r
                     CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-                    Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, FX_LPCWSTR(ws_TempString));\r
+                    Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, ws_TempString.c_str());\r
                     return e;\r
                 }\r
                 break;\r
@@ -738,7 +738,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi
                     }\r
                 } else {\r
                     CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-                    Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER,  FX_LPCWSTR(ws_TempString));\r
+                    Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER,  ws_TempString.c_str());\r
                     return e;\r
                 }\r
                 break;\r
@@ -769,7 +769,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParsePostExpression(CXFA_FMSimpleExpressi
                     }\r
                 } else {\r
                     CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-                    Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER,  FX_LPCWSTR(ws_TempString));\r
+                    Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER,  ws_TempString.c_str());\r
                     return e;\r
                 }\r
                 break;\r
@@ -797,7 +797,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParseIndexExpression()
         NextToken();\r
         if (m_pToken->m_type != TOKrbracket) {\r
             CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-            Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), FX_LPCWSTR(ws_TempString));\r
+            Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str());\r
             if (pExp) {\r
                 delete pExp;\r
                 pExp = 0;\r
@@ -815,7 +815,7 @@ CXFA_FMSimpleExpression *CXFA_FMParse::ParseIndexExpression()
     s = ParseSimpleExpression();\r
     if (m_pToken->m_type != TOKrbracket) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(TOKrparen), ws_TempString.c_str());\r
         if (s) {\r
             delete s;\r
         }\r
@@ -901,7 +901,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseIfExpression()
     CXFA_FMExpression  *pIfExpression = 0;\r
     CXFA_FMExpression  *pElseExpression = 0;\r
     FX_DWORD line = m_pToken->m_uLinenum;\r
-    FX_LPCWSTR pStartPos = m_lexer->SavePos();\r
+    const FX_WCHAR* pStartPos = m_lexer->SavePos();\r
     NextToken();\r
     Check(TOKlparen);\r
     while (m_pToken->m_type != TOKrparen) {\r
@@ -949,7 +949,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseIfExpression()
             break;\r
         default:\r
             CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-            Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IFEND,  FX_LPCWSTR(ws_TempString));\r
+            Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IFEND,  ws_TempString.c_str());\r
             NextToken();\r
             break;\r
     }\r
@@ -997,14 +997,13 @@ CXFA_FMExpression * CXFA_FMParse::ParseWhileExpression()
 CXFA_FMSimpleExpression * CXFA_FMParse::ParseSubassignmentInForExpression()\r
 {\r
     CXFA_FMSimpleExpression *e = 0;\r
-    FX_DWORD line = m_pToken->m_uLinenum;\r
     switch (m_pToken->m_type) {\r
         case TOKidentifier:\r
             e = ParseSimpleExpression();\r
             break;\r
         default:\r
             CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-            Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, FX_LPCWSTR(ws_TempString));\r
+            Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, ws_TempString.c_str());\r
             NextToken();\r
             break;\r
     }\r
@@ -1022,7 +1021,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForExpression()
     NextToken();\r
     if (m_pToken->m_type != TOKidentifier) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str());\r
     }\r
     wsVariant = m_pToken->m_wstring;\r
     NextToken();\r
@@ -1031,7 +1030,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForExpression()
         pAssignment = ParseSimpleExpression();\r
     } else {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str());\r
     }\r
     int32_t iDirection = 0;\r
     if (m_pToken->m_type == TOKupto) {\r
@@ -1040,7 +1039,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForExpression()
         iDirection = -1;\r
     } else {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, L"upto or downto", (FX_LPCWSTR)ws_TempString);\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, L"upto or downto", (const FX_WCHAR*)ws_TempString);\r
     }\r
     NextToken();\r
     pAccessor = ParseSimpleExpression();\r
@@ -1079,7 +1078,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForeachExpression()
     NextToken();\r
     if (m_pToken->m_type != TOKidentifier) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str());\r
     }\r
     wsIdentifier = m_pToken->m_wstring;\r
     NextToken();\r
@@ -1087,7 +1086,7 @@ CXFA_FMExpression * CXFA_FMParse::ParseForeachExpression()
     Check(TOKlparen);\r
     if (m_pToken->m_type == TOKrparen) {\r
         CFX_WideString ws_TempString = m_pToken->m_wstring;\r
-        Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, FX_LPCWSTR(ws_TempString));\r
+        Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, ws_TempString.c_str());\r
         NextToken();\r
     } else {\r
         pAccessors = FX_NEW CFX_PtrArray();\r