Index: trunk/src/helpers/animate.c
===================================================================
--- trunk/src/helpers/animate.c	(revision 180)
+++ trunk/src/helpers/animate.c	(revision 184)
@@ -140,6 +140,6 @@
 
             WinDrawBitmap(hps, hbm, NULL, (PPOINTL)&rtlStretch,
-                    0, 0,       // we don't need colors
-                    DBM_STRETCH);
+                          0, 0,       // we don't need colors
+                          DBM_STRETCH);
 
             DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
@@ -159,10 +159,10 @@
         // finally, draw the 1:1 version
         WinDrawBitmap(hps, hbm, NULL, &ptl,
-                0, 0,       // we don't need colors
-                DBM_NORMAL);
+                      0, 0,       // we don't need colors
+                      DBM_NORMAL);
 
     } // end if (hps)
 
-    return (ulrc);
+    return ulrc;
 }
 
Index: trunk/src/helpers/apmh.c
===================================================================
--- trunk/src/helpers/apmh.c	(revision 180)
+++ trunk/src/helpers/apmh.c	(revision 184)
@@ -78,5 +78,5 @@
                             &DataPacket, sizeof(DataPacket), &ulRetSize)))
         if (DataPacket.ReturnCode)
-            arc = DataPacket.ReturnCode | 10000;
+            arc = DataPacket.ReturnCode + 10000;
 
     return arc;
Index: trunk/src/helpers/apps.c
===================================================================
--- trunk/src/helpers/apps.c	(revision 180)
+++ trunk/src/helpers/apps.c	(revision 184)
@@ -94,5 +94,5 @@
     }
 
-    return (cbEnvironment);
+    return cbEnvironment;
 }
 
@@ -299,5 +299,5 @@
     }
 
-    return (ppszRet);
+    return ppszRet;
 }
 
@@ -717,5 +717,5 @@
     {
         if (G_aProgTypes[ul].progc == progc)
-            return (G_aProgTypes[ul].pcsz);
+            return G_aProgTypes[ul].pcsz;
     }
 
@@ -748,5 +748,5 @@
         case PROG_31_ENHSEAMLESSCOMMON:     // 18
         case PROG_31_ENH:                   // 19
-            return (2);
+            return 2;
 
 #ifndef PROG_30_STD
@@ -766,8 +766,8 @@
         case PROG_31_STDSEAMLESSCOMMON:     // 16
         case PROG_31_STD:                   // 20
-            return (1);
-    }
-
-    return (0);
+            return 1;
+    }
+
+    return 0;
 }
 
@@ -1992,4 +1992,4 @@
     }
 
-    return (happReturn);
+    return happReturn;
 }
Index: trunk/src/helpers/cctl_chart.c
===================================================================
--- trunk/src/helpers/cctl_chart.c	(revision 180)
+++ trunk/src/helpers/cctl_chart.c	(revision 184)
@@ -1084,5 +1084,5 @@
     } // end if (dTotal > 0)
 
-    return (hbmReturn);
+    return hbmReturn;
 }
 
@@ -1455,6 +1455,4 @@
                               LONG ly)
 {
-    // LONG lRegionFound = -1; // none
-
     POINTL ptlMouse = {lx, ly};
 
@@ -1477,5 +1475,5 @@
                      == PRGN_INSIDE)
                 {
-                    return (ul);
+                    return ul;
                 }
             }
@@ -1483,5 +1481,5 @@
     }
 
-    return (-1);
+    return -1;
 }
 
@@ -1897,9 +1895,9 @@
             pChtCData->fHasFocus = FALSE;
             WinSetWindowPtr(hwndChart, QWL_USER, pChtCData);
-            return (TRUE);
+            return TRUE;
         }
     }
 
-    return (FALSE);
+    return FALSE;
 }
 
Index: trunk/src/helpers/cctl_checkcnr.c
===================================================================
--- trunk/src/helpers/cctl_checkcnr.c	(revision 180)
+++ trunk/src/helpers/cctl_checkcnr.c	(revision 184)
@@ -745,5 +745,5 @@
             pcbco->habCnr = WinQueryAnchorBlock(hwndCnr);
 
-            return (pcbco);
+            return pcbco;
         }
     }
@@ -891,5 +891,6 @@
         }
     }
-    return (ulrc);
+
+    return ulrc;
 }
 
@@ -914,5 +915,5 @@
                       (ULONG)&precc);
 
-    return (precc);
+    return precc;
 }
 
@@ -938,8 +939,6 @@
                          USHORT usCheckState)   // in: 0, 1, 2, 3
 {
-    BOOL brc = FALSE;
-    PCHECKBOXRECORDCORE precc = ctlFindCheckRecord(hwndCnr, ulItemID);
-
-    if (precc)
+    PCHECKBOXRECORDCORE precc;
+    if (precc = ctlFindCheckRecord(hwndCnr, ulItemID))
     {
         precc->usCheckState = usCheckState;
@@ -949,8 +948,8 @@
                    MPFROM2SHORT(1,
                                 CMA_NOREPOSITION));
-        brc = TRUE;
-    }
-
-    return brc;
+        return TRUE;
+    }
+
+    return FALSE;
 }
 
@@ -975,11 +974,9 @@
                             USHORT usCheckState)   // in: 0, 1, 2, 3
 {
-    ULONG ulrc = -1;
-    PCHECKBOXRECORDCORE precc = ctlFindCheckRecord(hwndCnr, ulItemID);
-
-    if (precc)
-        ulrc = precc->usCheckState;
-
-    return (ulrc);
+    PCHECKBOXRECORDCORE precc;
+    if (precc = ctlFindCheckRecord(hwndCnr, ulItemID))
+        return precc->usCheckState;
+
+    return -1;
 }
 
@@ -999,8 +996,7 @@
                      BOOL fEnable)
 {
-    BOOL brc = FALSE;
-    PCHECKBOXRECORDCORE precc = ctlFindCheckRecord(hwndCnr, ulItemID);
-
-    if (precc)
+    PCHECKBOXRECORDCORE precc;
+
+    if (precc = ctlFindCheckRecord(hwndCnr, ulItemID))
     {
         ULONG ulAttr = precc->recc.flRecordAttr;
@@ -1018,9 +1014,9 @@
                                     CMA_NOREPOSITION));
 
-        brc = TRUE;
-    }
-
-    return brc;
-}
-
-
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+
Index: trunk/src/helpers/cctl_progbar.c
===================================================================
--- trunk/src/helpers/cctl_progbar.c	(revision 180)
+++ trunk/src/helpers/cctl_progbar.c	(revision 184)
@@ -401,6 +401,6 @@
 BOOL ctlProgressBarFromStatic(HWND hwndChart, ULONG ulAttr)
 {
-    PFNWP OldStaticProc = WinSubclassWindow(hwndChart, ctl_fnwpProgressBar);
-    if (OldStaticProc)
+    PFNWP OldStaticProc;
+    if (OldStaticProc = WinSubclassWindow(hwndChart, ctl_fnwpProgressBar))
     {
         PPROGRESSBARDATA pData = (PPROGRESSBARDATA)malloc(sizeof(PROGRESSBARDATA));
@@ -414,5 +414,6 @@
         return (TRUE);
     }
-    else return (FALSE);
+
+    return (FALSE);
 }
 
Index: trunk/src/helpers/cctl_splitwin.c
===================================================================
--- trunk/src/helpers/cctl_splitwin.c	(revision 180)
+++ trunk/src/helpers/cctl_splitwin.c	(revision 184)
@@ -735,64 +735,60 @@
         }
 
-        hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
-                                    WC_SPLITWINDOW,
-                                    "",
-                                    WS_VISIBLE,
-                                    0, 0, 10, 10,
-                                    psbcd->hwndParentAndOwner,  // owner
-                                    HWND_TOP,
-                                    psbcd->ulSplitWindowID,
-                                    NULL,
-                                    NULL);
-        if (hwndSplit)
+        if (    (hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
+                                             WC_SPLITWINDOW,
+                                             "",
+                                             WS_VISIBLE,
+                                             0, 0, 10, 10,
+                                             psbcd->hwndParentAndOwner,  // owner
+                                             HWND_TOP,
+                                             psbcd->ulSplitWindowID,
+                                             NULL,
+                                             NULL))
+             && (hwndBar = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
+                                           WC_STATIC,
+                                           "",
+                                           WS_VISIBLE            // wnd style
+                                             | SS_TEXT,
+                                           0, 0, 10, 10,
+                                           psbcd->hwndParentAndOwner,  // owner
+                                           HWND_TOP,
+                                           ID_SPLITBAR,          // win ID
+                                           NULL,                 // cdata
+                                           NULL))                // presparams
+           )
         {
-            hwndBar    = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
-                                         WC_STATIC,
-                                         "",
-                                         WS_VISIBLE            // wnd style
-                                           | SS_TEXT,
-                                         0, 0, 10, 10,
-                                         psbcd->hwndParentAndOwner,  // owner
-                                         HWND_TOP,
-                                         ID_SPLITBAR,          // win ID
-                                         NULL,                 // cdata
-                                         NULL                  // presparams
-                                     );
-            if (hwndBar)
+            // create SPLITBARDATA to store in split bar's QWL_USER
+            PSPLITBARDATA pData;
+            if (pData = (PSPLITBARDATA)malloc(sizeof(SPLITBARDATA)))
             {
-                // create SPLITBARDATA to store in split bar's QWL_USER
-                PSPLITBARDATA pData = (PSPLITBARDATA)malloc(sizeof(SPLITBARDATA));
-                if (pData)
-                {
-                    // set parent for split bar
-                    WinSetParent(hwndBar, hwndSplit, FALSE);
-
-                    memset(pData, 0, sizeof(SPLITBARDATA));
-
-                    // copy control data
-                    memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA));
-                    // set other data
-                    /* WinQueryWindowRect(hwndBar, &(pData->rclBar));
-                    (pData->rclBar.xRight)--;
-                    (pData->rclBar.yTop)--; */
-                    // subclass static control to make it a split bar
-                    pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar);
-                    pData->hptrOld = NULLHANDLE;
-                    pData->hptrMove = WinQuerySysPointer(HWND_DESKTOP,
-                                (psbcd->ulCreateFlags & SBCF_HORIZONTAL)
-                                    ? SPTR_SIZENS
-                                    : SPTR_SIZEWE,
-                                FALSE);     // don't make copy
-                    pData->fCaptured = FALSE;
-                    pData->hwndLinked1 =
-                    pData->hwndLinked2 = NULLHANDLE;
-
-                    WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData);
-                }
+                // set parent for split bar
+                WinSetParent(hwndBar, hwndSplit, FALSE);
+
+                memset(pData, 0, sizeof(SPLITBARDATA));
+
+                // copy control data
+                memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA));
+                // set other data
+                /* WinQueryWindowRect(hwndBar, &(pData->rclBar));
+                (pData->rclBar.xRight)--;
+                (pData->rclBar.yTop)--; */
+                // subclass static control to make it a split bar
+                pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar);
+                pData->hptrOld = NULLHANDLE;
+                pData->hptrMove = WinQuerySysPointer(HWND_DESKTOP,
+                            (psbcd->ulCreateFlags & SBCF_HORIZONTAL)
+                                ? SPTR_SIZENS
+                                : SPTR_SIZEWE,
+                            FALSE);     // don't make copy
+                pData->fCaptured = FALSE;
+                pData->hwndLinked1 =
+                pData->hwndLinked2 = NULLHANDLE;
+
+                WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData);
             }
         }
     }
 
-    return (hwndSplit);
+    return hwndSplit;
 }
 
@@ -999,17 +995,14 @@
 LONG ctlQuerySplitPos(HWND hwndSplit)
 {
-    ULONG lrc = 0;
-
     // the split bar data is stored in QWL_USER of the
     // split bar (not the split window)
-    HWND    hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR);
-    if (hwndSplitBar)
-    {
-        PSPLITBARDATA psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER);
-        if (psbd)
-            lrc = psbd->sbcd.lPos;
-    }
-
-    return (lrc);
+    HWND    hwndSplitBar;
+    PSPLITBARDATA psbd;
+    if (    (hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR))
+         && (psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER))
+       )
+        return psbd->sbcd.lPos;
+
+    return 0;
 }
 
Index: trunk/src/helpers/cctl_tooltip.c
===================================================================
--- trunk/src/helpers/cctl_tooltip.c	(revision 180)
+++ trunk/src/helpers/cctl_tooltip.c	(revision 184)
@@ -111,11 +111,11 @@
 BOOL ctlRegisterTooltip(HAB hab)
 {
-    return (WinRegisterClass(hab,
-                             COMCTL_TOOLTIP_CLASS,
-                             ctl_fnwpTooltip,
-                             CS_HITTEST,     // class styles;
-                                             // CS_FRAME not working,
-                                             // CS_CLIPSIBLINGS not working
-                             sizeof(PVOID)*2));   // addt'l bytes to reserve:
+    return WinRegisterClass(hab,
+                            COMCTL_TOOLTIP_CLASS,
+                            ctl_fnwpTooltip,
+                            CS_HITTEST,     // class styles;
+                                            // CS_FRAME not working,
+                                            // CS_CLIPSIBLINGS not working
+                            sizeof(PVOID) * 2);   // addt'l bytes to reserve:
                                     // one pointer for QWL_USER,
                                     // one more for instance data
@@ -203,7 +203,6 @@
         PSUBCLASSEDTOOL pstThis = (PSUBCLASSEDTOOL)pNode->pItemData;
         if (pstThis->hwndTool == hwndTool)
-        {
-            return (pstThis);
-        }
+            return pstThis;
+
         pNode = pNode->pNext;
     }
@@ -327,15 +326,15 @@
 static BOOL UnSubclassTool(HWND hwndTool)
 {
-    PSUBCLASSEDTOOL pst = FindSubclassedTool(hwndTool);
-    if (pst)
+    PSUBCLASSEDTOOL pst;
+    if (pst = FindSubclassedTool(hwndTool))
     {
         WinSubclassWindow(hwndTool,
                           pst->pfnwpOrig);
                             // orig winproc == un-subclass
-        return (lstRemoveItem(&G_llSubclassedTools, pst));
+        return lstRemoveItem(&G_llSubclassedTools, pst);
                     // this frees the item
     }
 
-    return (FALSE);
+    return FALSE;
 }
 
@@ -446,6 +445,5 @@
 
     // allocate and initialize tooltip data
-    pttd = (PTOOLTIPDATA)malloc(sizeof(TOOLTIPDATA));
-    if (pttd)
+    if (pttd = (PTOOLTIPDATA)malloc(sizeof(TOOLTIPDATA)))
     {
         CHAR        szFont[256];
@@ -498,7 +496,7 @@
         return (MPARAM)FALSE;
     }
-    else
-        // malloc failed:
-        return (MPARAM)TRUE;
+
+    // malloc failed:
+    return (MPARAM)TRUE;
 }
 
@@ -543,5 +541,5 @@
     } // end switch
 
-    return (TRUE);
+    return TRUE;
 }
 
@@ -735,6 +733,6 @@
 {
     PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1);
-    PTOOLINFO ptiSearch = (PTOOLINFO)mp2;
-    if (ptiSearch)
+    PTOOLINFO ptiSearch;
+    if (ptiSearch = (PTOOLINFO)mp2)
     {
         PLISTNODE pToolNode = lstQueryFirstNode(&pttd->llTools);
@@ -962,6 +960,6 @@
 {
     PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1);
-    PTOOLINFO ptiTarget = (PTOOLINFO)mp2;
-    if (ptiTarget)
+    PTOOLINFO ptiTarget;
+    if (ptiTarget = (PTOOLINFO)mp2)
     {
         PTOOLINFO ptiFound = (PTOOLINFO)lstItemFromIndex(&pttd->llTools,
@@ -987,15 +985,15 @@
 {
     PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1);
-    PTOOLINFO ptiTarget = (PTOOLINFO)mp2;
-    if (ptiTarget)
+    PTOOLINFO ptiTarget;
+    if (ptiTarget = (PTOOLINFO)mp2)
     {
         if (pttd->ptiMouseOver)
         {
             memcpy(ptiTarget, pttd->ptiMouseOver, sizeof(TOOLINFO));
-            return (MPARAM)TRUE;
+            return (MRESULT)TRUE;
         }
     }
 
-    return ((MPARAM)FALSE);
+    return (MRESULT)FALSE;
 }
 
@@ -1010,6 +1008,6 @@
 {
     PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1);
-    PTOOLINFO ptiSearch = (PTOOLINFO)mp2;
-    if (ptiSearch)
+    PTOOLINFO ptiSearch;
+    if (ptiSearch = (PTOOLINFO)mp2)
     {
         PLISTNODE pToolNode = lstQueryFirstNode(&pttd->llTools);
Index: trunk/src/helpers/cnrh.c
===================================================================
--- trunk/src/helpers/cnrh.c	(revision 180)
+++ trunk/src/helpers/cnrh.c	(revision 184)
@@ -96,9 +96,9 @@
         ulFlags |= CMA_INVALIDATE;
 
-    return (ULONG)(WinSendMsg(hwndCnr,
-                              CM_REMOVEDETAILFIELDINFO,
-                              (MPARAM)NULL,
-                              MPFROM2SHORT(0,      // all
-                                           ulFlags)));
+    return (ULONG)WinSendMsg(hwndCnr,
+                             CM_REMOVEDETAILFIELDINFO,
+                             (MPARAM)NULL,
+                             MPFROM2SHORT(0,      // all
+                                          ulFlags));
 }
 
@@ -218,8 +218,8 @@
     fii.cFieldInfoInsert = ulFieldCount;
 
-    return ((ULONG)WinSendMsg(hwndCnr,
-                              CM_INSERTDETAILFIELDINFO,
-                              (MPARAM)pFieldInfoFirst,
-                              (MPARAM)&fii));
+    return (ULONG)WinSendMsg(hwndCnr,
+                             CM_INSERTDETAILFIELDINFO,
+                             (MPARAM)pFieldInfoFirst,
+                             (MPARAM)&fii);
 }
 
@@ -348,5 +348,5 @@
     }
 
-    return (pFieldInfoReturn);
+    return pFieldInfoReturn;
 }
 
@@ -395,11 +395,8 @@
                              ULONG ulCount)  // in: number of records to allocate (> 0)
 {
-    PRECORDCORE      precc;
-    precc = (PRECORDCORE)WinSendMsg(hwndCnr,
-                                    CM_ALLOCRECORD,
-                                    (MPARAM)(cbrecc-sizeof(RECORDCORE)),
-                                    (MPARAM)ulCount);
-
-    return (precc);
+    return (PRECORDCORE)WinSendMsg(hwndCnr,
+                                   CM_ALLOCRECORD,
+                                   (MPARAM)(cbrecc - sizeof(RECORDCORE)),
+                                   (MPARAM)ulCount);
 }
 
@@ -478,5 +475,4 @@
                         ULONG ulCount)  // in: number of records to insert (> 0)
 {
-    ULONG           ulrc = 0;
     RECORDINSERT    ri;
 
@@ -503,10 +499,11 @@
         ri.cRecordsInsert = ulCount;        // V0.9.0
 
-        ulrc = (ULONG)WinSendMsg(hwndCnr,
+        return (ULONG)WinSendMsg(hwndCnr,
                                  CM_INSERTRECORD,
                                  (MPARAM)precc,
                                  (MPARAM)&ri);
     }
-    return (ulrc);
+
+    return 0;
 }
 
@@ -528,5 +525,4 @@
                             BOOL fInvalidate)           // in: invalidate records?
 {
-    ULONG           ulrc = 0;
     RECORDINSERT    ri;
 
@@ -552,5 +548,5 @@
             ri.cRecordsInsert = 1;
 
-            ulrc = (ULONG)WinSendMsg(hwndCnr,
+            return (ULONG)WinSendMsg(hwndCnr,
                                      CM_INSERTRECORD,
                                      (MPARAM)precc,
@@ -558,5 +554,6 @@
         }
     }
-    return (ulrc);
+
+    return 0;
 }
 
@@ -608,5 +605,6 @@
         return (ulrc != 0);
     }
-    else return (FALSE);
+
+    return FALSE;
 }
 
@@ -807,5 +805,5 @@
     } while (TRUE);
 
-    return (ulrc);
+    return ulrc;
 }
 
@@ -946,5 +944,5 @@
     //     _Pmpf(("  CM_QUERYVIEWPORTRECT failed."));
 
-    return (preccReturn);
+    return preccReturn;
 }
 
@@ -979,5 +977,5 @@
     }
 
-    return (ul);
+    return ul;
 }
 
@@ -1387,5 +1385,5 @@
     }
 
-    return (preccReturn);
+    return preccReturn;
 }
 
@@ -1416,5 +1414,6 @@
             preccReturn = preccNext;
     }
-    return (preccReturn);
+
+    return preccReturn;
 }
 
@@ -1485,5 +1484,5 @@
     }
 
-    return (lrc);
+    return lrc;
 }
 
@@ -1642,5 +1641,5 @@
     }
 
-    return (ulrc);
+    return ulrc;
 }
 
@@ -1773,11 +1772,9 @@
     if (hwndFrame)
     {
-        henum = WinBeginEnumWindows(hwndFrame);
-        if (henum)
+        if (henum = WinBeginEnumWindows(hwndFrame))
         {
             do
             {
-                hwndTemp = WinGetNextWindow(henum);
-                if (hwndTemp)
+                if (hwndTemp = WinGetNextWindow(henum))
                 {
                     if (WinQueryClassName(hwndTemp, 250, szClassName))
@@ -2001,5 +1998,5 @@
     } // end if (pdrgInfo)
 
-    return (pdrgInfo);
+    return pdrgInfo;
 }
 
@@ -2183,8 +2180,8 @@
             pctime->hours = pdt->hours;
         }
-        return (TRUE);
+        return TRUE;
     }
-    else
-        return (FALSE);
+
+    return FALSE;
 }
 
@@ -2203,8 +2200,8 @@
         pcd->month = pfd->month;
         pcd->year = pfd->year + 1980;
-        return (TRUE);
+        return TRUE;
     }
-    else
-        return (FALSE);
+
+    return FALSE;
 }
 
@@ -2224,7 +2221,7 @@
         pct->hours = pft->hours;
         pct->ucReserved = 0;
-        return (TRUE);
+        return TRUE;
     }
-    else
-        return (FALSE);
-}
+
+    return FALSE;
+}
Index: trunk/src/helpers/comctl.c
===================================================================
--- trunk/src/helpers/comctl.c	(revision 180)
+++ trunk/src/helpers/comctl.c	(revision 184)
@@ -632,4 +632,5 @@
             free(pmbd);
     }
+
     return brc;
 }
@@ -1005,5 +1006,5 @@
     }
 
-    return (pa);
+    return pa;
 }
 
@@ -1141,4 +1142,5 @@
         }
     }
+
     return (paNew != NULL);
 }
@@ -1420,13 +1422,13 @@
 BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField)
 {
-    PFNWP pfnwpOrig = WinSubclassWindow(hwndHotkeyEntryField,
-                                        ctl_fnwpObjectHotkeyEntryField);
-    if (pfnwpOrig)
+    PFNWP pfnwpOrig;
+    if (pfnwpOrig = WinSubclassWindow(hwndHotkeyEntryField,
+                                      ctl_fnwpObjectHotkeyEntryField))
     {
         WinSetWindowPtr(hwndHotkeyEntryField, QWL_USER, (PVOID)pfnwpOrig);
-        return (TRUE);
+        return TRUE;
     }
 
-    return (FALSE);
+    return FALSE;
 }
 
Index: trunk/src/helpers/configsys.c
===================================================================
--- trunk/src/helpers/configsys.c	(revision 180)
+++ trunk/src/helpers/configsys.c	(revision 184)
@@ -284,5 +284,5 @@
     } while ((!pReturn) && (p != NULL) && (p != pcszSearchIn));
 
-    return (pReturn);
+    return pReturn;
 }
 
@@ -335,5 +335,5 @@
     }
 
-    return (prc);
+    return prc;
 }
 
@@ -457,5 +457,5 @@
     }
 
-    return (pReturn);
+    return pReturn;
 }
 
Index: trunk/src/helpers/datetime.c
===================================================================
--- trunk/src/helpers/datetime.c	(revision 180)
+++ trunk/src/helpers/datetime.c	(revision 184)
@@ -87,34 +87,5 @@
                     &ulTimeNow,
                     sizeof(ulTimeNow));
-    return (ulTimeNow);
-
-    /* DATETIME    dt;
-    ULONG       ulHours,
-                ulDaysPassed = 0;
-
-    if (G_ulDateScalarFirstCalled == 0)
-    {
-        // first call:
-        G_ulDateScalarFirstCalled = dtDate2Scalar(dt.year,
-                                                  dt.month,
-                                                  dt.day);
-    }
-    else
-    {
-        // not first call:
-        ULONG ulDateScalarNow = dtDate2Scalar(dt.year,
-                                              dt.month,
-                                              dt.day);
-        ulDaysPassed = (ulDateScalarNow - G_ulDateScalarFirstCalled);
-        _Pmpf((__FUNCTION__ ": days passed = %d", ulDaysPassed));
-    }
-
-    DosGetDateTime(&dt);
-    ulHours = dt.hours;     // this is UCHAR in DATETIME
-    // get the hours; for every day passed, add 24 hours...
-    ulHours += (24 * ulDaysPassed);
-            // 0 if we're still on the first date
-
-    return (10*(dt.hundredths + 100*(dt.seconds + 60*(dt.minutes + 60*(ulHours))))); */
+    return ulTimeNow;
 }
 
@@ -150,12 +121,12 @@
                           FTIME* pftime)         // in: time
 {
-    return (sprintf(pszTimeStamp,
-                    pcszFormatTimestamp,
-                    pfdate->year + 1980,
-                    pfdate->month,
-                    pfdate->day,
-                    pftime->hours,
-                    pftime->minutes,
-                    pftime->twosecs * 2));
+    return sprintf(pszTimeStamp,
+                   pcszFormatTimestamp,
+                   pfdate->year + 1980,
+                   pfdate->month,
+                   pfdate->day,
+                   pftime->hours,
+                   pftime->minutes,
+                   pftime->twosecs * 2);
 }
 
@@ -173,12 +144,12 @@
                          DATETIME* pdt)
 {
-    return (sprintf(pszTimeStamp,
-                    pcszFormatTimestamp,
-                    pdt->year,
-                    pdt->month,
-                    pdt->day,
-                    pdt->hours,
-                    pdt->minutes,
-                    pdt->seconds));
+    return sprintf(pszTimeStamp,
+                   pcszFormatTimestamp,
+                   pdt->year,
+                   pdt->month,
+                   pdt->day,
+                   pdt->hours,
+                   pdt->minutes,
+                   pdt->seconds);
 }
 
@@ -372,9 +343,9 @@
                     if (day == 29)
                         if (dtIsLeapYear(year))
-                            return (TRUE);
+                            return TRUE;
         }
     }
 
-    return (FALSE);
-}
-
+    return FALSE;
+}
+
Index: trunk/src/helpers/encodings.c
===================================================================
--- trunk/src/helpers/encodings.c	(revision 180)
+++ trunk/src/helpers/encodings.c	(revision 184)
@@ -15,5 +15,5 @@
 
 /*
- *      Copyright (C) 2001 Ulrich Mller.
+ *      Copyright (C) 2001-2002 Ulrich Mller.
  *      This file is part of the "XWorkplace helpers" source package.
  *      This is free software; you can redistribute it and/or modify
Index: trunk/src/helpers/nls.c
===================================================================
--- trunk/src/helpers/nls.c	(revision 180)
+++ trunk/src/helpers/nls.c	(revision 184)
@@ -85,5 +85,5 @@
 
 BOOL        G_afLeadByte[MAX_LEADBYTE] = {0};
-ULONG       G_fDBCS = -1;       // not queried yet
+ULONG       G_fDBCS = 2;       // not queried yet
 COUNTRYCODE G_cc = { 0, 0 };
 DBCSVECTOR  G_aDBCSVector[8];
@@ -94,37 +94,50 @@
  *
  *@@added V0.9.19 (2002-06-13) [umoeller]
+ *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed, this never worked
  */
 
 BOOL nlsDBCS(VOID)
 {
-    int i;
-
-    if (G_fDBCS != -1)
+    APIRET arc;
+
+    if (G_fDBCS != 2)
         // already queried:
         return G_fDBCS;
 
-    if (DosQueryDBCSEnv(8 * sizeof(DBCSVECTOR),
-                        &G_cc,
-                        (PCHAR)G_aDBCSVector))
+    // V0.9.20 (2002-07-03) [umoeller]
+    // assume a non-DBCS system UNLESS the below
+    // loop gives us something meaningful; even
+    // on non-DBCS systems like mine, DosQueryDBCSEnv
+    // does not return an error
+    G_fDBCS = FALSE;
+
+    if (arc = DosQueryDBCSEnv(8 * sizeof(DBCSVECTOR),
+                              &G_cc,
+                              (PCHAR)G_aDBCSVector))
+    {
         // not DBCS:
-        return (G_fDBCS = FALSE);
-
-    for (i = 0;
-         i < 8;
-         ++i)
-    {
-        if (    (G_aDBCSVector[i].bLow)
-             && (G_aDBCSVector[i].bHigh)
-           )
+        _PmpfF(("DosQueryDBCSEnv returned arc %d", arc));
+    }
+    else
+    {
+        int i;
+        for (i = 0;
+             i < 8;
+             ++i)
         {
-            int n;
-            for (n = G_aDBCSVector[i].bLow;
-                 n <= G_aDBCSVector[i].bHigh;
-                 ++n)
-                G_afLeadByte[n] = TRUE;
-            G_fDBCS = TRUE;
+            if (    (G_aDBCSVector[i].bLow)
+                 && (G_aDBCSVector[i].bHigh)
+               )
+            {
+                int n;
+                for (n = G_aDBCSVector[i].bLow;
+                     n <= G_aDBCSVector[i].bHigh;
+                     ++n)
+                    G_afLeadByte[n] = TRUE;
+                G_fDBCS = TRUE;
+            }
+            else
+                break;
         }
-        else
-            break;
     }
 
@@ -342,4 +355,6 @@
  *
  *      Use nlsThousandsDouble for "double" values.
+ *
+ *@@changed V0.9.20 (2002-07-03) [umoeller]: optimized
  */
 
@@ -350,8 +365,8 @@
     USHORT ust, uss, usc;
     CHAR   szTemp[40];
-    sprintf(szTemp, "%lu", ul);
+    usc = sprintf(szTemp, "%lu", ul);  // V0.9.20 (2002-07-03) [umoeller]
 
     ust = 0;
-    usc = strlen(szTemp);
+    // usc = strlen(szTemp);
     for (uss = 0; uss < usc; uss++)
     {
@@ -367,5 +382,5 @@
     pszTarget[ust] = '\0';
 
-    return (pszTarget);
+    return pszTarget;
 }
 
@@ -382,5 +397,5 @@
                                 CHAR cThousands)     // in: separator char (e.g. '.')
 {
-    return (nlsThousandsULong(pszTarget, ul, cThousands));
+    return nlsThousandsULong(pszTarget, ul, cThousands);
 }
 
@@ -389,4 +404,6 @@
  *      like nlsThousandsULong, but for a "double"
  *      value. Note that after-comma values are truncated.
+ *
+ *@@changed V0.9.20 (2002-07-03) [umoeller]: optimized
  */
 
@@ -397,8 +414,8 @@
     USHORT ust, uss, usc;
     CHAR   szTemp[40];
-    sprintf(szTemp, "%.0f", floor(dbl));
+    usc = sprintf(szTemp, "%.0f", floor(dbl)); // V0.9.20 (2002-07-03) [umoeller]
 
     ust = 0;
-    usc = strlen(szTemp);
+    // usc = strlen(szTemp);
     for (uss = 0; uss < usc; uss++)
     {
@@ -414,5 +431,5 @@
     pszTarget[ust] = '\0';
 
-    return (pszTarget);
+    return pszTarget;
 }
 
@@ -424,21 +441,22 @@
  *
  *@@added V0.9.6 (2000-11-12) [pr]
+ *@@changed V0.9.20 (2002-07-03) [umoeller]: now using PCSZ pcszUnits
  */
 
 PSZ nlsVariableDouble(PSZ pszTarget,
                       double dbl,
-                      PSZ pszUnits,
+                      PCSZ pcszUnits,
                       CHAR cThousands)
 {
     if (dbl < 100.0)
-        sprintf(pszTarget, "%.2f%s", dbl, pszUnits);
+        sprintf(pszTarget, "%.2f%s", dbl, pcszUnits);
     else
         if (dbl < 1000.0)
-            sprintf(pszTarget, "%.1f%s", dbl, pszUnits);
+            sprintf(pszTarget, "%.1f%s", dbl, pcszUnits);
         else
             strcat(nlsThousandsDouble(pszTarget, dbl, cThousands),
-                   pszUnits);
-
-    return(pszTarget);
+                   pcszUnits);
+
+    return pszTarget;
 }
 
@@ -700,12 +718,12 @@
             cc.country = 0;         // use system country code
             cc.codepage = 0;        // use process default codepage
-            return (DosMapCase(ulLength,
-                               &cc,
-                               psz));
+            return DosMapCase(ulLength,
+                              &cc,
+                              psz);
         }
     }
 
-    return (ERROR_INVALID_PARAMETER);
-}
-
-
+    return ERROR_INVALID_PARAMETER;
+}
+
+
Index: trunk/src/helpers/shapewin.c
===================================================================
--- trunk/src/helpers/shapewin.c	(revision 180)
+++ trunk/src/helpers/shapewin.c	(revision 184)
@@ -578,4 +578,5 @@
             return WinSendMsg(pRgn->pCtrl->hwndShape, msg, mp1, mp2);
     }
+
     return WinDefWindowProc(hwnd, msg, mp1, mp2);
 }
@@ -647,4 +648,5 @@
         }
     } */
+
     return 0;
 }
@@ -675,4 +677,5 @@
         pRect = &rect;
     }
+
     for (i = 0, pRgn = pCtrl->aRegion; i < pCtrl->nRegion; i++, pRgn++)
     {
@@ -683,4 +686,5 @@
         }
     }
+
     return 0;
 }
@@ -783,4 +787,5 @@
             }
         }
+
         if (inspan == TRUE)
         {
@@ -997,4 +1002,5 @@
                 NULL);                  // Pres. Param.
     }
+
     return 0;
 }
Index: trunk/src/helpers/syssound.c
===================================================================
--- trunk/src/helpers/syssound.c	(revision 180)
+++ trunk/src/helpers/syssound.c	(revision 184)
@@ -21,8 +21,11 @@
  *      These are the general flags in the "MMPM2_AlarmSoundsData"
  *      application:
+ *
  *      --  If "EnableSounds" is FALSE, all system sounds are disabled.
  *          This defaults to TRUE (tested).
+ *
  *      --  If "ApplyVolumeToAll" is TRUE, the same volume is used for
  *          all sounds. This defaults to FALSE (tested).
+ *
  *      --  If ApplyVolumeToAll is TRUE, "Volume" is used for the
  *          global volume. Otherwise, the individual sound volumes
@@ -34,5 +37,7 @@
  *
  *      Each sound data block in there consists of three elements:
+ *
  +          soundfile#description#volume
+ *
  *      where "description" is what is listed in the "Sound" object.
  *      "volume" is only used when "ApplyVolumeToAll" (above) is FALSE.
@@ -114,7 +119,8 @@
  *
  *@@added V0.9.0 [umoeller]
- */
-
-ULONG sndParseSoundData(PSZ pszSoundData,  // in: INI data from MMPM.INI
+ *@@changed V0.9.20 (2002-07-03) [umoeller]: optimized
+ */
+
+ULONG sndParseSoundData(PCSZ pszSoundData,  // in: INI data from MMPM.INI
                         PSZ pszDescr,    // out: sound description, as displayed
                                // in the "Sound" object (ptr may be NULL)
@@ -124,14 +130,13 @@
                                // even if "Global volume" is set in MMPM.INI.
 {
-    PSZ         p1 = pszSoundData, p2;
+    PCSZ        p1 = pszSoundData, p2;
     ULONG       ulrc = 0;
     // get sound file
-    p2 = strchr(p1, '#');
-    if (p2)
+    if (p2 = strchr(p1, '#'))
     {
         ulrc++;
         if (pszFile)
         {
-            strncpy(pszFile, p1, p2-p1);
+            strncpy(pszFile, p1, p2 - p1);
             pszFile[p2-p1] = '\0';
         }
@@ -139,6 +144,5 @@
 
         // get sound description
-        p2 = strchr(p1, '#');
-        if (p2)
+        if (p2 = strchr(p1, '#'))
         {
             ulrc++;
@@ -154,5 +158,6 @@
             {
                 // individual volume settings per sound
-                sscanf(p1, "%lu", pulVolume);
+                *pulVolume = atoi(p1);      // V0.9.20 (2002-07-03) [umoeller]
+                // sscanf(p1, "%lu", pulVolume);
                 ulrc++;
             }
@@ -160,5 +165,5 @@
     }
 
-    return (ulrc);
+    return ulrc;
 }
 
@@ -173,6 +178,6 @@
 VOID sndQueryMmpmIniPath(PSZ pszMMPM)       // out: fully q'fied MMPM.INI
 {
-    PSZ     pszMMPMPath = getenv("MMBASE"); // V0.9.6 (2000-10-16) [umoeller]
-    if (pszMMPMPath)
+    PSZ pszMMPMPath;
+    if (pszMMPMPath = getenv("MMBASE"))  // V0.9.6 (2000-10-16) [umoeller]
     {
         // variable set:
@@ -182,6 +187,5 @@
 
         // kill semicolon if present
-        p = strchr(pszMMPM, ';');
-        if (p)
+        if (p = strchr(pszMMPM, ';'))
            *p = 0;
 
@@ -211,10 +215,8 @@
     HAB     habDesktop = WinQueryAnchorBlock(HWND_DESKTOP);
     CHAR    szMMPM[CCHMAXPATH];
-    HINI    hini = NULLHANDLE;
 
     sndQueryMmpmIniPath(szMMPM);
 
-    hini = PrfOpenProfile(habDesktop, szMMPM);
-    return (hini);
+    return PrfOpenProfile(habDesktop, szMMPM);
 }
 
@@ -324,5 +326,5 @@
     }
 
-    return (rc);
+    return rc;
 }
 
@@ -345,6 +347,6 @@
 BOOL sndWriteSoundData(HINI hiniMMPM,       // in: MMPM.INI handle (from sndOpenMmpmIni)
                        USHORT usIndex,      // in: sound index
-                       PSZ pszDescr,        // in: sound name or NULL for removal
-                       PSZ pszFile,         // in: sound file
+                       PCSZ pszDescr,       // in: sound name or NULL for removal
+                       PCSZ pszFile,        // in: sound file
                        ULONG ulVolume)      // in: sound volume
 {
@@ -359,5 +361,6 @@
         sprintf(szData, "%s#%s#%lu", pszFile, pszDescr, ulVolume);
         brc = PrfWriteProfileString(hiniMMPM,
-                                    MMINIKEY_SYSSOUNDS, szKey,
+                                    MMINIKEY_SYSSOUNDS,
+                                    szKey,
                                     szData);
     }
@@ -366,5 +369,6 @@
         // delete entry
         brc = PrfWriteProfileString(hiniMMPM,
-                                    MMINIKEY_SYSSOUNDS, szKey,
+                                    MMINIKEY_SYSSOUNDS,
+                                    szKey,
                                     NULL);
 
@@ -396,15 +400,16 @@
 BOOL sndSetSystemSound(HAB hab,
                        USHORT usIndex,
-                       PSZ pszDescr,
-                       PSZ pszFile,
+                       PCSZ pszDescr,
+                       PCSZ pszFile,
                        ULONG ulVolume)
 {
     BOOL    brc = FALSE;
-    HINI    hiniMMPM = sndOpenMmpmIni(hab);
-    if (hiniMMPM)
+    HINI    hiniMMPM;
+    if (hiniMMPM = sndOpenMmpmIni(hab))
     {
         brc = sndWriteSoundData(hiniMMPM, usIndex, pszDescr, pszFile, ulVolume);
         PrfCloseProfile(hiniMMPM);
     }
+
     return brc;
 }
@@ -415,9 +420,47 @@
  *      in OS2SYS.INI.
  *
+ *      If so, and *ppszRealScheme is != NULL, it
+ *      is set to the key name found. Since the
+ *      scheme names are case-insensitive, this
+ *      check is necessary to delete the original
+ *      scheme for overwrites. The caller is
+ *      responsible for free()ing *ppszRealScheme
+ *      then.
+ *
  *@@added V0.9.0 [umoeller]
- */
-
-BOOL sndDoesSchemeExist(PSZ pszScheme)
-{
+ *@@changed V0.9.20 (2002-07-03) [umoeller]: check has to be case-insensitive, fixed; changed prototype
+ */
+
+BOOL sndDoesSchemeExist(PCSZ pcszScheme,
+                        PSZ *ppszRealScheme)    // out: actual key name (ptr can be NULL)
+{
+    BOOL fExists = FALSE;
+    PSZ pszKeysList;
+    if (!prfhQueryKeysForApp(HINI_SYSTEM,
+                             MMINIKEY_SOUNDSCHEMES,  // "PM_SOUND_SCHEMES_LIST"
+                             &pszKeysList))
+    {
+        PSZ pKey2 = pszKeysList;
+        while (*pKey2)
+        {
+            if (!stricmp(pKey2, pcszScheme))
+            {
+                fExists = TRUE;
+
+                if (ppszRealScheme)
+                    *ppszRealScheme = strdup(pKey2);
+
+                break;
+            }
+
+            pKey2 += strlen(pKey2)+1; // next key
+        }
+
+        free(pszKeysList);
+    }
+
+    return fExists;
+
+    /* old code V0.9.20 (2002-07-03) [umoeller]
     // check in OS2SYS.INI's scheme list whether that
     // scheme exists already
@@ -433,4 +476,6 @@
 
     return (FALSE);
+    */
+
 }
 
@@ -453,5 +498,5 @@
 
 APIRET sndCreateSoundScheme(HINI hiniMMPM,      // in: MMPM.INI handle (from sndOpenMmpmIni)
-                            PSZ pszNewScheme)   // in: name of new scheme
+                            PCSZ pszNewScheme)  // in: name of new scheme
 {
     APIRET  arc = NO_ERROR;
@@ -489,9 +534,9 @@
                 // file name and append the volume...
 
-                PSZ pSoundData = prfhQueryProfileData(hiniMMPM,
+                PSZ pSoundData;
+                if (pSoundData = prfhQueryProfileData(hiniMMPM,
                                                       MMINIKEY_SYSSOUNDS, // "MMPM2_AlarmSounds"
                                                       pKey2,
-                                                      NULL);
-                if (pSoundData)
+                                                      NULL))
                 {
                     sndParseSoundData(pSoundData,
@@ -521,5 +566,5 @@
             PrfWriteProfileString(HINI_SYSTEM,
                                   MMINIKEY_SOUNDSCHEMES,  // "PM_SOUND_SCHEMES_LIST"
-                                  pszNewScheme,      // key is scheme name
+                                  (PSZ)pszNewScheme,      // key is scheme name
                                   szNewAppName);    // data is new OS2SYS.INI application
         }
@@ -562,5 +607,5 @@
 
 APIRET sndLoadSoundScheme(HINI hiniMMPM,      // in: HINI of ?:\MMOS2\MMPM.INI (PrfOpenProfile)
-                          PSZ pszScheme)      // in: scheme name
+                          PCSZ pszScheme)     // in: scheme name
 {
     APIRET arc = NO_ERROR;
@@ -702,15 +747,15 @@
  */
 
-APIRET sndDestroySoundScheme(PSZ pszScheme)
+APIRET sndDestroySoundScheme(PCSZ pszScheme)
 {
     APIRET arc = NO_ERROR;
 
     // check in OS2SYS.INI's scheme list whether that
-    // scheme exists already
-    PSZ pszExisting = prfhQueryProfileData(HINI_SYSTEM,
+    // scheme exists
+    PSZ pszExisting;
+    if (pszExisting = prfhQueryProfileData(HINI_SYSTEM,
                                            MMINIKEY_SOUNDSCHEMES,  // "PM_SOUND_SCHEMES_LIST"
                                            pszScheme,
-                                           NULL);
-    if (pszExisting)
+                                           NULL))
     {
         // delete whole existing PM_SOUNDS_BLAHBLAH application
@@ -722,5 +767,5 @@
         PrfWriteProfileString(HINI_SYSTEM,
                               MMINIKEY_SOUNDSCHEMES,  // "PM_SOUND_SCHEMES_LIST"
-                              pszScheme,
+                              (PSZ)pszScheme,
                               NULL);
         free(pszExisting);
