[FORMATTING][RAPPS] available.cpp: Fix braces

svn path=/branches/GSoC_2017/rapps/; revision=75220
This commit is contained in:
Alexander Shaposhnikov 2017-06-27 23:33:15 +00:00
parent 17e36ed120
commit de725c5391

View file

@ -9,7 +9,8 @@
#include "rapps.h"
inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) {
inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d)
{
if (b[0] != '\0')
{
WCHAR szText[MAX_STR_LEN];
@ -19,7 +20,8 @@ inline void _AddText(UINT a, LPCWSTR b, DWORD c, DWORD d) {
}
}
inline void _AddTextNewl(UINT a, DWORD b) {
inline void _AddTextNewl(UINT a, DWORD b)
{
WCHAR szText[MAX_STR_LEN];
LoadStringW(hInst, a, szText, _countof(szText));
InsertRichEditText(L"\n", 0);
@ -28,13 +30,16 @@ inline void _AddTextNewl(UINT a, DWORD b) {
}
template<typename T, size_t N, size_t N2>
inline BOOL _GetString(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) {
inline BOOL _GetString(LPCWSTR a, T(&b)[N], T(&cFileName)[N2])
{
return ParserGetString(a, b, N, cFileName);
}
template<typename T, size_t N, size_t N2>
inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T (&cFileName)[N2]) {
if (!_GetString(a, b, cFileName)) {
inline void _GetStringNullFailure(LPCWSTR a, T(&b)[N], T(&cFileName)[N2])
{
if (!_GetString(a, b, cFileName))
{
b[0] = '\0';
}
}
@ -52,7 +57,8 @@ inline BOOL _AppInstallCheckWithKey(PAPPLICATION_INFO Info, REGSAM key)
//Check both registry keys in 64bit system
//TODO: check system type beforehand to avoid double checks?
inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info) {
inline BOOL _AppInstallCheck(PAPPLICATION_INFO Info)
{
return _AppInstallCheckWithKey(Info, KEY_WOW64_32KEY)
|| _AppInstallCheckWithKey(Info, KEY_WOW64_64KEY);
}
@ -74,7 +80,7 @@ inline BOOL _GetInstalledVersion(PAPPLICATION_INFO Info, LPWSTR szVersion, UINT
|| _GetInstalledVersionWithKey(Info, szVersion, iVersionSize, KEY_WOW64_64KEY);
}
LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead };
LIST_ENTRY CachedEntriesHead = {&CachedEntriesHead, &CachedEntriesHead};
PLIST_ENTRY pCachedEntry = &CachedEntriesHead;
BOOL
@ -94,7 +100,8 @@ ShowAvailableAppInfo(INT Index)
{
_AddText(IDS_AINFO_VERSION, szVersion, CFE_BOLD, 0);
}
} else
}
else
{
_AddTextNewl(IDS_STATUS_NOTINSTALLED, CFE_ITALIC);
}
@ -157,7 +164,8 @@ DeleteCurrentAppsDB(VOID)
continue;
result = result && DeleteFileW(szTmp);
} while (FindNextFileW(hFind, &FindFileData) != 0);
}
while (FindNextFileW(hFind, &FindFileData) != 0);
FindClose(hFind);
@ -263,7 +271,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List);
/* do we already have this entry in cache? */
if(_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0)
if (_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0)
{
/* is it current enough, or the file has been modified since our last time here? */
if (CompareFileTime(&FindFileData.ftLastWriteTime, &Info->ftCacheStamp) == 1)
@ -283,9 +291,9 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
}
/* create a new entry */
Info = (PAPPLICATION_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO));
Info = (PAPPLICATION_INFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO));
if(!Info)
if (!Info)
break;
Info->Category = ParserGetInt(L"Category", FindFileData.cFileName);
@ -297,7 +305,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
/* add our cached entry to the cached list */
InsertTailList(&CachedEntriesHead, &Info->List);
skip_if_cached:
skip_if_cached:
if (Info->Category == FALSE)
continue;
@ -329,7 +337,8 @@ skip_if_cached:
if (!lpEnumProc(Info))
break;
} while (FindNextFileW(hFind, &FindFileData) != 0);
}
while (FindNextFileW(hFind, &FindFileData) != 0);
FindClose(hFind);