Changeset 137 for trunk/settings


Ignore:
Timestamp:
Sep 20, 2021, 6:48:26 PM (4 years ago)
Author:
Gregg Young
Message:

Fix some issues identified by cppcheck; minor code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/settings/thth_settings.h

    r50 r137  
    7777public:
    7878    ththSettingsEntryFlag (ID id, PSZ pszGroup, PSZ pszKey, BOOL f)
    79         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_FLAG) {
    80             fDefault = f; Reset (); }
     79        : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_FLAG), fDefault (f)
     80    {
     81        Reset ();
     82    }
    8183
    8284    ththSettingsEntryFlag (ID id, PSZ pszGroup, PSZ pszKey, BOOL f, HINI hini)
    83         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_FLAG) {
    84             fDefault = f; Load (hini); }
     85            : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_FLAG), fDefault (f)
     86        {
     87            Load (hini);
     88        }
    8589
    8690    VOID   Set (BOOL f) { this->f = f; }
    8791    BOOL   Query (VOID) { return f; }
    88     VOID   Reset (VOID) { f = fDefault; }
     92    VOID   Reset (VOID) { f = fDefault; } 
    8993
    9094    VOID Load (HINI hini)
     
    120124public:
    121125    ththSettingsEntryLong (ID id, PSZ pszGroup, PSZ pszKey, LONG l)
    122         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_LONG) {
    123             lDefault = l; Reset (); }
     126        : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_LONG), lDefault (l)
     127    {
     128         Reset ();
     129    }
    124130
    125131    ththSettingsEntryLong (ID id, PSZ pszGroup, PSZ pszKey, LONG l, HINI hini)
    126         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_LONG) {
    127             lDefault = l; Load (hini); }
     132            : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_LONG), lDefault (l)
     133        {
     134            Load (hini);
     135        }
    128136
    129137    VOID   Set (LONG l) { this->l = l; }
     
    163171public:
    164172    ththSettingsEntryString (ID id, PSZ pszGroup, PSZ pszKey, PSZ psz)
    165         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_STRING) {
    166             pszDefault = psz; Reset (); }
     173        : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_STRING), pszDefault(psz)
     174    {
     175        Reset ();
     176    }
    167177
    168178    ththSettingsEntryString (ID id, PSZ pszGroup, PSZ pszKey, PSZ psz, HINI hini)
    169         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_STRING) {
    170             pszDefault = psz; Load (hini); }
     179            : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_STRING), pszDefault(psz)
     180        {
     181            Load (hini);
     182        }
    171183
    172184    VOID Set (PSZ psz)
     
    218230public:
    219231    ththSettingsEntryBinary (ID id, PSZ pszGroup, PSZ pszKey, PVOID pv, size_t size)
    220         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_BINARY) {
    221             pvDefault = pv; this->sizeDefault = size; Reset (); }
     232        : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_BINARY), pvDefault (pv)
     233    {
     234        this->sizeDefault = size; Reset ();
     235    }
    222236
    223237    ththSettingsEntryBinary (ID id, PSZ pszGroup, PSZ pszKey, PVOID pv, size_t size, HINI hini)
    224         : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_BINARY) {
    225             pvDefault = pv; this->sizeDefault = size; Load (hini); }
     238            : ththSettingsEntry (id, pszGroup, pszKey, ththSettingsEntry::SET_BINARY), pvDefault (pv)
     239            {
     240                this->sizeDefault = size; Load (hini);
     241            }
    226242
    227243    VOID Set (PVOID pv, size_t size)
Note: See TracChangeset for help on using the changeset viewer.