Index: /trunk/src/VBox/Main/include/USBIdDatabase.h
===================================================================
--- /trunk/src/VBox/Main/include/USBIdDatabase.h	(revision 57999)
+++ /trunk/src/VBox/Main/include/USBIdDatabase.h	(revision 58000)
@@ -1,15 +1,21 @@
+/* $Id$ */
+/** @file
+ * USB device vendor and product ID database.
+ */
+
 /*
-* Copyright (C) 2015 Oracle Corporation
-*
-* This file is part of VirtualBox Open Source Edition (OSE), as
-* available from http://www.virtualbox.org. This file is free software;
-* you can redistribute it and/or modify it under the terms of the GNU
-* General Public License (GPL) as published by the Free Software
-* Foundation, in version 2 as it comes in the "COPYING" file of the
-* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-*/
+ * Copyright (C) 2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
 
-#pragma once
+#ifndef ___USBIdDatabase_h
+#define ___USBIdDatabase_h
 
 #include <vector>
@@ -19,26 +25,26 @@
 
 /**
-* Macros to make key of alias table
-*/
+ * Macros to make key of alias table
+ */
 #define USBKEY(vendorId, productId) (((uint32_t)(vendorId) << 16) | (productId))
 
 /**
-* Elements of Aliases table
-*/
+ * Elements of Aliases table
+ */
 class Product
 {
 public:
     uint32_t key;
-    const char* product;
+    const char *product;
 };
 
 /**
-* Element of Vendors table
-*/
+ * Element of Vendors table
+ */
 class Vendor
 {
 public:
     unsigned short vendorID;
-    const char* vendor;
+    const char *vendor;
 };
 
@@ -53,6 +59,6 @@
 };
 
-class VendorLess :
-    public std::binary_function<Vendor, Vendor, bool>
+class VendorLess
+    : public std::binary_function<Vendor, Vendor, bool>
 {
 public:
@@ -65,6 +71,6 @@
 
 /**
-* Wrapper for static array of Aliases.
-*/
+ * Wrapper for static array of Aliases.
+ */
 class AliasDictionary
 {
@@ -76,5 +82,5 @@
 
 public:
-    static const char* findProduct(unsigned short vendorId, unsigned short productId)
+    static const char *findProduct(unsigned short vendorId, unsigned short productId)
     {
         Product lookFor = { USBKEY(vendorId, productId) };
@@ -83,5 +89,5 @@
     }
 
-    static const char* findVendor(unsigned short vendorID)
+    static const char *findVendor(unsigned short vendorID)
     {
         Vendor lookFor = { vendorID };
@@ -90,2 +96,5 @@
     }
 };
+
+#endif
+
Index: /trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp	(revision 57999)
+++ /trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp	(revision 58000)
@@ -170,5 +170,5 @@
     if (mUsb->pszManufacturer == NULL || mUsb->pszManufacturer[0] == 0)
     {
-        const char* vendorName = AliasDictionary::findVendor(mUsb->idVendor);
+        const char *vendorName = AliasDictionary::findVendor(mUsb->idVendor);
         if (vendorName)
             aManufacturer = vendorName;
@@ -185,5 +185,5 @@
     if (mUsb->pszProduct == NULL || mUsb->pszProduct[0] == 0)
     {
-        const char* productName = AliasDictionary::findProduct(mUsb->idVendor, mUsb->idProduct);
+        const char *productName = AliasDictionary::findProduct(mUsb->idVendor, mUsb->idProduct);
         if (productName)
             aProduct = productName;
@@ -335,19 +335,23 @@
         name = Utf8StrFmt("%s %s", mUsb->pszManufacturer, mUsb->pszProduct);
     else if (haveManufacturer)
-        name = Utf8StrFmt("%s", mUsb->pszManufacturer);
+        name = mUsb->pszManufacturer;
     else if (haveProduct)
-        name = Utf8StrFmt("%s", mUsb->pszProduct);
+        name = mUsb->pszProduct;
     else
     {
-        const char* vendorName = AliasDictionary::findVendor(mUsb->idVendor);
-        const char* productName = AliasDictionary::findProduct(mUsb->idVendor, mUsb->idProduct);
-        if (vendorName && productName)
-        {
-            name = Utf8StrFmt("%s %s", vendorName, productName);
-        }
+        const char *pszVendorName  = AliasDictionary::findVendor(mUsb->idVendor);
+        const char *pszProductName = AliasDictionary::findProduct(mUsb->idVendor, mUsb->idProduct);
+        if (pszVendorName && pszProductName)
+            name = Utf8StrFmt("%s %s", pszVendorName, pszProductName);
         else
         {
-            name = "<unknown>";
-            LogRel(("USB: Unknown USB device detected (idVendor: 0x%04x, idProduct: 0x%04x). Please, report the idVendor and idProduct to virtualbox.org.\n", vendorName, productName));
+            LogRel(("USB: Unknown USB device detected (idVendor: 0x%04x, idProduct: 0x%04x). Please, report the idVendor and idProduct to virtualbox.org.\n",
+                    mUsb->idVendor, mUsb->idProduct));
+            if (pszVendorName)
+                name = pszVendorName;
+            else if (pszProductName)
+                name = pszProductName;
+            else
+                name = "<unknown>";
         }
     }
Index: /trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp	(revision 57999)
+++ /trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp	(revision 58000)
@@ -1,13 +1,18 @@
+/* $Id$ */
+/** @file
+ * USB device vendor and product ID database - generator.
+ */
+
 /*
-* Copyright (C) 2006-2015 Oracle Corporation
-*
-* This file is part of VirtualBox Open Source Edition (OSE), as
-* available from http://www.virtualbox.org. This file is free software;
-* you can redistribute it and/or modify it under the terms of the GNU
-* General Public License (GPL) as published by the Free Software
-* Foundation, in version 2 as it comes in the "COPYING" file of the
-* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-*/
+ * Copyright (C) 2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
 
 #include <stdio.h>
@@ -26,7 +31,11 @@
 using namespace std;
 
-const char *header =
+static const char * const header =
+    "/** @file\n"
+    " * USB device vendor and product ID database - Autogenerated from <stupid C++ cannot do %s>\n"
+    " */\n"
+    "\n"
     "/*\n"
-    " * Copyright(C) 2015 Oracle Corporation\n"
+    " * Copyright (C) 2015 Oracle Corporation\n"
     " *\n"
     " * This file is part of VirtualBox Open Source Edition(OSE), as\n"
@@ -116,28 +125,28 @@
         switch (res[i])
         {
-        case '"':
-        case '\\': res.insert(i++, "\\"); break;
-        default:
-        {
-            // encode multibyte UTF-8 symbols to be sure that they 
-            // will be safely read by compiler
-            if ((unsigned char)res[i] >= 127)
+            case '"':
+            case '\\': res.insert(i++, "\\"); break;
+            default:
             {
-                size_t start = i;
-                string temp = "\" \"";
-                char buffer[8] = { 0 };
-                do
+                // encode multibyte UTF-8 symbols to be sure that they
+                // will be safely read by compiler
+                if ((unsigned char)res[i] >= 127)
                 {
-                    RTStrPrintf(buffer, sizeof(buffer), "\\x%x", (unsigned char)res[i]);
-                    temp.append(buffer);
-                } while ((unsigned char)res[++i] & 0x80);
-                // splitting string after escape sequence to finish number sequence 
-                // otherwise it could lead to situation when "\x88a" will threathened as 
-                // multibyte symbol '\x88a' instead of two symbols '\x88' and 'a'
-                temp.append("\" \"");
-                res.replace(start, i - start, temp);
-                i += temp.length();
+                    size_t start = i;
+                    string temp = "\" \"";
+                    char buffer[8] = { 0 };
+                    do
+                    {
+                        RTStrPrintf(buffer, sizeof(buffer), "\\x%x", (unsigned char)res[i]);
+                        temp.append(buffer);
+                    } while ((unsigned char)res[++i] & 0x80);
+                    // splitting string after escape sequence to finish number sequence
+                    // otherwise it could lead to situation when "\x88a" will threathened as
+                    // multibyte symbol '\x88a' instead of two symbols '\x88' and 'a'
+                    temp.append("\" \"");
+                    res.replace(start, i - start, temp);
+                    i += temp.length();
+                }
             }
-        }
         }
     }
@@ -234,54 +243,54 @@
         switch (state)
         {
-        case State::lookForStartBlock:
-        {
-            if (line.find(start_block) != string::npos)
-                state = State::lookForEndBlock;
-            break;
-        }
-        case State::lookForEndBlock:
-        {
-            if (line.find(end_block) != string::npos)
-                state = State::finished;
-            else
+            case State::lookForStartBlock:
             {
-                if (!IsCommentOrEmptyLine(line))
+                if (line.find(start_block) != string::npos)
+                    state = State::lookForEndBlock;
+                break;
+            }
+            case State::lookForEndBlock:
+            {
+                if (line.find(end_block) != string::npos)
+                    state = State::finished;
+                else
                 {
-                    if (line[0] == '\t')
+                    if (!IsCommentOrEmptyLine(line))
                     {
-                        // Parse Product line
-                        // first line should be vendor
-                        if (vendor.vendorID == 0)
+                        if (line[0] == '\t')
                         {
-                            cerr << "Wrong file format. Product before vendor: "
-                                << line.c_str() << "'" << endl;
-                            return ERROR_WRONG_FILE_FORMAT;
+                            // Parse Product line
+                            // first line should be vendor
+                            if (vendor.vendorID == 0)
+                            {
+                                cerr << "Wrong file format. Product before vendor: "
+                                    << line.c_str() << "'" << endl;
+                                return ERROR_WRONG_FILE_FORMAT;
+                            }
+                            ProductRecord product = { 0, vendor.vendorID, 0, "" };
+                            if (ParseAlias(line.substr(1), product.productID, product.product) != 0)
+                            {
+                                cerr << "Error in parsing product line: '"
+                                    << line.c_str() << "'" << endl;
+                                return ERROR_IN_PARSE_LINE;
+                            }
+                            product.key = USBKEY(product.vendorID, product.productID);
+                            Assert(product.vendorID != 0);
+                            g_products.push_back(product);
                         }
-                        ProductRecord product = { 0, vendor.vendorID, 0, "" };
-                        if (ParseAlias(line.substr(1), product.productID, product.product) != 0)
+                        else
                         {
-                            cerr << "Error in parsing product line: '"
-                                << line.c_str() << "'" << endl;
-                            return ERROR_IN_PARSE_LINE;
+                            // Parse vendor line
+                            if (ParseAlias(line, vendor.vendorID, vendor.vendor) != 0)
+                            {
+                                cerr << "Error in parsing vendor line: '"
+                                    << line.c_str() << "'" << endl;
+                                return ERROR_IN_PARSE_LINE;
+                            }
+                            g_vendors.push_back(vendor);
                         }
-                        product.key = USBKEY(product.vendorID, product.productID);
-                        Assert(product.vendorID != 0);
-                        g_products.push_back(product);
-                    }
-                    else
-                    {
-                        // Parse vendor line
-                        if (ParseAlias(line, vendor.vendorID, vendor.vendor) != 0)
-                        {
-                            cerr << "Error in parsing vendor line: '"
-                                << line.c_str() << "'" << endl;
-                            return ERROR_IN_PARSE_LINE;
-                        }
-                        g_vendors.push_back(vendor);
                     }
                 }
+                break;
             }
-            break;
-        }
         }
     }
@@ -294,5 +303,5 @@
 }
 
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
 {
     int rc = RTR3InitExe(argc, &argv, 0);
@@ -312,6 +321,5 @@
     g_vendors.reserve(3500);
 
-    char* outName = NULL;
-    rc = 0;
+    const char *outName = NULL;
     for (int i = 1; i < argc; i++)
     {
@@ -322,5 +330,6 @@
         }
 
-        if (RT_FAILURE(rc = RTStrmOpen(argv[i], "r", &fin)))
+        rc = RTStrmOpen(argv[i], "r", &fin);
+        if (RT_FAILURE(rc))
         {
             cerr << "Format: " << argv[0] <<
@@ -349,4 +358,6 @@
     {
         cerr << "Warning: Duplicate alias detected. " << *ita << endl;
+        /** @todo r=bird: Why return success (0) when we didn't generate the
+         *        file?!?!? */
         return 0;
     }
@@ -360,4 +371,6 @@
     }
 
+/** @todo String compression. */
+
     fout.open(outName);
     if (!fout.is_open())
Index: /trunk/src/VBox/Main/src-server/USBIdDatabaseStub.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/USBIdDatabaseStub.cpp	(revision 57999)
+++ /trunk/src/VBox/Main/src-server/USBIdDatabaseStub.cpp	(revision 58000)
@@ -1,26 +1,24 @@
+/* $Id$ */
+/** @file
+ * USB device vendor and product ID database - stub.
+ */
+
 /*
-* Copyright(C) 2005 - 2015 Oracle Corporation
-*
-* This file is part of VirtualBox Open Source Edition(OSE), as
-* available from http ://www.virtualbox.org. This file is free software;
-* you can redistribute it and / or modify it under the terms of the GNU
-* General Public License(GPL) as published by the Free Software
-* Foundation, in version 2 as it comes in the "COPYING" file of the
-* VirtualBox OSE distribution.VirtualBox OSE is distributed in the
-* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-*
-*/
+ * Copyright (C) 2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
 
 #include "USBIdDatabase.h"
 
-/** USB devices aliases array.
-*   Format: VendorId, ProductId, Vendor Name, Product Name
-*   The source of the list is http://www.linux-usb.org/usb.ids
-*/
-Product AliasDictionary::productArray[] = {0};
+Product         AliasDictionary::productArray[] = {0};
+const size_t    AliasDictionary::products_size  = 0;
+Vendor          AliasDictionary::vendorArray[]  = {0};
+const size_t    AliasDictionary::vendors_size   = 0;
 
-const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product);
-
-Vendor AliasDictionary::vendorArray[] = {0};
-
-const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);
