VirtualBox

Changeset 24989 in vbox for trunk/src/VBox/Main/xml


Ignore:
Timestamp:
Nov 26, 2009 11:31:46 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55293
Message:

Main: enable -Wshadow gcc option to warn about shadowed variables and fix all resulting warnings; in particular, rename some stack and member variables and rename getter methods like id() to getId()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r24888 r24989  
    179179        va_list args;
    180180        va_start(args, pcszFormat);
    181         Utf8StrFmtVA what(pcszFormat, args);
     181        Utf8StrFmtVA strWhat(pcszFormat, args);
    182182        va_end(args);
    183183
     
    190190                       file->m->strFilename.c_str(),
    191191                       (pcsz) ? pcsz : "",
    192                        what.c_str());
     192                       strWhat.c_str());
    193193
    194194        setWhat(str.c_str());
     
    10891089 */
    10901090void MainConfigFile::writeHardDisk(xml::ElementNode &elmMedium,
    1091                                    const Medium &m,
     1091                                   const Medium &mdm,
    10921092                                   uint32_t level)          // 0 for "root" call, incremented with each recursion
    10931093{
    10941094    xml::ElementNode *pelmHardDisk = elmMedium.createChild("HardDisk");
    1095     pelmHardDisk->setAttribute("uuid", makeString(m.uuid));
    1096     pelmHardDisk->setAttribute("location", m.strLocation);
    1097     pelmHardDisk->setAttribute("format", m.strFormat);
    1098     if (m.fAutoReset)
    1099         pelmHardDisk->setAttribute("autoReset", m.fAutoReset);
    1100     if (m.strDescription.length())
    1101         pelmHardDisk->setAttribute("Description", m.strDescription);
    1102 
    1103     for (PropertiesMap::const_iterator it = m.properties.begin();
    1104          it != m.properties.end();
     1095    pelmHardDisk->setAttribute("uuid", makeString(mdm.uuid));
     1096    pelmHardDisk->setAttribute("location", mdm.strLocation);
     1097    pelmHardDisk->setAttribute("format", mdm.strFormat);
     1098    if (mdm.fAutoReset)
     1099        pelmHardDisk->setAttribute("autoReset", mdm.fAutoReset);
     1100    if (mdm.strDescription.length())
     1101        pelmHardDisk->setAttribute("Description", mdm.strDescription);
     1102
     1103    for (PropertiesMap::const_iterator it = mdm.properties.begin();
     1104         it != mdm.properties.end();
    11051105         ++it)
    11061106    {
     
    11141114    {
    11151115        const char *pcszType =
    1116             m.hdType == MediumType_Normal ? "Normal" :
    1117             m.hdType == MediumType_Immutable ? "Immutable" :
    1118             /*m.hdType == MediumType_Writethrough ?*/ "Writethrough";
     1116            mdm.hdType == MediumType_Normal ? "Normal" :
     1117            mdm.hdType == MediumType_Immutable ? "Immutable" :
     1118            /*mdm.hdType == MediumType_Writethrough ?*/ "Writethrough";
    11191119        pelmHardDisk->setAttribute("type", pcszType);
    11201120    }
    11211121
    1122     for (MediaList::const_iterator it = m.llChildren.begin();
    1123          it != m.llChildren.end();
     1122    for (MediaList::const_iterator it = mdm.llChildren.begin();
     1123         it != mdm.llChildren.end();
    11241124         ++it)
    11251125    {
     
    11711171         ++it)
    11721172    {
    1173         const Medium &m = *it;
     1173        const Medium &mdm = *it;
    11741174        xml::ElementNode *pelmMedium = pelmDVDImages->createChild("Image");
    1175         pelmMedium->setAttribute("uuid", makeString(m.uuid));
    1176         pelmMedium->setAttribute("location", m.strLocation);
    1177         if (m.strDescription.length())
    1178             pelmMedium->setAttribute("Description", m.strDescription);
     1175        pelmMedium->setAttribute("uuid", makeString(mdm.uuid));
     1176        pelmMedium->setAttribute("location", mdm.strLocation);
     1177        if (mdm.strDescription.length())
     1178            pelmMedium->setAttribute("Description", mdm.strDescription);
    11791179    }
    11801180
     
    11841184         ++it)
    11851185    {
    1186         const Medium &m = *it;
     1186        const Medium &mdm = *it;
    11871187        xml::ElementNode *pelmMedium = pelmFloppyImages->createChild("Image");
    1188         pelmMedium->setAttribute("uuid", makeString(m.uuid));
    1189         pelmMedium->setAttribute("location", m.strLocation);
    1190         if (m.strDescription.length())
    1191             pelmMedium->setAttribute("Description", m.strDescription);
     1188        pelmMedium->setAttribute("uuid", makeString(mdm.uuid));
     1189        pelmMedium->setAttribute("location", mdm.strLocation);
     1190        if (mdm.strDescription.length())
     1191            pelmMedium->setAttribute("Description", mdm.strDescription);
    11921192    }
    11931193
Note: See TracChangeset for help on using the changeset viewer.

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