Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 2015 21:21:11 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r381235 - in head/emulators: virtualbox-ose virtualbox-ose-additions virtualbox-ose/files
Message-ID:  <201503132121.t2DLLB1J015162@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Fri Mar 13 21:21:10 2015
New Revision: 381235
URL: https://svnweb.freebsd.org/changeset/ports/381235
QAT: https://qat.redports.org/buildarchive/r381235/

Log:
  Fix several bugs found by Clang.  Note few patches were obtained from
  upstream.  Other patches were submitted to upstream.

Added:
  head/emulators/virtualbox-ose/files/patch-include-VBox-com-array.h   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Input-PS2M.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-USB-DevOHCI.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VBoxManage-VBoxManageModifyVM.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VirtualBox-src-runtime-UIKeyboardHandler.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-checksum-manifest3.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-dbg-dbgmodcodeview.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-ldr-ldrELFRelocatable.cpp.h   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-CPUMR3CpuId.cpp   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-PDMDriver.cpp   (contents, props changed)
Modified:
  head/emulators/virtualbox-ose-additions/Makefile
  head/emulators/virtualbox-ose/Makefile
  head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-client-ConsoleImpl2.cpp

Modified: head/emulators/virtualbox-ose-additions/Makefile
==============================================================================
--- head/emulators/virtualbox-ose-additions/Makefile	Fri Mar 13 21:18:21 2015	(r381234)
+++ head/emulators/virtualbox-ose-additions/Makefile	Fri Mar 13 21:21:10 2015	(r381235)
@@ -3,7 +3,7 @@
 
 PORTNAME=	virtualbox-ose
 DISTVERSION=	4.3.24
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	emulators
 MASTER_SITES=	http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
 		http://tmp.chruetertee.ch/ \

Modified: head/emulators/virtualbox-ose/Makefile
==============================================================================
--- head/emulators/virtualbox-ose/Makefile	Fri Mar 13 21:18:21 2015	(r381234)
+++ head/emulators/virtualbox-ose/Makefile	Fri Mar 13 21:21:10 2015	(r381235)
@@ -3,7 +3,7 @@
 
 PORTNAME=	virtualbox-ose
 DISTVERSION=	4.3.24
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	emulators
 MASTER_SITES=	http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
 		http://tmp.chruetertee.ch/ \

Added: head/emulators/virtualbox-ose/files/patch-include-VBox-com-array.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-include-VBox-com-array.h	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,29 @@
+--- include/VBox/com/array.h.orig	2015-03-02 10:06:38.000000000 -0500
++++ include/VBox/com/array.h	2015-03-12 17:52:37.107759000 -0400
+@@ -908,12 +908,12 @@
+      */
+     const T operator[] (size_t aIdx) const
+     {
+-        AssertReturn(m.arr != NULL,  *((T *)NULL));
+-        AssertReturn(aIdx < size(), *((T *)NULL));
++        Assert(m.arr != NULL);
++        Assert(aIdx < size());
+ #ifdef VBOX_WITH_XPCOM
+         return m.arr[aIdx];
+ #else
+-        AssertReturn(m.raw != NULL,  *((T *)NULL));
++        Assert(m.raw != NULL);
+         return m.raw[aIdx];
+ #endif
+     }
+@@ -1409,8 +1409,8 @@
+      */
+     const nsID &operator[] (size_t aIdx) const
+     {
+-        AssertReturn(m.arr != NULL,  **((const nsID * *)NULL));
+-        AssertReturn(aIdx < size(), **((const nsID * *)NULL));
++        Assert(m.arr != NULL);
++        Assert(aIdx < size());
+         return *m.arr[aIdx];
+     }
+ 

Added: head/emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,11 @@
+--- include/VBox/vmm/cpumctx.h.orig	2015-03-12 18:53:45.762704000 -0400
++++ include/VBox/vmm/cpumctx.h	2015-03-12 18:56:23.765105000 -0400
+@@ -84,7 +84,7 @@
+ # define CPUMSELREG_ARE_HIDDEN_PARTS_VALID(a_pVCpu, a_pSelReg) \
+     (   ((a_pSelReg)->fFlags & CPUMSELREG_FLAGS_VALID) \
+      && (   (a_pSelReg)->ValidSel == (a_pSelReg)->Sel \
+-         || (   (a_pVCpu) /*!= NULL*/ \
++         || (   ((a_pVCpu) != NULL) \
+              && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_OFF_RPL) \
+              && ((a_pSelReg)->Sel      & X86_SEL_RPL) == 1 \
+              && ((a_pSelReg)->ValidSel & X86_SEL_RPL) == 0 \

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Input-PS2M.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-Input-PS2M.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,13 @@
+--- src/VBox/Devices/Input/PS2M.cpp.orig	2015-03-02 10:09:15.000000000 -0500
++++ src/VBox/Devices/Input/PS2M.cpp	2015-03-12 18:44:38.787177000 -0400
+@@ -712,8 +712,8 @@
+     int8_t      dX, dY, dZ;
+ 
+     /* Clamp the accumulated delta values to the allowed range. */
+-    dX = RT_MIN(RT_MAX(pThis->iAccumX, -256), 255);
+-    dY = RT_MIN(RT_MAX(pThis->iAccumY, -256), 255);
++    dX = RT_MIN(RT_MAX(pThis->iAccumX, -128), 127);
++    dY = RT_MIN(RT_MAX(pThis->iAccumY, -128), 127);
+     dZ = RT_MIN(RT_MAX(pThis->iAccumZ, -8), 7);
+ 
+     /* Start with the sync bit and buttons 1-3. */

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-USB-DevOHCI.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Devices-USB-DevOHCI.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,11 @@
+--- src/VBox/Devices/USB/DevOHCI.cpp.orig	2015-03-02 10:09:35.000000000 -0500
++++ src/VBox/Devices/USB/DevOHCI.cpp	2015-03-12 16:15:51.519656000 -0400
+@@ -3717,7 +3717,7 @@
+             pUrb = pThis->aInFlight[i].pUrb;
+             if (pThis->aInFlight[i].fInactive
+                 && pUrb->enmState == VUSBURBSTATE_IN_FLIGHT
+-                && !pUrb->enmType == VUSBXFERTYPE_CTRL)
++                && pUrb->enmType != VUSBXFERTYPE_CTRL)
+                 pThis->RootHub.pIRhConn->pfnCancelUrbsEp(pThis->RootHub.pIRhConn, pUrb);
+         }
+     }

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VBoxManage-VBoxManageModifyVM.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VBoxManage-VBoxManageModifyVM.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,11 @@
+--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig	2015-03-02 10:09:37.000000000 -0500
++++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	2015-03-12 18:33:09.348465000 -0400
+@@ -1732,7 +1732,7 @@
+                 CHECK_ERROR(nic, COMGETTER(NATEngine)(engine.asOutParam()));
+ 
+                 uint32_t aliasMode = 0;
+-                if (!RTStrCmp(ValueUnion.psz, "default") == 0)
++                if (RTStrCmp(ValueUnion.psz, "default") != 0)
+                 {
+                     char *token = (char *)ValueUnion.psz;
+                     while(token)

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VirtualBox-src-runtime-UIKeyboardHandler.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Frontends-VirtualBox-src-runtime-UIKeyboardHandler.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,20 @@
+--- src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp.orig	2015-03-02 10:09:41.000000000 -0500
++++ src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	2015-03-12 17:11:33.029804000 -0400
+@@ -622,7 +622,7 @@
+             unsigned scan = handleXKeyEvent(pEvent);
+ 
+             /* Scancodes 0x00 (no valid translation) and 0x80 are ignored: */
+-            if (!scan & 0x7F)
++            if (!(scan & 0x7F))
+             {
+                 fResult = true;
+                 break;
+@@ -1603,7 +1603,7 @@
+     {
+         KeySym ks = wrapXkbKeycodeToKeysym(pDisplay, keyCode, i, 0);
+         char symbol = 0;
+-        if (!XkbTranslateKeySym(pDisplay, &ks, 0, &symbol, 1, NULL) == 1)
++        if (XkbTranslateKeySym(pDisplay, &ks, 0, &symbol, 1, NULL) == 0)
+             symbol = 0;
+         if (symbol)
+         {

Modified: head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-client-ConsoleImpl2.cpp
==============================================================================
--- head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-client-ConsoleImpl2.cpp	Fri Mar 13 21:18:21 2015	(r381234)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-client-ConsoleImpl2.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -1,36 +1,34 @@
---- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig	2013-09-06 08:30:10.000000000 -0400
-+++ src/VBox/Main/src-client/ConsoleImpl2.cpp	2013-09-12 13:03:34.000000000 -0400
-@@ -4031,12 +4031,13 @@
+--- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig	2015-03-02 10:09:53.000000000 -0500
++++ src/VBox/Main/src-client/ConsoleImpl2.cpp	2015-03-13 12:49:53.780376000 -0400
+@@ -4447,12 +4447,12 @@
                      }
                  }
  
 -                Assert((int)maTapFD[uInstance] >= 0);
 -                if ((int)maTapFD[uInstance] >= 0)
-+                const int fd = (int)(uintptr_t)maTapFD[uInstance];
-+                Assert(fd >= 0);
-+                if (fd >= 0)
++                Assert((intptr_t)maTapFD[uInstance] >= 0);
++                if ((intptr_t)maTapFD[uInstance] >= 0)
                  {
                      InsertConfigString(pLunL0, "Driver", "HostInterface");
                      InsertConfigNode(pLunL0, "Config", &pCfg);
 -                    InsertConfigInteger(pCfg, "FileHandle", maTapFD[uInstance]);
-+                    InsertConfigInteger(pCfg, "FileHandle", fd);
++                    InsertConfigInteger(pCfg, "FileHandle", (intptr_t)maTapFD[uInstance]);
                  }
  
  #elif defined(VBOX_WITH_NETFLT)
-@@ -4230,12 +4231,13 @@
+@@ -4646,12 +4646,12 @@
                          }
                      }
  
 -                    Assert((int)maTapFD[uInstance] >= 0);
 -                    if ((int)maTapFD[uInstance] >= 0)
-+                    const int fd = (int)(uintptr_t)maTapFD[uInstance];
-+                    Assert(fd >= 0);
-+                    if (fd >= 0)
++                    Assert((intptr_t)maTapFD[uInstance] >= 0);
++                    if ((intptr_t)maTapFD[uInstance] >= 0)
                      {
                          InsertConfigString(pLunL0, "Driver", "HostInterface");
                          InsertConfigNode(pLunL0, "Config", &pCfg);
 -                        InsertConfigInteger(pCfg, "FileHandle", maTapFD[uInstance]);
-+                        InsertConfigInteger(pCfg, "FileHandle", fd);
++                        InsertConfigInteger(pCfg, "FileHandle", (intptr_t)maTapFD[uInstance]);
                      }
                      break;
                  }

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,17 @@
+--- src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp.orig	2015-03-02 10:09:55.000000000 -0500
++++ src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp	2015-03-12 19:23:15.950051000 -0400
+@@ -290,12 +290,14 @@
+             ComObjPtr<HostNetworkInterface> IfObj;
+             IfObj.createObject();
+             if (SUCCEEDED(IfObj->init(Bstr(pNew->szName), enmType, pNew)))
++            {
+                 /* Make sure the default interface gets to the beginning. */
+                 if (   fDefaultIfaceExistent
+                     && pIfMsg->ifm_index == u16DefaultIface)
+                     list.push_front(IfObj);
+                 else
+                     list.push_back(IfObj);
++            }
+         }
+         RTMemFree(pNew);
+     }

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-checksum-manifest3.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-checksum-manifest3.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,11 @@
+--- src/VBox/Runtime/common/checksum/manifest3.cpp.orig	2015-03-02 10:09:59.000000000 -0500
++++ src/VBox/Runtime/common/checksum/manifest3.cpp	2015-03-12 15:40:09.008443000 -0400
+@@ -427,7 +427,7 @@
+     uint32_t cRefs = RTManifestRetain(hManifest);
+     AssertReturn(cRefs != UINT32_MAX, VERR_INVALID_HANDLE);
+     cRefs = RTVfsIoStrmRetain(hVfsIos);
+-    AssertReturnStmt(cRefs != UINT32_MAX, VERR_INVALID_HANDLE, RTManifestRelease(hManifest));
++    AssertReturnStmt(cRefs != UINT32_MAX, RTManifestRelease(hManifest), VERR_INVALID_HANDLE);
+ 
+     /*
+      * Create an instace of the passthru I/O stream.

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-dbg-dbgmodcodeview.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-dbg-dbgmodcodeview.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,11 @@
+--- src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp.orig	2015-03-02 10:10:00.000000000 -0500
++++ src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp	2015-03-12 16:22:25.459078000 -0400
+@@ -2717,7 +2717,7 @@
+         {
+             /* Try the executable in case it has a NBxx tail header. */
+             rc2 = rtDbgModCvProbeFile(pMod, pMod->pszImgFile, enmArch);
+-            if (RT_FAILURE(rc2) && (RT_SUCCESS(rc) || VERR_DBG_NO_MATCHING_INTERPRETER))
++            if (RT_FAILURE(rc2) && (RT_SUCCESS(rc) || rc == VERR_DBG_NO_MATCHING_INTERPRETER))
+                 rc = rc2;
+         }
+     }

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-ldr-ldrELFRelocatable.cpp.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-common-ldr-ldrELFRelocatable.cpp.h	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,11 @@
+--- src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h.orig	2015-03-02 10:10:00.000000000 -0500
++++ src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h	2015-03-12 15:59:41.932947000 -0400
+@@ -249,7 +249,7 @@
+         }
+         else
+         {
+-            AssertReturn(pSym->st_shndx < pModElf->cSyms || pSym->st_shndx == SHN_ABS, ("%#x\n", pSym->st_shndx));
++            AssertMsg(pSym->st_shndx < pModElf->cSyms || pSym->st_shndx == SHN_ABS, ("%#x\n", pSym->st_shndx));
+ #if   ELF_MODE == 64
+             SymValue = pSym->st_value;
+ #endif

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-CPUMR3CpuId.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-CPUMR3CpuId.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,27 @@
+--- src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp.orig	2015-03-02 10:10:12.000000000 -0500
++++ src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp	2015-03-12 18:58:11.784386000 -0400
+@@ -146,15 +146,15 @@
+             case 0x06:
+                 switch (bModel)
+                 {
+-                    case  0: kCpumMicroarch_AMD_K7_Palomino;
+-                    case  1: kCpumMicroarch_AMD_K7_Palomino;
+-                    case  2: kCpumMicroarch_AMD_K7_Palomino;
+-                    case  3: kCpumMicroarch_AMD_K7_Spitfire;
+-                    case  4: kCpumMicroarch_AMD_K7_Thunderbird;
+-                    case  6: kCpumMicroarch_AMD_K7_Palomino;
+-                    case  7: kCpumMicroarch_AMD_K7_Morgan;
+-                    case  8: kCpumMicroarch_AMD_K7_Thoroughbred;
+-                    case 10: kCpumMicroarch_AMD_K7_Barton; /* Thorton too. */
++                    case  0: return kCpumMicroarch_AMD_K7_Palomino;
++                    case  1: return kCpumMicroarch_AMD_K7_Palomino;
++                    case  2: return kCpumMicroarch_AMD_K7_Palomino;
++                    case  3: return kCpumMicroarch_AMD_K7_Spitfire;
++                    case  4: return kCpumMicroarch_AMD_K7_Thunderbird;
++                    case  6: return kCpumMicroarch_AMD_K7_Palomino;
++                    case  7: return kCpumMicroarch_AMD_K7_Morgan;
++                    case  8: return kCpumMicroarch_AMD_K7_Thoroughbred;
++                    case 10: return kCpumMicroarch_AMD_K7_Barton; /* Thorton too. */
+                 }
+                 return kCpumMicroarch_AMD_K7_Unknown;
+             case 0x0f:

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-PDMDriver.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-VMM-VMMR3-PDMDriver.cpp	Fri Mar 13 21:21:10 2015	(r381235)
@@ -0,0 +1,15 @@
+--- src/VBox/VMM/VMMR3/PDMDriver.cpp.orig	2015-03-02 10:10:12.000000000 -0500
++++ src/VBox/VMM/VMMR3/PDMDriver.cpp	2015-03-12 20:01:00.170988000 -0400
+@@ -512,11 +512,7 @@
+                 AssertLogRelRCReturn(rc, rc);
+ 
+                 rc = CFGMR3ReplaceSubTree(*ppNode, pBelowThisCopy);
+-                if (RT_FAILURE(rc))
+-                {
+-                    CFGMR3RemoveNode(pBelowThis);
+-                    AssertLogRelReturn(("rc=%Rrc\n", rc), rc);
+-                }
++                AssertLogRelRCReturnStmt(rc, CFGMR3RemoveNode(pBelowThis), rc);
+             }
+         }
+         /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503132121.t2DLLB1J015162>