[RAPPS] Remove string casts after the conutils fix

This commit is contained in:
Mark Jansen 2020-09-20 22:15:47 +02:00
parent d8b5c00c33
commit 3da04a9b68
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -5,14 +5,11 @@
* COPYRIGHT: Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org) * COPYRIGHT: Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
* Copyright 2020 He Yang (1160386205@qq.com) * Copyright 2020 He Yang (1160386205@qq.com)
*/ */
#include "rapps.h" #include "rapps.h"
#include "unattended.h" #include "unattended.h"
#include "winmain.h" #include "winmain.h"
#include <setupapi.h> #include <setupapi.h>
#include <conutils.h> #include <conutils.h>
BOOL MatchCmdOption(LPWSTR argvOption, LPCWSTR szOptToMacth) BOOL MatchCmdOption(LPWSTR argvOption, LPCWSTR szOptToMacth)
@ -119,13 +116,13 @@ BOOL HandleSetupCommand(LPWSTR szCommand, int argcLeft, LPWSTR * argvLeft)
BOOL CALLBACK CmdFindAppEnum(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param) BOOL CALLBACK CmdFindAppEnum(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
{ {
LPCWSTR lpszSearch = (LPCWSTR)param; LPCWSTR lpszSearch = (LPCWSTR)param;
if (!SearchPatternMatch(Info->m_szName.GetString(), lpszSearch) && if (!SearchPatternMatch(Info->m_szName, lpszSearch) &&
!SearchPatternMatch(Info->m_szDesc.GetString(), lpszSearch)) !SearchPatternMatch(Info->m_szDesc, lpszSearch))
{ {
return TRUE; return TRUE;
} }
ConPrintf(StdOut, (LPWSTR)L"%s (%s)\n", (LPCWSTR)(Info->m_szName), (LPCWSTR)(Info->m_szPkgName)); ConPrintf(StdOut, L"%s (%s)\n", Info->m_szName.GetString(), Info->m_szPkgName.GetString());
return TRUE; return TRUE;
} }
@ -144,7 +141,7 @@ BOOL HandleFindCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
{ {
ConResMsgPrintf(StdOut, NULL, IDS_CMD_FIND_RESULT_FOR, argvLeft[i]); ConResMsgPrintf(StdOut, NULL, IDS_CMD_FIND_RESULT_FOR, argvLeft[i]);
apps.Enum(ENUM_ALL_AVAILABLE, CmdFindAppEnum, argvLeft[i]); apps.Enum(ENUM_ALL_AVAILABLE, CmdFindAppEnum, argvLeft[i]);
ConPrintf(StdOut, (LPWSTR)L"\n"); ConPrintf(StdOut, L"\n");
} }
return TRUE; return TRUE;
@ -176,47 +173,47 @@ BOOL HandleInfoCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
// is in a mess. It should be refactored, and should not placed in class CAppRichEdit. // is in a mess. It should be refactored, and should not placed in class CAppRichEdit.
// and the code here should reused that code after refactor. // and the code here should reused that code after refactor.
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szName); ConPuts(StdOut, AppInfo->m_szName);
if (AppInfo->m_szVersion) if (AppInfo->m_szVersion)
{ {
ConResPrintf(StdOut, IDS_AINFO_VERSION); ConResPrintf(StdOut, IDS_AINFO_VERSION);
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szVersion); ConPuts(StdOut, AppInfo->m_szVersion);
} }
if (AppInfo->m_szLicense) if (AppInfo->m_szLicense)
{ {
ConResPrintf(StdOut, IDS_AINFO_LICENSE); ConResPrintf(StdOut, IDS_AINFO_LICENSE);
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szLicense); ConPuts(StdOut, AppInfo->m_szLicense);
} }
if (AppInfo->m_szSize) if (AppInfo->m_szSize)
{ {
ConResPrintf(StdOut, IDS_AINFO_SIZE); ConResPrintf(StdOut, IDS_AINFO_SIZE);
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szSize); ConPuts(StdOut, AppInfo->m_szSize);
} }
if (AppInfo->m_szUrlSite) if (AppInfo->m_szUrlSite)
{ {
ConResPrintf(StdOut, IDS_AINFO_URLSITE); ConResPrintf(StdOut, IDS_AINFO_URLSITE);
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szUrlSite); ConPuts(StdOut, AppInfo->m_szUrlSite);
} }
if (AppInfo->m_szDesc) if (AppInfo->m_szDesc)
{ {
ConResPrintf(StdOut, IDS_AINFO_DESCRIPTION); ConResPrintf(StdOut, IDS_AINFO_DESCRIPTION);
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szDesc); ConPuts(StdOut, AppInfo->m_szDesc);
} }
if (AppInfo->m_szUrlDownload) if (AppInfo->m_szUrlDownload)
{ {
ConResPrintf(StdOut, IDS_AINFO_URLDOWNLOAD); ConResPrintf(StdOut, IDS_AINFO_URLDOWNLOAD);
ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szUrlDownload); ConPuts(StdOut, AppInfo->m_szUrlDownload);
} }
ConPrintf(StdOut, (LPWSTR)L"\n"); ConPrintf(StdOut, L"\n");
} }
ConPrintf(StdOut, (LPWSTR)L"\n"); ConPrintf(StdOut, L"\n");
} }
return TRUE; return TRUE;
} }
@ -228,12 +225,12 @@ BOOL HandleHelpCommand(LPWSTR szCommand, int argcLeft, LPWSTR * argvLeft)
return FALSE; return FALSE;
} }
ConPrintf(StdOut, (LPWSTR)L"\n"); ConPrintf(StdOut, L"\n");
ConResPuts(StdOut, IDS_APPTITLE); ConResPuts(StdOut, IDS_APPTITLE);
ConPrintf(StdOut, (LPWSTR)L"\n\n"); ConPrintf(StdOut, L"\n\n");
ConResPuts(StdOut, IDS_CMD_USAGE); ConResPuts(StdOut, IDS_CMD_USAGE);
ConPrintf(StdOut, (LPWSTR)L"%ls\n", UsageString); ConPrintf(StdOut, L"%ls\n", UsageString);
return TRUE; return TRUE;
} }