Changeset 137


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.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/helper.cpp

    r113 r137  
    6363
    6464    CHAR   fullExeName[CCHMAXPATH];
    65     CHAR   *p;;
     65    CHAR   *p;
    6666    strcpy(fullExeName, ptr);
    6767    p = strrchr(fullExeName, '\\');
  • trunk/rstring.h

    r10 r137  
    3333    ResourceString (ULONG Id);
    3434
    35     ResourceString (const ResourceString &rstr)
    36     {
    37         SavedId      = rstr.SavedId;
    38         BlockPointer = rstr.BlockPointer;
    39         psz          = rstr.psz;
    40     }
     35    ResourceString (const ResourceString &rstr) :SavedId (rstr.SavedId),
     36        BlockPointer (rstr.BlockPointer), psz (rstr.psz)
     37    {}
    4138
    4239    operator unsigned char * ()  { return ((unsigned char *) psz); }
  • trunk/savebmp.cpp

    r128 r137  
    574574
    575575        HMQ hmq;
    576         BOOL bUniCodeFont = FALSE;
     576        BOOL bUniCodeFont;
    577577        CHAR ucFont[FACESIZE];
    578         CHAR *lang = getenv("LANG");
    579 
     578        CHAR *lang;
     579
     580        lang = getenv("LANG");
     581        bUniCodeFont = FALSE;
    580582        if (!strnicmp(lang, "ru", 2)) {
    581583            hmq = WinQueryWindowULong( hwnd, QWL_HMQ);
  • 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.