From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:16 +0000 (-0700) Subject: lib/file, lib/misc: style commonization X-Git-Tag: stable-10.2.0~425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92e764dc82ee0195e0a4fa2a3d5e2d0dbe252b6f;p=thirdparty%2Fopen-vm-tools.git lib/file, lib/misc: style commonization --- diff --git a/open-vm-tools/lib/misc/codeset.c b/open-vm-tools/lib/misc/codeset.c index da19fc2bd..4a6cf01d9 100644 --- a/open-vm-tools/lib/misc/codeset.c +++ b/open-vm-tools/lib/misc/codeset.c @@ -277,7 +277,7 @@ CodeSetGetModulePath(uint32 priv) } size = readlink("/proc/self/exe", path, sizeof path - 1); - if (-1 == size) { + if (size == -1) { if (priv == HGMP_PRIVILEGE) { Id_EndSuperUser(uid); } @@ -558,11 +558,11 @@ CodeSet_Init(const char *icuDataDir) // IN: ICU data file location in Current co goto exit; } hMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL); - if (NULL == hMapping) { + if (hMapping == NULL) { goto exit; } memMappedData = MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0); - if (NULL == memMappedData) { + if (memMappedData == NULL) { goto exit; } } @@ -943,7 +943,7 @@ CodeSet_GenericToGenericDb(const char *codeIn, // IN * Trivial case. */ - if ((0 == sizeIn) || (NULL == bufIn)) { + if ((sizeIn == 0) || (bufIn == NULL)) { result = TRUE; goto exit; } diff --git a/open-vm-tools/lib/misc/codesetOld.c b/open-vm-tools/lib/misc/codesetOld.c index e4da7b2bb..65c22d339 100644 --- a/open-vm-tools/lib/misc/codesetOld.c +++ b/open-vm-tools/lib/misc/codesetOld.c @@ -348,7 +348,7 @@ CodeSetOldGenericToUtf16leDb(UINT codeIn, // IN: (DynBuf_GetAllocatedSize(db) - initialSize) / sizeof(wchar_t)); - if (0 == result) { + if (result == 0) { error = GetLastError(); // may be ERROR_NO_UNICODE_TRANSLATION } @@ -1032,7 +1032,7 @@ CodeSetOld_GenericToGenericDb(char const *codeIn, // IN: * Trivial case. */ - if ((0 == sizeIn) || (NULL == bufIn)) { + if ((sizeIn == 0) || (bufIn == NULL)) { ret = TRUE; goto exit; } diff --git a/open-vm-tools/lib/misc/escape.c b/open-vm-tools/lib/misc/escape.c index 94f2317ee..28045e18b 100644 --- a/open-vm-tools/lib/misc/escape.c +++ b/open-vm-tools/lib/misc/escape.c @@ -855,7 +855,7 @@ Escape_Comma(const char *string) // IN { DynBuf b; - if (NULL == string) { + if (string == NULL) { return NULL; } diff --git a/open-vm-tools/lib/misc/hashTable.c b/open-vm-tools/lib/misc/hashTable.c index 6a17cce60..6562fe757 100644 --- a/open-vm-tools/lib/misc/hashTable.c +++ b/open-vm-tools/lib/misc/hashTable.c @@ -860,7 +860,7 @@ HashTable_KeyArray(const HashTable *ht, // IN: *keys = NULL; *size = HashTable_GetNumElements(ht); - if (0 == *size) { + if (*size == 0) { return; } @@ -916,7 +916,7 @@ HashTable_ToArray(const HashTable *ht, // IN: *clientDatas = NULL; *size = HashTable_GetNumElements(ht); - if (0 == *size) { + if (*size == 0) { return; } diff --git a/open-vm-tools/lib/misc/hostinfo.c b/open-vm-tools/lib/misc/hostinfo.c index edbc28143..6a0862bfb 100644 --- a/open-vm-tools/lib/misc/hostinfo.c +++ b/open-vm-tools/lib/misc/hostinfo.c @@ -203,7 +203,7 @@ Hostinfo_GetCpuid(HostinfoCpuIdInfo *info) // OUT cpuid.id0.numEntries = id0.eax; - if (0 == cpuid.id0.numEntries) { + if (cpuid.id0.numEntries == 0) { Warning(LGPFX" No CPUID information available.\n"); return FALSE; diff --git a/open-vm-tools/lib/misc/hostinfoHV.c b/open-vm-tools/lib/misc/hostinfoHV.c index afb5f78ba..84a2000c0 100644 --- a/open-vm-tools/lib/misc/hostinfoHV.c +++ b/open-vm-tools/lib/misc/hostinfoHV.c @@ -145,7 +145,7 @@ Hostinfo_TouchXen(void) name[2] = regs.edx; name[3] = 0; - if (0 == strcmp(CPUID_XEN_HYPERVISOR_VENDOR_STRING, (const char*)name)) { + if (strcmp(CPUID_XEN_HYPERVISOR_VENDOR_STRING, (const char*)name) == 0) { return TRUE; }