Changeset 238 for trunk/src/helpers


Ignore:
Timestamp:
Dec 24, 2002, 8:44:35 AM (23 years ago)
Author:
umoeller
Message:

Misc fixes.

Location:
trunk/src/helpers
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/_call_filedlg.c

    r233 r238  
    5252                                pfd);
    5353
    54     return (hwndReturn);
     54    return hwndReturn;
    5555}
    5656
     
    323323    WinTerminate(hab);
    324324
    325     return (0);
     325    return 0;
    326326}
    327327
  • trunk/src/helpers/_test_dialog.c

    r232 r238  
    753753    WinTerminate(hab);
    754754
    755     return (0);
     755    return 0;
    756756}
  • trunk/src/helpers/animate.c

    r232 r238  
    496496    WinTerminate(hab);
    497497
    498     return (0);
     498    return 0;
    499499} */
  • trunk/src/helpers/cctl_checkcnr.c

    r229 r238  
    820820        if (DosCreateMutexSem(NULL,
    821821                              &G_hmtxCnrOwnersList, 0, FALSE) != NO_ERROR)
    822             return (FALSE);
     822            return FALSE;
    823823
    824824    if (G_pllCnrOwners == NULL)
  • trunk/src/helpers/cctl_progbar.c

    r222 r238  
    412412
    413413        WinSetWindowULong(hwndChart, QWL_USER, (ULONG)pData);
    414         return (TRUE);
    415     }
    416 
    417     return (FALSE);
     414        return TRUE;
     415    }
     416
     417    return FALSE;
    418418}
    419419
  • trunk/src/helpers/cctl_tooltip.c

    r232 r238  
    146146
    147147        // create mutex and request it right away
    148         return (!DosCreateMutexSem(NULL,
    149                                    &G_hmtxSubclassedTools,
    150                                    0,
    151                                    TRUE));      // request!
     148        return !DosCreateMutexSem(NULL,
     149                                  &G_hmtxSubclassedTools,
     150                                  0,
     151                                  TRUE);      // request!
    152152    }
    153153
     
    855855{
    856856    PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1);
     857
    857858    switch ((ULONG)mp1)
    858859    {
     
    867868    }
    868869
    869     return (0);
     870    return 0;
    870871}
    871872
     
    10231024    }
    10241025
    1025     return ((MPARAM)FALSE);
     1026    return (MRESULT)FALSE;
    10261027}
    10271028
  • trunk/src/helpers/comctl.c

    r233 r238  
    11821182        // switch static to icon mode
    11831183        pa->ulFlags = ANF_ICON;
    1184         return (pa);
     1184        return pa;
    11851185    }
    11861186
     
    13011301BOOL ctlStopAnimation(HWND hwndStatic)
    13021302{
    1303     return (WinStopTimer(WinQueryAnchorBlock(hwndStatic), hwndStatic, 1));
     1303    return WinStopTimer(WinQueryAnchorBlock(hwndStatic), hwndStatic, 1);
    13041304}
    13051305
     
    13761376        if (fPreserveProportions)
    13771377            pa->ulFlags |= ANF_PROPORTIONAL;
    1378         return (pa);
     1378        return pa;
    13791379    }
    13801380
  • trunk/src/helpers/configsys.c

    r196 r238  
    11811181        doshQueryPathSize(G_szSwapperFilename, &ulrc);
    11821182
    1183     return (ulrc);
     1183    return ulrc;
    11841184}
    11851185
     
    12001200    }
    12011201
    1202     return (0);
     1202    return 0;
    12031203} */
  • trunk/src/helpers/datetime.c

    r184 r238  
    248248long dtYears2Days (unsigned yr)
    249249{
    250    return ( yr * 365L
    251           + yr / 4
    252           - yr / 100
    253           + yr / 400);
     250   return (   yr * 365L
     251            + yr / 4
     252            - yr / 100
     253            + yr / 400);
    254254}
    255255
     
    326326            case 12 :
    327327                if (day <= 31)
    328                     return (TRUE);
     328                    return TRUE;
    329329            break;
    330330
     
    334334            case 11 :
    335335                if (day <= 30)
    336                     return (TRUE);
     336                    return TRUE;
    337337            break;
    338338
    339339            case 2 :
    340340                if (day < 29)
    341                     return (TRUE);
     341                    return TRUE;
    342342                else
    343343                    if (day == 29)
  • trunk/src/helpers/debug.c

    r229 r238  
    645645    {
    646646        fprintf(LogFile, "Error %u seeking CodeView table in %s\n", errno, FileName);
    647         return (18);
     647        return 18;
    648648    }
    649649
     
    653653    {
    654654        fprintf(LogFile, "Error %u reading debug info from %s\n", errno, FileName);
    655         return (19);
     655        return 19;
    656656    }
    657657    if (G_eodbug.dbug != DBUGSIG)
    658658    {
    659659        // fprintf(LogFile,"\nNo CodeView information stored.\n");
    660         return (100);
     660        return 100;
    661661    }
    662662
     
    667667    {
    668668        fprintf(LogFile, "Error %u seeking base codeview data in %s\n", errno, FileName);
    669         return (20);
     669        return 20;
    670670    }
    671671
     
    675675    {
    676676        fprintf(LogFile, "Error %u reading base codeview data in %s\n", errno, FileName);
    677         return (21);
     677        return 21;
    678678    }
    679679
     
    684684    {
    685685        fprintf(LogFile, "Error %u seeking dir codeview data in %s\n", errno, FileName);
    686         return (22);
     686        return 22;
    687687    }
    688688
     
    692692    {
    693693        fprintf(LogFile, "Error %u reading dir codeview data in %s\n", errno, FileName);
    694         return (23);
     694        return 23;
    695695    }
    696696
     
    701701    {
    702702        fprintf(LogFile, "Out of memory!");
    703         return (-1);
     703        return -1;
    704704    }
    705705
     
    711711        fprintf(LogFile, "Error %u reading codeview dir table from %s\n", errno, FileName);
    712712        free(pxdi->pDirTab32);
    713         return (24);
     713        return 24;
    714714    }
    715715
     
    10401040        } // end while modindex
    10411041    } // End While i < numdir
     1042
    10421043    free(pxdi->pDirTab32);
    1043     return (0);
     1044
     1045    return 0;
    10441046}
    10451047
     
    10701072    {
    10711073        fprintf(LogFile, "Error %u seeking CodeView table in %s\n", errno, FileName);
    1072         return (18);
     1074        return 18;
    10731075    }
    10741076
     
    10761078    {
    10771079        fprintf(LogFile, "Error %u reading debug info from %s\n", errno, FileName);
    1078         return (19);
     1080        return 19;
    10791081    }
    10801082    if (G_eodbug.dbug != DBUGSIG)
    10811083    {
    10821084        // fprintf(LogFile,"\nNo CodeView information stored.\n");
    1083         return (100);
     1085        return 100;
    10841086    }
    10851087
     
    10871089    {
    10881090        fprintf(LogFile, "Error %u seeking base codeview data in %s\n", errno, FileName);
    1089         return (20);
     1091        return 20;
    10901092    }
    10911093
     
    10931095    {
    10941096        fprintf(LogFile, "Error %u reading base codeview data in %s\n", errno, FileName);
    1095         return (21);
     1097        return 21;
    10961098    }
    10971099
     
    10991101    {
    11001102        fprintf(LogFile, "Error %u seeking dir codeview data in %s\n", errno, FileName);
    1101         return (22);
     1103        return 22;
    11021104    }
    11031105
     
    11051107    {
    11061108        fprintf(LogFile, "Error %u reading dir codeview data in %s\n", errno, FileName);
    1107         return (23);
     1109        return 23;
    11081110    }
    11091111
     
    11121114    {
    11131115        fprintf(LogFile, "Out of memory!");
    1114         return (-1);
     1116        return -1;
    11151117    }
    11161118
     
    11191121        fprintf(LogFile, "Error %u reading codeview dir table from %s\n", errno, FileName);
    11201122        free(pxdi->pDirTab);
    1121         return (24);
     1123        return 24;
    11221124    }
    11231125
     
    11971199        }                       // end while modindex
    11981200    }                           // End While i < numdir
     1201
    11991202    free(pxdi->pDirTab);
    1200     return (0);
     1203
     1204    return 0;
    12011205}
    12021206
     
    15421546    SymFile = fopen(SymFileName, "rb");
    15431547    if (SymFile == 0)
    1544         return (2);
     1548        return 2;
    15451549
    15461550    // read in first map definition
     
    15681572        if (fseek(SymFile, SegOffset, SEEK_SET))
    15691573            // seek error
    1570             return (3);
     1574            return 3;
    15711575
    15721576        // read in segment definition
     
    16621666        SegOffset = NEXTSEGDEFOFFSET(SegDef);
    16631667    }                           // endwhile
     1668
    16641669    fclose(SymFile);
    1665     return (0);         // no error
     1670
     1671    return 0;         // no error
    16661672}
    16671673
     
    17851791    }
    17861792
    1787     return (arc == NO_ERROR);
     1793    return !arc;
    17881794}
    17891795
  • trunk/src/helpers/dosh.c

    r234 r238  
    196196              0);
    197197
    198     return (kki.chChar);
     198    return kki.chChar;
    199199}
    200200
     
    286286    }
    287287
    288     return (s_ulrc);
     288    return s_ulrc;
    289289}
    290290
     
    353353                    &ulms,
    354354                    sizeof(ulms));
    355     return (ulms);
     355    return ulms;
    356356}
    357357
     
    375375                    ULONG cbData)
    376376{
    377     return (DosDevIOCtl(hf,
    378                         ulCategory,
    379                         ulFunction,
    380                         pvParams, cbParams, &cbParams,
    381                         pvData, cbData, &cbData));
     377    return DosDevIOCtl(hf,
     378                       ulCategory,
     379                       ulFunction,
     380                       pvParams, cbParams, &cbParams,
     381                       pvData, cbData, &cbData);
    382382}
    383383
     
    409409        *parc = ERROR_NOT_ENOUGH_MEMORY;
    410410
    411     return (pv);
     411    return pv;
    412412}
    413413
     
    467467{
    468468    PVOID   pvrc = NULL;
    469     APIRET  arc = DosAllocSharedMem((PVOID*)&pvrc,
    470                                     (PSZ)pcszName,
    471                                     ulSize,
    472                                     PAG_COMMIT | PAG_READ | PAG_WRITE);
    473     if (arc == NO_ERROR)
    474         return (pvrc);
     469
     470    if (!DosAllocSharedMem((PVOID*)&pvrc,
     471                           (PSZ)pcszName,
     472                           ulSize,
     473                           PAG_COMMIT | PAG_READ | PAG_WRITE))
     474        return pvrc;
    475475
    476476    return NULL;
     
    494494{
    495495    PVOID pvrc = NULL;
    496     APIRET arc = DosGetNamedSharedMem((PVOID*)pvrc,
    497                                       (PSZ)pcszName,
    498                                       PAG_READ | PAG_WRITE);
    499     if (arc == NO_ERROR)
    500         return (pvrc);
     496
     497    if (!DosGetNamedSharedMem((PVOID*)pvrc,
     498                              (PSZ)pcszName,
     499                              PAG_READ | PAG_WRITE))
     500        return pvrc;
    501501
    502502    return NULL;
     
    19771977        strcpy(FSInfoBuf.szVolLabel, pszNewLabel);
    19781978
    1979         return (DosSetFSInfo(ulLogicalDrive,
    1980                              FSIL_VOLSER,
    1981                              &FSInfoBuf,
    1982                              sizeof(FSInfoBuf)));
    1983     }
    1984     else
    1985         return (ERROR_LABEL_TOO_LONG);
     1979        return DosSetFSInfo(ulLogicalDrive,
     1980                            FSIL_VOLSER,
     1981                            &FSInfoBuf,
     1982                            sizeof(FSInfoBuf));
     1983    }
     1984
     1985    return ERROR_LABEL_TOO_LONG;
    19861986}
    19871987
     
    21692169    }
    21702170
    2171     return (pReturn);
     2171    return pReturn;
    21722172}
    21732173
     
    33003300    } while (!doshQueryPathSize(szFilename, &ulDummy));
    33013301
    3302     return (strdup(szFilename));
     3302    return strdup(szFilename);
    33033303}
    33043304
     
    35733573        // file found:
    35743574        return ((fs3.attrFile & FILE_DIRECTORY) != 0);
    3575     else
    3576         return FALSE;
     3575
     3576    return FALSE;
    35773577}
    35783578
     
    36363636    }
    36373637
    3638     return (arc0);
     3638    return arc0;
    36393639}
    36403640
     
    37853785        arcReturn = DosDeleteDir((PSZ)pcszDir);
    37863786
    3787     return (arcReturn);
     3787    return arcReturn;
    37883788}
    37893789
     
    43244324
    43254325    // PID is at offset 0 in the local info seg
    4326     return (*(PUSHORT)G_pvLocalInfoSeg);
     4326    return *(PUSHORT)G_pvLocalInfoSeg;
    43274327}
    43284328
     
    43444344
    43454345    // TID is at offset 6 in the local info seg
    4346     return (*(PUSHORT)((PBYTE)G_pvLocalInfoSeg + 6));
     4346    return *(PUSHORT)((PBYTE)G_pvLocalInfoSeg + 6);
    43474347}
    43484348
  • trunk/src/helpers/dosh2.c

    r229 r238  
    196196                            lAfterDot = 0;
    197197                            if (ul > 7)
    198                                 return (ERROR_FILENAME_EXCED_RANGE);
     198                                return ERROR_FILENAME_EXCED_RANGE;
    199199                        }
    200200                    }
    201201                    // and check for invalid characters
    202202                    if (strchr(pszInvalid, *pSource) != NULL)
    203                         return (ERROR_INVALID_NAME);
     203                        return ERROR_INVALID_NAME;
    204204
    205205                    pSource++;
     
    211211                            lAfterDot++;
    212212                            if (lAfterDot > 3)
    213                                 return (ERROR_FILENAME_EXCED_RANGE);
     213                                return ERROR_FILENAME_EXCED_RANGE;
    214214                        }
    215215                }
     
    221221                    if (lDotOfs == -1)  // dot not found:
    222222                        if (cbFile > 8)
    223                             return (ERROR_FILENAME_EXCED_RANGE);
     223                            return ERROR_FILENAME_EXCED_RANGE;
    224224            }
    225225
     
    333333{
    334334    APIRET  arc = NO_ERROR;
    335     if (!pcszDir)
    336         return (ERROR_INVALID_PARAMETER);
    337     {
    338         if (*pcszDir != 0)
    339             if (*(pcszDir+1) == ':')
    340             {
    341                 // drive given:
    342                 CHAR    cDrive = toupper(*(pcszDir));
    343                 // change drive
    344                 arc = DosSetDefaultDisk( (ULONG)(cDrive - 'A' + 1) );
    345                         // 1 = A:, 2 = B:, ...
    346             }
    347 
     335
     336    if (    (!pcszDir)
     337         || (!(*pcszDir))
     338       )
     339        return ERROR_INVALID_PARAMETER;
     340
     341    if (pcszDir[1] == ':')
     342    {
     343        // drive given:
     344        CHAR    cDrive = toupper(*(pcszDir));
     345        // change drive
     346        arc = DosSetDefaultDisk( (ULONG)(cDrive - 'A' + 1) );
     347                // 1 = A:, 2 = B:, ...
     348    }
     349
     350    if (!arc)
    348351        arc = DosSetCurrentDir((PSZ)pcszDir);
    349     }
    350352
    351353    return arc;       // V0.9.9 (2001-04-04) [umoeller]
     
    658660    USHORT usCount = 0;
    659661    DosPhysicalDisk(INFO_COUNT_PARTITIONABLE_DISKS, &usCount, 2, 0, 0);
    660     return (usCount);
     662    return usCount;
    661663}
    662664
     
    923925STATIC USHORT GetCyl(USHORT rBeginSecCyl)
    924926{
    925     return (   (rBeginSecCyl & 0x00C0) << 2)
    926              + ((rBeginSecCyl & 0xFF00) >> 8);
     927    return   ((rBeginSecCyl & 0x00C0) << 2)
     928           + ((rBeginSecCyl & 0xFF00) >> 8);
    927929}
    928930
     
    10051007    }
    10061008
    1007     return (ERROR_NOT_SUPPORTED);
     1009    return ERROR_NOT_SUPPORTED;
    10081010}
    10091011
     
    13921394
    13931395    if (!ppList)
    1394         return (ERROR_INVALID_PARAMETER);
     1396        return ERROR_INVALID_PARAMETER;
    13951397
    13961398    if (!(arc = doshQueryLVMInfo(&pLVMInfo)))
     
    14591461{
    14601462    if (!ppList)
    1461         return (ERROR_INVALID_PARAMETER);
    1462     else
    1463     {
    1464         CleanPartitionInfos(ppList->pPartitionInfo);
    1465         doshFreeLVMInfo(ppList->pLVMInfo);
    1466         free(ppList);
    1467     }
     1463        return ERROR_INVALID_PARAMETER;
     1464
     1465    CleanPartitionInfos(ppList->pPartitionInfo);
     1466    doshFreeLVMInfo(ppList->pLVMInfo);
     1467    free(ppList);
    14681468
    14691469    return NO_ERROR;
     
    18591859
    18601860    if (!pLVMInfo)
    1861         return (ERROR_INVALID_PARAMETER);
     1861        return ERROR_INVALID_PARAMETER;
    18621862
    18631863    // initialize LVM engine
  • trunk/src/helpers/eah.c

    r222 r238  
    242242    }
    243243
    244     return (ulTotalEASize);
     244    return ulTotalEASize;
    245245}
    246246
     
    254254PEALIST eaPathReadAll(const char *pcszPath)
    255255{
    256     return (ReadEAList(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath));
     256    return ReadEAList(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath);
    257257}
    258258
     
    264264PEALIST eaHFileReadAll(HFILE hfile)
    265265{
    266     return (ReadEAList(ENUMEA_REFTYPE_FHANDLE, (&hfile)));
     266    return ReadEAList(ENUMEA_REFTYPE_FHANDLE, (&hfile));
    267267}
    268268
     
    278278PEABINDING eaPathReadOneByIndex(const char *pcszPath, ULONG index)
    279279{
    280     return (ReadEAByIndex(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, index));
     280    return ReadEAByIndex(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, index);
    281281}
    282282
     
    288288PEABINDING eaHFileReadOneByIndex(HFILE hfile, ULONG index)
    289289{
    290     return (ReadEAByIndex(ENUMEA_REFTYPE_FHANDLE, (&hfile), index));
     290    return ReadEAByIndex(ENUMEA_REFTYPE_FHANDLE, (&hfile), index);
    291291}
    292292
     
    300300PEABINDING eaPathReadOneByName(const char *pcszPath, const char *pcszEAName)
    301301{
    302     return (ReadEAByName(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, (PSZ)pcszEAName));
     302    return ReadEAByName(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, (PSZ)pcszEAName);
    303303}
    304304
     
    310310PEABINDING eaHFileReadOneByName(HFILE hfile, const char *pcszEAName)
    311311{
    312     return (ReadEAByName(ENUMEA_REFTYPE_FHANDLE, (&hfile), (PSZ)pcszEAName));
     312    return ReadEAByName(ENUMEA_REFTYPE_FHANDLE, (&hfile), (PSZ)pcszEAName);
    313313}
    314314
     
    334334APIRET eaPathWriteAll(const char *pcszPath, PEALIST list)
    335335{
    336     return (WriteEAList(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, list));
     336    return WriteEAList(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, list);
    337337}
    338338
     
    346346APIRET eaHFileWriteAll(HFILE hfile, PEALIST list)
    347347{
    348     return (WriteEAList(ENUMEA_REFTYPE_FHANDLE, (&hfile), list));
     348    return WriteEAList(ENUMEA_REFTYPE_FHANDLE, (&hfile), list);
    349349}
    350350
     
    365365APIRET eaPathWriteOne(const char *pcszPath, PEABINDING peab)
    366366{
    367     return (WriteEA(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, peab));
     367    return WriteEA(ENUMEA_REFTYPE_PATH, (PSZ)pcszPath, peab);
    368368}
    369369
     
    377377APIRET eaHFileWriteOne(HFILE hfile, PEABINDING peab)
    378378{
    379     return (WriteEA(ENUMEA_REFTYPE_FHANDLE, (&hfile), peab));
     379    return WriteEA(ENUMEA_REFTYPE_FHANDLE, (&hfile), peab);
    380380}
    381381
     
    398398    eab.usValueLength = 0;
    399399    eab.pszValue = 0;
    400     return (eaPathWriteOne(pcszPath, &eab));
     400    return eaPathWriteOne(pcszPath, &eab);
    401401}
    402402
     
    431431            // first USHORT always has EAT_* flag
    432432            usReturn = *((PUSHORT)(peab->pszValue));
    433     return (usReturn);
     433    return usReturn;
    434434}
    435435
     
    465465    }
    466466
    467     return (pszReturn);
     467    return pszReturn;
    468468}
    469469
     
    533533    }
    534534
    535     return (peab);
     535    return peab;
    536536}
    537537
     
    583583    }
    584584
    585     return (usReturn);
     585    return usReturn;
    586586}
    587587
     
    722722    } // end if (usEAType == EAT_MVMT)
    723723
    724     return (pszReturn);
     724    return pszReturn;
    725725}
    726726
     
    819819    }
    820820
    821     return (pszTotal);
     821    return pszTotal;
    822822}
    823823
     
    933933    } // end if (pszInput)
    934934
    935     return (peab);
     935    return peab;
    936936}
    937937
     
    976976        index += 1;
    977977    }
    978     return (head);
     978    return head;
    979979}
    980980
     
    10101010            return NULL;
    10111011        if ((strcmp(name, (dena->szName))) == 0)
    1012             return (GetEAValue(type, pfile, dena));
     1012            return GetEAValue(type, pfile, dena);
    10131013        free(dena);
    10141014        index += 1;
     
    10571057    {
    10581058        free(dena);
    1059         return (0);
     1059        return 0;
    10601060    }
    1061     else
    1062         return (dena);
     1061
     1062    return dena;
    10631063}
    10641064
     
    10861086    free(eaop.fpGEA2List);
    10871087    if (arc == NO_ERROR)
    1088         return (ConvertFeal2Binding(eaop.fpFEA2List));
    1089     else
    1090         return NULL;
     1088        return ConvertFeal2Binding(eaop.fpFEA2List);
     1089
     1090    return NULL;
    10911091}
    10921092
     
    11421142        free(feal);
    11431143    }
    1144     return (binding);
     1144
     1145    return binding;
    11451146}
    11461147
     
    12161217                (EA_BINDING_VALUE (binding)),
    12171218                (fea->cbValue));
    1218     return (feal);
     1219    return feal;
    12191220}
    12201221
  • trunk/src/helpers/gpih.c

    r232 r238  
    10921092    if (!G_hmtxLCIDs)
    10931093        // first call: create
    1094         return (!DosCreateMutexSem(NULL,
    1095                                    &G_hmtxLCIDs,
    1096                                    0,
    1097                                    TRUE));     // request!
     1094        return !DosCreateMutexSem(NULL,
     1095                                  &G_hmtxLCIDs,
     1096                                  0,
     1097                                  TRUE);     // request!
    10981098
    10991099    // subsequent calls: request
  • trunk/src/helpers/level.c

    r222 r238  
    529529STATIC PSYSLEVELDATA _allocsysleveldata(HFILE hFile)
    530530{
    531     return (PSYSLEVELDATA) malloc(sizeof(SYSLEVELDATA));
     531    return (PSYSLEVELDATA)malloc(sizeof(SYSLEVELDATA));
    532532}
    533533
  • trunk/src/helpers/linklist.c

    r232 r238  
    113113void* lstMalloc(size_t size)
    114114{
    115     return (malloc(size));
     115    return malloc(size);
    116116}
    117117
     
    128128void* lstStrDup(const char *pcsz)
    129129{
    130     return (strdup(pcsz));
     130    return strdup(pcsz);
    131131}
    132132
     
    521521    PLISTNODE pNode;
    522522    if (pNode = lstNodeFromIndex(pList, ulIndex))
    523         return (pNode->pItemData);
    524     else
    525         return (0);
     523        return pNode->pItemData;
     524
     525    return NULL;
    526526}
    527527
  • trunk/src/helpers/math.c

    r174 r238  
    6464    }
    6565
    66     return (a);
     66    return a;
    6767
    6868}
     
    225225    }
    226226
    227     return (rc);
     227    return rc;
    228228}
    229229
     
    310310    {
    311311        if (!rc)
    312             return (0);
     312            return 0;
    313313
    314314        rc++;
     
    318318    }
    319319
    320     return (rc);
     320    return rc;
    321321}
    322322
     
    353353    }
    354354
    355     return (d);
    356 }
    357 
    358 
     355    return d;
     356}
     357
     358
  • trunk/src/helpers/memdebug.c

    r222 r238  
    199199    }
    200200    else
    201         return (!DosRequestMutexSem(G_hmtxMallocList,
    202                                     SEM_INDEFINITE_WAIT));
    203 
    204     return (FALSE);
     201        return !DosRequestMutexSem(G_hmtxMallocList,
     202                                   SEM_INDEFINITE_WAIT);
     203
     204    return FALSE;
    205205}
    206206
     
    246246STATIC PHEAPITEM FindHeapItem(void *p)
    247247{
    248     return ((PHEAPITEM)treeFind(G_pHeapItemsRoot,
    249                                 (ULONG)p,
    250                                 treeCompareKeys));
     248    return (PHEAPITEM)treeFind(G_pHeapItemsRoot,
     249                               (ULONG)p,
     250                               treeCompareKeys);
    251251}
    252252
     
    417417        }
    418418
    419     return (prc);
     419    return prc;
    420420}
    421421
     
    440440                         pcszFunction);
    441441    memset(p, 0, num * stSize);
    442     return (p);
     442    return p;
    443443}
    444444
     
    547547        // p == NULL: this is valid, use malloc() instead
    548548        // V0.9.12 (2001-05-21) [umoeller]
    549         return (memdMalloc(stSize, pcszSourceFile, ulLine, pcszFunction));
     549        return memdMalloc(stSize, pcszSourceFile, ulLine, pcszFunction);
    550550
    551551    if (memdLock())
     
    665665    }
    666666
    667     return (prc);
     667    return prc;
    668668}
    669669
     
    727727    }
    728728
    729     return (ulItemsReleased);
     729    return ulItemsReleased;
    730730}
    731731
  • trunk/src/helpers/memdebug_win.c

    r222 r238  
    151151                ulTotalAllocated += Size;
    152152        }
    153         return (0);
     153        return 0;
    154154    }
    155155
     
    194194            }
    195195            else
    196                 return (1);     // stop
     196                return 1;     // stop
    197197        }
    198198
    199         return (0);
     199        return 0;
    200200    }
    201201
     
    416416    if ((pmrc1) && (pmrc2))
    417417        if (pmrc1->ulIndex < pmrc2->ulIndex)
    418             return (-1);
     418            return -1;
    419419        else if (pmrc1->ulIndex > pmrc2->ulIndex)
    420             return (1);
    421 
    422     return (0);
     420            return 1;
     421
     422    return 0;
    423423}
    424424
     
    439439                                      0))
    440440            {
    441                 case WCS_LT: return (-1);
    442                 case WCS_GT: return (1);
     441                case WCS_LT: return -1;
     442                case WCS_GT: return 1;
    443443                default:    // equal
    444444                    if (pmrc1->ulLine < pmrc2->ulLine)
    445                         return (-1);
     445                        return -1;
    446446                    else if (pmrc1->ulLine > pmrc2->ulLine)
    447                         return (1);
     447                        return 1;
    448448
    449449            }
    450450
    451     return (0);
     451    return 0;
    452452}
    453453
     
    464464    {
    465465        if (pmrc1->ulSize > pmrc2->ulSize)
    466             return (1);
     466            return 1;
    467467        else if (pmrc1->ulSize < pmrc2->ulSize)
    468             return (-1);
     468            return -1;
    469469    }
    470470
    471     return (0);
     471    return 0;
    472472}
    473473
     
    484484    {
    485485        if (pmrc1->ulAddress > pmrc2->ulAddress)
    486             return (1);
     486            return 1;
    487487        else if (pmrc1->ulAddress < pmrc2->ulAddress)
    488             return (-1);
     488            return -1;
    489489    }
    490490
    491     return (0);
     491    return 0;
    492492}
    493493
  • trunk/src/helpers/prfh.c

    r194 r238  
    166166        *pcbBuf = ulSizeOfData;
    167167
    168     return (pData);
     168    return pData;
    169169}
    170170
     
    213213        *pcbBuf = ulSizeOfData;
    214214
    215     return (pData);
     215    return pData;
    216216}
    217217
     
    239239                          szDefault,
    240240                          szTemp, sizeof(szTemp)-1);
    241     return (szTemp[0]);
     241    return szTemp[0];
    242242}
    243243
     
    260260                sizeof(szColor)-1);
    261261    sscanf(szColor, "%lu %lu %lu ", &r, &g, &b);
    262     return (LONG)(r*0x10000 + g*0x100 + b);
     262    return (LONG)(r * 0x10000 + g * 0x100 + b);
    263263}
    264264
     
    344344        ulrc = PRFERR_DATASIZE;
    345345
    346     return (ulrc);
     346    return ulrc;
    347347}
    348348
     
    518518    }
    519519
    520     return (ulrc);
     520    return ulrc;
    521521}
    522522
  • trunk/src/helpers/prfh2.c

    r229 r238  
    109109    }
    110110
    111     return (ulrc);
     111    return ulrc;
    112112}
    113113
     
    129129    sprintf(szError2, "An error occured copying the profile %s: \n%s",
    130130            pcszINI, pszErrorString);
    131     return (prfhINIError(ulOptions, fLog, fncbError, szError2));
     131    return prfhINIError(ulOptions, fLog, fncbError, szError2);
    132132}
    133133
     
    638638
    639639    if (ulErrorOccured != MBID_IGNORE)
    640         return (999);
     640        return 999;
    641641    else
    642642        return NO_ERROR;
  • trunk/src/helpers/procstat.c

    r229 r238  
    9494
    9595    if (!ppps)
    96         return (ERROR_INVALID_PARAMETER);
     96        return ERROR_INVALID_PARAMETER;
    9797
    9898    // changed allocation V0.9.10 (2001-04-08) [umoeller]:
     
    187187    }
    188188
    189     return (pReturn);
     189    return pReturn;
    190190}
    191191
     
    222222    }
    223223
    224     return (pReturn);
     224    return pReturn;
    225225}
    226226
     
    300300    }
    301301
    302     return (rc);
     302    return rc;
    303303}
    304304
     
    349349    }
    350350
    351     return (ulrc);
     351    return ulrc;
    352352}
    353353
     
    394394    }
    395395
    396     return (ulrc);
     396    return ulrc;
    397397}
    398398
     
    483483    if (prc16QueryThreadInfo(pps, usPID, usTID, &prct))
    484484        ulrc = prct.ulPriority;
    485     return (ulrc);
     485    return ulrc;
    486486}
    487487
     
    533533
    534534            if (arc == NO_ERROR)
    535                 return ((PQTOPLEVEL32)pBuf);
     535                return (PQTOPLEVEL32)pBuf;
    536536            else
    537537                DosFreeMem(pBuf);
     
    594594
    595595    if (pProcThis->ulRecType == 1)
    596         return (pProcThis);
    597     else
    598         return NULL;
     596        return pProcThis;
     597
     598    return NULL;
    599599}
    600600
     
    649649    {
    650650        if (i == usSemID)
    651             return (pSemThis);
     651            return pSemThis;
    652652
    653653        i++;
     
    678678    {
    679679        if (pSemThis->usIndex == usSemID)
    680             return (pSemThis);
     680            return pSemThis;
    681681
    682682        pSemThis = pSemThis->pNext;
     
    704704    {
    705705        if (pShrMem->usHandle == usShrMemID)
    706             return (pShrMem);
     706            return pShrMem;
    707707        pShrMem = pShrMem->pNext;
    708708    }
     
    759759        {
    760760            if (pFile->paFiles[ul].usSFN == usFileID)
    761                 return (pFile);
     761                return pFile;
    762762        }
    763763
  • trunk/src/helpers/regexp.c

    r222 r238  
    10111011            return MTYPE_CREP;
    10121012        default:
    1013             return (MTYPE) - 1;
     1013            return (MTYPE)-1;
    10141014    }
    10151015}
  • trunk/src/helpers/shapewin.c

    r222 r238  
    537537            pRgn = (PSHPREGION)PVOIDFROMMP(mp1);
    538538            WinSetWindowPtr(hwnd, 0, (PVOID) pRgn);
    539         return (MRESULT) FALSE;
     539        return (MRESULT)FALSE;
    540540
    541541        /*
     
    549549            shprgnDraw(hps, pRgn);
    550550            WinEndPaint(hps)  ;
    551         return (MRESULT) 0;
     551        return (MRESULT)0;
    552552
    553553        case WM_MOUSEMOVE    :
     
    11731173
    11741174            if (pCtrl == NULL)
    1175                 return (MRESULT) TRUE;
     1175                return (MRESULT)TRUE;
    11761176
    11771177            // store control data in window words
    11781178            WinSetWindowPtr(hwnd, 0, (PVOID) pCtrl);
    1179             return (MRESULT) FALSE;
     1179            return (MRESULT)FALSE;
    11801180
    11811181        /*
     
    11871187            // TRACE("WM_DESTORY\n");
    11881188            shpmgrWMDestroy(pCtrl);
    1189             return (MRESULT) 0;
     1189            return (MRESULT)0;
    11901190
    11911191        /*
     
    12121212            // never show ourselves
    12131213            pswp->fl &= ~SWP_SHOW;
    1214             return (MRESULT) 0;
     1214            return (MRESULT)0;
    12151215
    12161216        /*
     
    12211221        case SHAPEWIN_MSG_UPDATE:
    12221222            shpmgrUpdateRegions(pCtrl, (PRECTL) PVOIDFROMMP(mp1));
    1223             return (MRESULT) 0;
     1223            return (MRESULT)0;
    12241224
    12251225        /*
     
    12701270            WinValidateRect(hwnd, NULL, FALSE);
    12711271            // WinEndPaint(hps);
    1272             return (MRESULT) 0;
     1272            return (MRESULT)0;
    12731273        }
    12741274
  • trunk/src/helpers/stringh.c

    r196 r238  
    220220 *@@ strhdup:
    221221 *      like strdup, but this one doesn't crash if pszSource
    222  *      is NULL, but returns NULL also. In addition, this
     222 *      is NULL. Instead, this returns NULL if pcszSource is
     223 *      NULL or points to a null byte. In addition, this
    223224 *      can report the length of the string (V0.9.16).
    224225 *
     
    407408{
    408409    if (pcsz) //  && *pcsz) // V0.9.18 (2002-03-27) [umoeller]
    409         return (strlen(pcsz) + 1);
     410        return strlen(pcsz) + 1;
    410411
    411412    return 0;
     
    10281029        *pulOffset = prc - pcszSearchIn;
    10291030
    1030     return ((PSZ)prc);
     1031    return (PSZ)prc;
    10311032}
    10321033
     
    18551856
    18561857    if (pattern_size == 0)              //  Empty patterns match at start
    1857         return ((void *)block);
     1858        return (void*)block;
    18581859
    18591860    //  Build the shift table unless we're continuing a previous search
     
    19011902            // If we found a match, return the start address
    19021903            if (match_size >= pattern_size)
    1903                 return ((void*)(match_base));
     1904                return (void*)match_base;
    19041905
    19051906        }
     
    19591960
    19601961    if (pattern_size == 0)              //  Empty string matches at start
    1961         return (char *) string;
     1962        return (char*)string;
    19621963
    19631964    //  Build the shift table
     
    19971998            //  If we found a match, return the start address
    19981999            if (match_size >= pattern_size)
    1999                 return ((char *)(match_base));
     2000                return (char*)match_base;
    20002001          }
    20012002      }
  • trunk/src/helpers/syssound.c

    r184 r238  
    472472    {
    473473        free(pszExisting);
    474         return (TRUE);
    475     }
    476 
    477     return (FALSE);
     474        return TRUE;
     475    }
     476
     477    return FALSE;
    478478    */
    479479
  • trunk/src/helpers/textv_html.c

    r222 r238  
    991991                case 'd': // DD
    992992                    if ((*p2 == 0) && (!fEndOfTag))
    993                         return (TagDD);
     993                        return TagDD;
    994994                break;
    995995
     
    12501250    }
    12511251
    1252     return (pProcessor);
     1252    return pProcessor;
    12531253}
    12541254
     
    18631863    }
    18641864
    1865     return (crc);
     1865    return crc;
    18661866}
    18671867
  • trunk/src/helpers/threads.c

    r229 r238  
    390390    }
    391391
    392     return (ulrc);
     392    return ulrc;
    393393}
    394394
     
    477477    }
    478478
    479     return (ulrc);
     479    return ulrc;
    480480}
    481481
     
    526526    }
    527527
    528     return (pArray);
     528    return pArray;
    529529}
    530530
     
    577577    {
    578578        pti->fExit = TRUE;
    579         return (TRUE);
    580     }
    581     return (FALSE);
     579        return TRUE;
     580    }
     581    return FALSE;
    582582}
    583583
     
    605605            DosWaitThread(&pti->tid, DCWW_WAIT);
    606606            pti->tid = NULLHANDLE;
    607             return (TRUE);
     607            return TRUE;
    608608        }
    609     return (FALSE);
     609    return FALSE;
    610610}
    611611
     
    624624        thrWait(pti);
    625625    }
    626     return (TRUE);
     626    return TRUE;
    627627}
    628628
     
    649649        DosKillThread(pti->tid);
    650650    }
    651     return (TRUE);
     651    return TRUE;
    652652}
    653653
     
    662662{
    663663    if (pti)
    664         return (pti->tid);
    665 
    666     return (NULLHANDLE);
     664        return pti->tid;
     665
     666    return NULLHANDLE;
    667667}
    668668
     
    691691        if (ptib)
    692692            if (ptib->tib_ptib2)
    693                 return (ptib->tib_ptib2->tib2_ulpri);
    694     return (0);
    695 }
    696 
    697 
     693                return ptib->tib_ptib2->tib2_ulpri;
     694    return 0;
     695}
     696
     697
  • trunk/src/helpers/timer.c

    r222 r238  
    162162{
    163163    if (!G_hmtxTimers)
    164         return (!DosCreateMutexSem(NULL,
    165                                    &G_hmtxTimers,
    166                                    0,
    167                                    TRUE));      // request!
    168     else
    169         return !DosRequestMutexSem(G_hmtxTimers, SEM_INDEFINITE_WAIT);
     164        return !DosCreateMutexSem(NULL,
     165                                  &G_hmtxTimers,
     166                                  0,
     167                                  TRUE);      // request!
     168
     169    return !DosRequestMutexSem(G_hmtxTimers, SEM_INDEFINITE_WAIT);
    170170}
    171171
     
    207207               )
    208208            {
    209                 return (pTimer);
     209                return pTimer;
    210210            }
    211211
     
    394394    }
    395395
    396     return (pSet);
     396    return pSet;
    397397}
    398398
     
    733733    }
    734734
    735     return (usrc);
     735    return usrc;
    736736}
    737737
  • trunk/src/helpers/tmsgfile.c

    r222 r238  
    148148 *@@added V0.9.18 (2002-03-24) [umoeller]
    149149 *@@changed V0.9.20 (2002-07-19) [umoeller]: optimized, no longer holding all msgs im mem
     150 *@@changed V1.0.1 (2002-12-16) [pr]: Ctrl-Z fix
    150151 */
    151152
     
    181182                cbRead - 1);    // not including null byte
    182183
    183         // convert to plain C format
    184         /* xstrConvertLineFormat(&pTmf->strContent,
    185                               CRLF2LF);
    186         */
    187 
    188         // kick out all the comments
    189         /*
    190         while (pStartOfMarker = strstr(pTmf->strContent.psz, "\n;"))
    191         {
    192             // copy the next line over this
    193             PCSZ pEOL = strhFindEOL(pStartOfMarker + 2, NULL);
    194             xstrrpl(&pTmf->strContent,
    195                     // ofs of first char to replace: "\n;"
    196                     pStartOfMarker - pTmf->strContent.psz,
    197                     // no. of chars to replace:
    198                     pEOL - pStartOfMarker,
    199                     // string to replace chars with:
    200                     NULL,
    201                     // length of replacement string:
    202                     0);
    203         }
    204         */
    205 
    206         // free excessive memory
    207         // xstrShrink(&pTmf->strContent);
    208 
     184        // go build a tree of all message IDs...
    209185        pStartOfFile = strContents.psz;
    210 
    211         // go build a tree of all message IDs...
    212186
    213187        // find first start message marker
     
    301275                        pNew->cbText = strlen(pStartOfText);
    302276
    303                 // remove trailing newlines
     277                // remove trailing newlines and Ctrl-Z
    304278                while (    (pNew->cbText)
    305279                        && (    (pStartOfText[pNew->cbText - 1] == '\n')
    306280                             || (pStartOfText[pNew->cbText - 1] == '\r')
     281                             || (pStartOfText[pNew->cbText - 1] == '\x1a') // V1.0.1 (2002-12-16) [pr]
    307282                           )
    308283                      )
     
    335310 *
    336311 *      Use tmfCloseMessageFile to close the file
    337  *      again and free all resources. This thing
    338  *      can allocate quite a bit of memory.
     312 *      again and free all resources.
    339313 *
    340314 *      Returns:
     
    415389STATIC VOID FreeInternalMem(PTMFMSGFILE pTmf)
    416390{
    417     LONG   cItems;
     391    LONG    cItems;
    418392    TREE**  papNodes;
    419393
    420     if (cItems = pTmf->cIDs)
     394    if (    (cItems = pTmf->cIDs)
     395         && (papNodes = treeBuildArray(pTmf->IDsTreeRoot,
     396                                       &cItems))
     397       )
    421398    {
    422         if (papNodes = treeBuildArray(pTmf->IDsTreeRoot,
    423                                       &cItems))
     399        ULONG ul;
     400        for (ul = 0; ul < cItems; ul++)
    424401        {
    425             ULONG ul;
    426             for (ul = 0; ul < cItems; ul++)
    427             {
    428                 PMSGENTRY pNodeThis = (PMSGENTRY)(papNodes[ul]);
    429 
    430                 xstrClear(&pNodeThis->strID);
    431 
    432                 free(pNodeThis);
    433             }
    434 
    435             free(papNodes);
     402            PMSGENTRY pNodeThis = (PMSGENTRY)(papNodes[ul]);
     403
     404            xstrClear(&pNodeThis->strID);
     405
     406            free(pNodeThis);
    436407        }
     408
     409        free(papNodes);
    437410    }
    438411}
     
    464437    }
    465438
    466     return (ERROR_INVALID_PARAMETER);
     439    return ERROR_INVALID_PARAMETER;
    467440}
    468441
     
    503476                     ULONG cTableEntries)       // in: count of items in pTable or null
    504477{
    505     APIRET arc = NO_ERROR;
     478    APIRET  arc;
     479    ULONG   cbFile;
     480    PXFILE  pFile;
    506481
    507482    if (    (!pMsgFile)
    508483         || (!pMsgFile->pszFilename)
    509484       )
    510         arc = ERROR_INVALID_PARAMETER;
    511     else
     485        return ERROR_INVALID_PARAMETER;
     486
     487    // open the file again V0.9.20 (2002-07-19) [umoeller]
     488    if (!(arc = doshOpen(pMsgFile->pszFilename,
     489                         XOPEN_READ_EXISTING,
     490                         &cbFile,
     491                         &pFile)))
    512492    {
    513         // open the file again V0.9.20 (2002-07-19) [umoeller]
    514         ULONG   cbFile;
    515         PXFILE  pFile;
    516         if (!(arc = doshOpen(pMsgFile->pszFilename,
    517                              XOPEN_READ_EXISTING,
    518                              &cbFile,
    519                              &pFile)))
     493        // check if last-write date/time changed compared
     494        // to the last time we opened the thing...
     495        // V0.9.18 (2002-03-24) [umoeller]
     496        FILESTATUS3 fs3;
     497        if (!(arc = DosQueryFileInfo(pFile->hf,
     498                                     FIL_STANDARD,
     499                                     &fs3,
     500                                     sizeof(fs3))))
    520501        {
    521             // check if last-write date/time changed compared
    522             // to the last time we opened the thing...
    523             // V0.9.18 (2002-03-24) [umoeller]
    524             FILESTATUS3 fs3;
    525             if (!(arc = DosQueryFileInfo(pFile->hf,
    526                                          FIL_STANDARD,
    527                                          &fs3,
    528                                          sizeof(fs3))))
     502            CHAR szTemp[30];
     503            dtCreateFileTimeStamp(szTemp,
     504                                  &fs3.fdateLastWrite,
     505                                  &fs3.ftimeLastWrite);
     506            if (strcmp(szTemp, pMsgFile->szTimestamp))
    529507            {
    530                 CHAR szTemp[30];
    531                 dtCreateFileTimeStamp(szTemp,
    532                                       &fs3.fdateLastWrite,
    533                                       &fs3.ftimeLastWrite);
    534                 if (strcmp(szTemp, pMsgFile->szTimestamp))
     508                // last write date changed:
     509                _Pmpf((__FUNCTION__ ": timestamp changed, recompiling"));
     510                FreeInternalMem(pMsgFile);
     511
     512                if (!(arc = LoadAndCompile(pMsgFile, pFile)))
     513                    strcpy(pMsgFile->szTimestamp, szTemp);
     514            }
     515        }
     516
     517        if (!arc)
     518        {
     519            // go find the message in the tree
     520            PMSGENTRY pEntry;
     521            if (!(pEntry = (PMSGENTRY)treeFind(pMsgFile->IDsTreeRoot,
     522                                               (ULONG)pcszMessageName,
     523                                               treeCompareStrings)))
     524                arc = ERROR_MR_MID_NOT_FOUND;
     525            else
     526            {
     527                PSZ     pszMsg;
     528                ULONG   cbRead = pEntry->cbText;
     529
     530                if (!(pszMsg = (PSZ)malloc(cbRead + 1)))
     531                    arc = ERROR_NOT_ENOUGH_MEMORY;
     532                else if (!(arc = doshReadAt(pFile,
     533                                            pEntry->ulOfsText,
     534                                            &cbRead,
     535                                            pszMsg,
     536                                            DRFL_NOCACHE | DRFL_FAILIFLESS)))
    535537                {
    536                     // last write date changed:
    537                     _Pmpf((__FUNCTION__ ": timestamp changed, recompiling"));
    538                     FreeInternalMem(pMsgFile);
    539 
    540                     if (!(arc = LoadAndCompile(pMsgFile, pFile)))
    541                         strcpy(pMsgFile->szTimestamp, szTemp);
    542                 }
    543             }
    544 
    545             if (!arc)
    546             {
    547                 // go find the message in the tree
    548                 PMSGENTRY pEntry;
    549                 if (!(pEntry = (PMSGENTRY)treeFind(pMsgFile->IDsTreeRoot,
    550                                                    (ULONG)pcszMessageName,
    551                                                    treeCompareStrings)))
    552                     arc = ERROR_MR_MID_NOT_FOUND;
    553                 else
    554                 {
    555                     PSZ     pszMsg;
    556                     ULONG   cbRead = pEntry->cbText;
    557 
    558                     if (!(pszMsg = (PSZ)malloc(cbRead + 1)))
    559                         arc = ERROR_NOT_ENOUGH_MEMORY;
    560                     else if (!(arc = doshReadAt(pFile,
    561                                                 pEntry->ulOfsText,
    562                                                 &cbRead,
    563                                                 pszMsg,
    564                                                 DRFL_NOCACHE | DRFL_FAILIFLESS)))
     538                    // null-terminate
     539                    pszMsg[cbRead] = '\0';
     540                    xstrset2(pstr,
     541                             pszMsg,
     542                             cbRead);
     543
     544                    // kick out \r\n
     545                    xstrConvertLineFormat(pstr,
     546                                          CRLF2LF);
     547
     548                    // now replace strings from the table
     549                    if (cTableEntries && pTable)
    565550                    {
    566                         // null-terminate
    567                         pszMsg[cbRead] = '\0';
    568                         xstrset2(pstr,
    569                                  pszMsg,
    570                                  cbRead);
    571 
    572                         // kick out \r\n
    573                         xstrConvertLineFormat(pstr,
    574                                               CRLF2LF);
    575 
    576                         // now replace strings from the table
    577                         if (cTableEntries && pTable)
     551                        CHAR szFind[10] = "%0";
     552                        ULONG ul;
     553                        for (ul = 0;
     554                             ul < cTableEntries;
     555                             ul++)
    578556                        {
    579                             CHAR szFind[10] = "%0";
    580                             ULONG ul;
    581                             for (ul = 0;
    582                                  ul < cTableEntries;
    583                                  ul++)
    584                             {
    585                                 ULONG ulOfs = 0;
    586 
    587                                 _ultoa(ul + 1, szFind + 1, 10);
    588                                 while (xstrFindReplaceC(pstr,
    589                                                         &ulOfs,
    590                                                         szFind,
    591                                                         pTable[ul]))
    592                                     ;
    593                             }
     557                            ULONG ulOfs = 0;
     558
     559                            _ultoa(ul + 1, szFind + 1, 10);
     560                            while (xstrFindReplaceC(pstr,
     561                                                    &ulOfs,
     562                                                    szFind,
     563                                                    pTable[ul]))
     564                                ;
    594565                        }
    595566                    }
    596567                }
    597568            }
    598 
    599             doshClose(&pFile);
    600569        }
     570
     571        doshClose(&pFile);
    601572    }
    602573
  • trunk/src/helpers/tree.c

    r222 r238  
    218218 +                         p,                   // new tree node
    219219 +                         fnCompare);          // comparison func
    220  +              return (p);
     220 +              return p;
    221221 +          }
    222222 *
     
    226226 +          int TREEENTRY fnCompare(ULONG ul1, ULONG ul2)
    227227 +          {
    228  +              return (strcmp((const char*)ul1,
    229  +                             (const char*)ul2));
     228 +              return strcmp((const char*)ul1,
     229 +                            (const char*)ul2);
    230230 +          }
    231231 *
     
    760760        (*plCount)--;       // V0.9.16 (2001-10-19) [umoeller]
    761761
    762     return (STATUS_OK);
     762    return STATUS_OK;
    763763}
    764764
     
    999999    }
    10001000
    1001     return (papNodes);
     1001    return papNodes;
    10021002}
    10031003
  • trunk/src/helpers/vcard.c

    r226 r238  
    316316         || (!pllParent)
    317317       )
    318         return (ERROR_INVALID_PARAMETER);
     318        return ERROR_INVALID_PARAMETER;
    319319
    320320    while (!arc)
  • trunk/src/helpers/winh.c

    r235 r238  
    120120    {
    121121        // put the call in brackets so the macro won't apply here
    122         return ((WinSendMsg)(hwnd, msg, mp1, mp2));
     122        return (WinSendMsg)(hwnd, msg, mp1, mp2);
    123123    }
    124124
     
    138138    MRESULT winhSendDlgItemMsg(HWND hwnd, ULONG id, ULONG msg, MPARAM mp1, MPARAM mp2)
    139139    {
    140         return ((WinSendDlgItemMsg)(hwnd, id, msg, mp1, mp2));
     140        return (WinSendDlgItemMsg)(hwnd, id, msg, mp1, mp2);
    141141    }
    142142
     
    157157    {
    158158        // put the call in brackets so the macro won't apply here
    159         return ((WinPostMsg)(hwnd, msg, mp1, mp2));
     159        return (WinPostMsg)(hwnd, msg, mp1, mp2);
    160160    }
    161161
     
    169169    {
    170170        // put the call in brackets so the macro won't apply here
    171         return ((WinWindowFromID)(hwnd, id));
     171        return (WinWindowFromID)(hwnd, id);
    172172    }
    173173
     
    181181    {
    182182        // put the call in brackets so the macro won't apply here
    183         return ((WinQueryWindow)(hwnd, lCode));
     183        return (WinQueryWindow)(hwnd, lCode);
    184184    }
    185185
     
    193193    {
    194194        // put the call in brackets so the macro won't apply here
    195         return ((WinQueryWindowPtr)(hwnd, index));
     195        return (WinQueryWindowPtr)(hwnd, index);
    196196    }
    197197
     
    26172617    ULONG   ul = 0;
    26182618
    2619     /* if (!WinIsWindowVisible(hwndDlg))
    2620         return (FALSE); */
    2621 
    26222619    if ((pmpFlags) && (pxac))
    26232620    {
  • trunk/src/helpers/xml.c

    r229 r238  
    176176        // start of expat (parser) errors
    177177        case ERROR_EXPAT_NO_MEMORY:
    178             return ("Out of memory");
     178            return "Out of memory";
    179179
    180180        case ERROR_EXPAT_SYNTAX:
    181             return ("Syntax error");
     181            return "Syntax error";
    182182        case ERROR_EXPAT_NO_ELEMENTS:
    183             return ("No element found");
     183            return "No element found";
    184184        case ERROR_EXPAT_INVALID_TOKEN:
    185             return ("Not well-formed (invalid token)");
     185            return "Not well-formed (invalid token)";
    186186        case ERROR_EXPAT_UNCLOSED_TOKEN:
    187             return ("Unclosed token");
     187            return "Unclosed token";
    188188        case ERROR_EXPAT_PARTIAL_CHAR:
    189             return ("Unclosed token");
     189            return "Unclosed token";
    190190        case ERROR_EXPAT_TAG_MISMATCH:
    191             return ("Mismatched tag");
     191            return "Mismatched tag";
    192192        case ERROR_EXPAT_DUPLICATE_ATTRIBUTE:
    193             return ("Duplicate attribute");
     193            return "Duplicate attribute";
    194194        case ERROR_EXPAT_JUNK_AFTER_DOC_ELEMENT:
    195             return ("Junk after root element");
     195            return "Junk after root element";
    196196        case ERROR_EXPAT_PARAM_ENTITY_REF:
    197             return ("Illegal parameter entity reference");
     197            return "Illegal parameter entity reference";
    198198        case ERROR_EXPAT_UNDEFINED_ENTITY:
    199             return ("Undefined entity");
     199            return "Undefined entity";
    200200        case ERROR_EXPAT_RECURSIVE_ENTITY_REF:
    201             return ("Recursive entity reference");
     201            return "Recursive entity reference";
    202202        case ERROR_EXPAT_ASYNC_ENTITY:
    203             return ("Asynchronous entity");
     203            return "Asynchronous entity";
    204204        case ERROR_EXPAT_BAD_CHAR_REF:
    205             return ("Reference to invalid character number");
     205            return "Reference to invalid character number";
    206206        case ERROR_EXPAT_BINARY_ENTITY_REF:
    207             return ("Reference to binary entity");
     207            return "Reference to binary entity";
    208208        case ERROR_EXPAT_ATTRIBUTE_EXTERNAL_ENTITY_REF:
    209             return ("Reference to external entity in attribute");
     209            return "Reference to external entity in attribute";
    210210        case ERROR_EXPAT_MISPLACED_XML_PI:
    211             return ("XML processing instruction not at start of external entity");
     211            return "XML processing instruction not at start of external entity";
    212212        case ERROR_EXPAT_UNKNOWN_ENCODING:
    213             return ("Unknown encoding");
     213            return "Unknown encoding";
    214214        case ERROR_EXPAT_INCORRECT_ENCODING:
    215             return ("Encoding specified in XML declaration is incorrect");
     215            return "Encoding specified in XML declaration is incorrect";
    216216        case ERROR_EXPAT_UNCLOSED_CDATA_SECTION:
    217             return ("Unclosed CDATA section");
     217            return "Unclosed CDATA section";
    218218        case ERROR_EXPAT_EXTERNAL_ENTITY_HANDLING:
    219             return ("Error in processing external entity reference");
     219            return "Error in processing external entity reference";
    220220        case ERROR_EXPAT_NOT_STANDALONE:
    221             return ("Document is not standalone");
     221            return "Document is not standalone";
    222222        case ERROR_EXPAT_UNEXPECTED_STATE:
    223             return ("Unexpected parser state - please send a bug report");
     223            return "Unexpected parser state - please send a bug report";
    224224        // end of expat (parser) errors
    225225
     
    227227
    228228        case ERROR_DOM_UNDECLARED_ELEMENT:
    229             return ("Element has not been declared");
     229            return "Element has not been declared";
    230230        case ERROR_DOM_ROOT_ELEMENT_MISNAMED:
    231             return ("Root element name does not match DOCTYPE name");
     231            return "Root element name does not match DOCTYPE name";
    232232        case ERROR_DOM_INVALID_ROOT_ELEMENT:
    233             return ("Invalid or duplicate root element");
     233            return "Invalid or duplicate root element";
    234234
    235235        case ERROR_DOM_INVALID_SUBELEMENT:
    236             return ("Invalid sub-element in parent element");
     236            return "Invalid sub-element in parent element";
    237237        case ERROR_DOM_DUPLICATE_ELEMENT_DECL:
    238             return ("Duplicate element declaration");
     238            return "Duplicate element declaration";
    239239        case ERROR_DOM_DUPLICATE_ATTRIBUTE_DECL:
    240             return ("Duplicate attribute declaration");
     240            return "Duplicate attribute declaration";
    241241        case ERROR_DOM_UNDECLARED_ATTRIBUTE:
    242             return ("Undeclared attribute in element");
     242            return "Undeclared attribute in element";
    243243        case ERROR_ELEMENT_CANNOT_HAVE_CONTENT:
    244             return ("Element cannot have content");
     244            return "Element cannot have content";
    245245        case ERROR_DOM_INVALID_ATTRIB_VALUE:
    246             return ("Invalid attribute value");
     246            return "Invalid attribute value";
    247247        case ERROR_DOM_REQUIRED_ATTRIBUTE_MISSING:
    248             return ("Required attribute is missing");
     248            return "Required attribute is missing";
    249249        case ERROR_DOM_SUBELEMENT_IN_EMPTY_ELEMENT:
    250             return ("Subelement in empty element");
     250            return "Subelement in empty element";
    251251
    252252        case ERROR_DOM_PARSING:
    253             return ("Parsing error");
     253            return "Parsing error";
    254254        case ERROR_DOM_VALIDITY:
    255             return ("Validity error");
     255            return "Validity error";
    256256
    257257        case ERROR_DOM_NODETYPE_NOT_SUPPORTED:
    258             return ("DOM node type not supported");
     258            return "DOM node type not supported";
    259259        case ERROR_DOM_NO_DOCUMENT:
    260             return ("No DOM document");
     260            return "No DOM document";
    261261        case ERROR_DOM_NO_ELEMENT:
    262             return ("No DOM element");
     262            return "No DOM element";
    263263        case ERROR_DOM_DUPLICATE_DOCTYPE:
    264             return ("Duplicate doctype");
     264            return "Duplicate doctype";
    265265        case ERROR_DOM_DOCTYPE_ROOT_NAMES_MISMATCH:
    266             return ("Root element doesn't match doctype name");
     266            return "Root element doesn't match doctype name";
    267267        case ERROR_DOM_INTEGRITY:
    268             return ("DOM integrity error");
     268            return "DOM integrity error";
    269269        case ERROR_DOM_DUPLICATE_ATTRIBUTE:
    270             return ("Duplicate attribute");
     270            return "Duplicate attribute";
    271271
    272272        case ERROR_DOM_VALIDATE_INVALID_ELEMENT:
    273             return ("Validation error: Undeclared element name");
     273            return "Validation error: Undeclared element name";
    274274        case ERROR_DOM_ELEMENT_DECL_OUTSIDE_DOCTYPE:
    275             return ("Element declaration outside doctype");
     275            return "Element declaration outside doctype";
    276276        case ERROR_DOM_ATTLIST_DECL_OUTSIDE_DOCTYPE:
    277             return ("Attlist declaration outside doctype");
     277            return "Attlist declaration outside doctype";
    278278
    279279        case ERROR_DOM_INCOMPLETE_ENCODING_MAP:
    280             return ("Incomplete encoding map specified");
     280            return "Incomplete encoding map specified";
    281281
    282282        case ERROR_DOM_INVALID_EXTERNAL_HANDLER:
    283             return ("Invalid 'external' handler specified");
     283            return "Invalid 'external' handler specified";
    284284    }
    285285
     
    346346                                     ULONG ul2)
    347347{
    348     return (strhcmp(((PXSTRING)ul1)->psz,
    349                     ((PXSTRING)ul2)->psz));
     348    return strhcmp(((PXSTRING)ul1)->psz,
     349                   ((PXSTRING)ul2)->psz);
    350350}
    351351
     
    13831383    }
    13841384
    1385     return (pStackItem);
     1385    return pStackItem;
    13861386}
    13871387
     
    14821482            }
    14831483            // return success
    1484             return (1);
     1484            return 1;
    14851485        }
    14861486    }
    14871487
    14881488    // error
    1489     return (0);
     1489    return 0;
    14901490}
    14911491
     
    20082008    pDom->pParser = pOldParser;
    20092009
    2010     return (i);
     2010    return i;
    20112011}
    20122012
     
    27942794    }
    27952795
    2796     return (pElementDecl);
     2796    return pElementDecl;
    27972797}
    27982798
     
    28182818       )
    28192819    {
    2820         return ((PCMATTRIBUTEDECLBASE)treeFind(
    2821                                         pDocTypeNode->AttribDeclBasesTree,
    2822                                         (ULONG)pstrElementName,
    2823                                         CompareXStrings));
     2820        return (PCMATTRIBUTEDECLBASE)treeFind(pDocTypeNode->AttribDeclBasesTree,
     2821                                              (ULONG)pstrElementName,
     2822                                              CompareXStrings);
    28242823    }
    28252824
     
    28512850        if (*ppAttribDeclBase)
    28522851        {
    2853             return ((PCMATTRIBUTEDECL)treeFind(
    2854                                          ((**ppAttribDeclBase).AttribDeclsTree),
    2855                                          (ULONG)pstrAttribName,
    2856                                          CompareXStrings));
     2852            return (PCMATTRIBUTEDECL)treeFind(((**ppAttribDeclBase).AttribDeclsTree),
     2853                                              (ULONG)pstrAttribName,
     2854                                              CompareXStrings);
    28572855        }
    28582856    }
     
    28882886            PDOMNODE pDomNode = (PDOMNODE)pListNode->pItemData;
    28892887            if (pDomNode->NodeBase.ulNodeType == DOMNODE_ELEMENT)
    2890                 return (pDomNode);
     2888                return pDomNode;
    28912889
    28922890            pListNode = pListNode->pNext;
     
    29102908    PLISTNODE pListNode = lstQueryFirstNode(&pDomNode->llChildren);
    29112909    if (pListNode)
    2912         return ((PDOMNODE)pListNode->pItemData);
    2913 
    2914     return (0);
     2910        return (PDOMNODE)pListNode->pItemData;
     2911
     2912    return 0;
    29152913}
    29162914
     
    29282926    PLISTNODE pListNode = lstQueryLastNode(&pDomNode->llChildren);
    29292927    if (pListNode)
    2930         return ((PDOMNODE)pListNode->pItemData);
    2931 
    2932     return (0);
     2928        return (PDOMNODE)pListNode->pItemData;
     2929
     2930    return 0;
    29332931}
    29342932
     
    29532951             && (pDomNodeThis->NodeBase.ulNodeType == DOMNODE_TEXT)
    29542952           )
    2955             return (pDomNodeThis);
     2953            return pDomNodeThis;
    29562954    }
    29572955
     
    30043002
    30053003        if (cItems)
    3006             return (pll);
    3007         else
    3008             lstFree(&pll);
    3009     }
    3010 
    3011     return (0);
     3004            return pll;
     3005
     3006        lstFree(&pll);
     3007    }
     3008
     3009    return 0;
    30123010}
    30133011
     
    30343032                                       (ULONG)&str,
    30353033                                       CompareXStrings))
    3036         return (pAttrNode->pstrNodeValue);
     3034        return pAttrNode->pstrNodeValue;
    30373035
    30383036    return NULL;
  • trunk/src/helpers/xprf2.c

    r229 r238  
    644644{
    645645    printf("\r done %03d%%", ulNow * 100 / ulMax);
    646     return (TRUE);
     646    return TRUE;
    647647}
    648648
Note: See TracChangeset for help on using the changeset viewer.