VirtualBox

Changeset 83797 in vbox


Ignore:
Timestamp:
Apr 18, 2020 1:52:37 PM (5 years ago)
Author:
vboxsync
Message:

VBoxAutostart: VC++ 14.1 adjustments. Removed some unnecessary stdc++ headers and eliminated one silly std::string usage. bugref:8489

Location:
trunk/src/VBox/Frontends/VBoxAutostart
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp

    r82968 r83797  
    5353#include <iprt/dir.h>
    5454
    55 #include <algorithm>
    56 #include <list>
    57 #include <string>
    5855#include <signal.h>
    5956
     
    268265
    269266    RTStrmPrintf(g_pStdErr,
    270                  "Usage:\n"
    271                  " %s [-v|--verbose] [-h|-?|--help]\n"
    272                  " [-F|--logfile=<file>] [-R|--logrotate=<num>] [-S|--logsize=<bytes>]\n"
    273                  " [-I|--loginterval=<seconds>]\n"
    274                  " [-c|--config=<config file>]\n", pszImage);
    275 
    276     RTStrmPrintf(g_pStdErr, "\n"
     267                 "Usage: %s [-v|--verbose] [-h|-?|--help]\n"
     268                 "           [-F|--logfile=<file>] [-R|--logrotate=<num>]\n"
     269                 "           [-S|--logsize=<bytes>] [-I|--loginterval=<seconds>]\n"
     270                 "           [-c|--config=<config file>]\n",
     271                 pszImage);
     272
     273    RTStrmPrintf(g_pStdErr,
     274                 "\n"
    277275                 "Options:\n");
    278 
    279     for (unsigned i = 0;
    280          i < RT_ELEMENTS(g_aOptions);
    281          ++i)
    282     {
    283         std::string str(g_aOptions[i].pszLong);
     276    for (unsigned i = 0; i < RT_ELEMENTS(g_aOptions); i++)
     277    {
     278        char szOptions[128];
     279        const char *pszOptions = g_aOptions[i].pszLong;
    284280        if (g_aOptions[i].iShort < 1000) /* Don't show short options which are defined by an ID! */
    285281        {
    286             str += ", -";
    287             str += g_aOptions[i].iShort;
    288         }
    289         str += ":";
     282            RTStrPrintf(szOptions, sizeof(szOptions), "%s, -%c", g_aOptions[i].pszLong, g_aOptions[i].iShort);
     283            pszOptions = szOptions;
     284        }
    290285
    291286        const char *pcszDescr = "";
    292 
    293287        switch (g_aOptions[i].iShort)
    294288        {
     
    324318        }
    325319
    326         RTStrmPrintf(g_pStdErr, "%-23s%s\n", str.c_str(), pcszDescr);
     320        RTStrmPrintf(g_pStdErr, "%-23s%s\n", pszOptions, pcszDescr);
    327321    }
    328322
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp

    r83327 r83797  
    835835        com::Utf8Str sDomain;
    836836        com::Utf8Str sUserTmp;
    837         int rc = autostartGetDomainAndUser(pNode->pszKey, sDomain, sUserTmp);
     837        rc = autostartGetDomainAndUser(pNode->pszKey, sDomain, sUserTmp);
    838838        if (RT_FAILURE(rc))
    839839            continue;
     
    875875    }
    876876
    877     RTEXITCODE ec = autostartStartMain(pCfgAstUser);
     877    RTEXITCODE rcExit = autostartStartMain(pCfgAstUser);
    878878    autostartConfigAstDestroy(pCfgAst);
    879     if (ec != RTEXITCODE_SUCCESS)
     879    if (rcExit != RTEXITCODE_SUCCESS)
    880880        autostartSvcLogError("Starting VMs failed\n");
    881881
    882     return ec;
     882    return rcExit;
    883883}
    884884
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStop.cpp

    r82968 r83797  
    2929#include <iprt/message.h>
    3030
    31 #include <algorithm>
    3231#include <list>
    33 #include <string>
    3432
    3533#include "VBoxAutostart.h"
  • trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartUtils.cpp

    r82968 r83797  
    3030#include <iprt/stream.h>
    3131#include <iprt/log.h>
    32 #include <iprt/path.h>
    33 
    34 #include <algorithm>
    35 #include <list>
    36 #include <string>
     32#include <iprt/path.h>      /* RTPATH_MAX */
    3733
    3834#include "VBoxAutostart.h"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette