]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/file, lib/misc: style commonization
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:16 +0000 (11:23 -0700)
open-vm-tools/lib/misc/codeset.c
open-vm-tools/lib/misc/codesetOld.c
open-vm-tools/lib/misc/escape.c
open-vm-tools/lib/misc/hashTable.c
open-vm-tools/lib/misc/hostinfo.c
open-vm-tools/lib/misc/hostinfoHV.c

index da19fc2bd361a43b41be870b0e97032c8eb0f460..4a6cf01d9db459ee94b1830d88cdfa32be2ff993 100644 (file)
@@ -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;
    }
index e4da7b2bb19ec196e70f03ac263d7060705bb103..65c22d3397f0e3de1d283a92007cd0840432008d 100644 (file)
@@ -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;
    }
index 94f2317eef1809e3df6fae2bb8d017f451be2e2d..28045e18b0ea65a64a90688f3514b3c539c7b01f 100644 (file)
@@ -855,7 +855,7 @@ Escape_Comma(const char *string) // IN
 {
    DynBuf b;
 
-   if (NULL == string) {
+   if (string == NULL) {
       return NULL;
    }
 
index 6a17cce601994bc44db7de38eee235e0c4628edc..6562fe757bb76ea294e126e7b9e4f4d16ef39276 100644 (file)
@@ -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;
    }
 
index edbc281435306c291ce36bb12f50f225a6ce97fb..6a0862bfb929bde79eaf2d59a8f8b56f08bacd4d 100644 (file)
@@ -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;
index afb5f78ba0ea24822ca593f055f93013537de58a..84a2000c0c2b78fa537e54d0a1a6834fe8b5a19f 100644 (file)
@@ -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;
    }