Changeset 297 for branches


Ignore:
Timestamp:
Oct 9, 2005, 3:11:51 PM (20 years ago)
Author:
pr
Message:

Update functions using exception handlers to force non-register variables

Location:
branches/branch-1-0/src/helpers
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1-0/src/helpers/apps.c

    r229 r297  
    1515
    1616/*
    17  *      Copyright (C) 1997-2002 Ulrich M”ller.
     17 *      Copyright (C) 1997-2005 Ulrich M”ller.
    1818 *      This file is part of the "XWorkplace helpers" source package.
    1919 *      This is free software; you can redistribute it and/or modify
     
    15611561{
    15621562    APIRET      arc = NO_ERROR;
    1563 
    1564     BOOL        fCrit = FALSE,
    1565                 fResetDir = FALSE;
     1563    volatile BOOL        fCrit = FALSE;         // XWP V1.0.4 (2005-10-09) [pr]
     1564    volatile BOOL        fResetDir = FALSE;
    15661565    CHAR        szCurrentDir[CCHMAXPATH];
    1567 
    15681566    ULONG       sid,
    15691567                pid;
    15701568    STARTDATA   SData;
     1569
    15711570    SData.Length  = sizeof(STARTDATA);
    15721571    SData.Related = SSF_RELATED_INDEPENDENT; // SSF_RELATED_CHILD;
  • branches/branch-1-0/src/helpers/cctl_tooltip.c

    r256 r297  
    1515
    1616/*
    17  *      Copyright (C) 1997-2002 Ulrich M”ller.
     17 *      Copyright (C) 1997-2005 Ulrich M”ller.
    1818 *      This file is part of the "XWorkplace helpers" source package.
    1919 *      This is free software; you can redistribute it and/or modify
     
    19671967        }
    19681968    }
    1969     CATCH(excpt1) {} END_CATCH();
     1969    CATCH(excpt1)
     1970    {
     1971        mrc = 0;        // XWP V1.0.4 (2005-10-09) [pr]
     1972    }
     1973    END_CATCH();
    19701974
    19711975    return mrc;
    19721976}
    19731977
    1974 
  • branches/branch-1-0/src/helpers/dialog.c

    r264 r297  
    3838
    3939/*
    40  *      Copyright (C) 2001-2002 Ulrich M”ller.
     40 *      Copyright (C) 2001-2005 Ulrich M”ller.
    4141 *      This file is part of the "XWorkplace helpers" source package.
    4242 *      This is free software; you can redistribute it and/or modify
     
    295295 *      the control _sizes_, and everything is layed out automatically.
    296296 *      You may even have the formatter compute the sizes automatically
    297  *      based on the control classes and values; it is possible to
    298  *      create dialogs without specifying a single size also.
     297 *      based on the control classes and values (strings); it is possible
     298 *      to create dialogs without specifying a single size also.
    299299 *
    300300 *      There are several tricks to how this works.
     
    313313 *          (which again goes into ProcessRow and ProcessColumn).
    314314 *          There is no limit to how deep tables may nest, except
    315  *          the stack size of the current thread. ;-)
     315 *          for the stack size of the current thread, of course.
    316316 *
    317317 *      3)  This whole recursive iteration is performed several times.
     
    12991299    APIRET      arc = NO_ERROR;
    13001300
    1301     PCSZ        pcszClass = NULL;
    1302     PCSZ        pcszText = NULL;
    1303     ULONG       flStyle = 0;
    1304     LHANDLE     lHandleSet = NULLHANDLE;
    1305     ULONG       flOld = 0;
     1301    volatile PCSZ        pcszClass = NULL; // XWP V1.0.4 (2005-10-09) [pr]
     1302    volatile PCSZ        pcszText = NULL;
     1303    volatile ULONG       flStyle = 0;
     1304    volatile LHANDLE     lHandleSet = NULLHANDLE;
     1305    volatile ULONG       flOld = 0;
    13061306
    13071307    if (pColumn->pNestedTable)
     
    30843084    APIRET      arc = NO_ERROR;
    30853085
    3086     HPOINTER    hptrOld = winhSetWaitPointer();     // V1.0.0 (2002-08-21) [umoeller]
     3086    volatile HPOINTER hptrOld = winhSetWaitPointer(); // XWP V1.0.4 (2005-10-09) [pr]
    30873087
    30883088    TRY_LOUD(excpt1)
  • branches/branch-1-0/src/helpers/except.c

    r264 r297  
    128128 +          int your_func(int)
    129129 +          {
    130  +              BOOL    fSemOwned = FALSE;
     130 +              volatile BOOL    fSemOwned = FALSE;
    131131 +
    132132 +              TRY_QUIET(excpt1)           // or TRY_LOUD
     
    188188
    189189/*
    190  *      This file Copyright (C) 1992-99 Ulrich M”ller,
    191  *                                      Monte Copeland,
    192  *                                      Roman Stangl,
    193  *                                      Kim Rasmussen,
    194  *                                      Marc Fiammante,
    195  *                                      John Currier,
    196  *                                      Anthony Cruise.
     190 *      This file Copyright (C) 1992-2005 Ulrich M”ller,
     191 *                                        Monte Copeland,
     192 *                                        Roman Stangl,
     193 *                                        Kim Rasmussen,
     194 *                                        Marc Fiammante,
     195 *                                        John Currier,
     196 *                                        Anthony Cruise.
    197197 *      This file is part of the "XWorkplace helpers" source package.
    198198 *      This is free software; you can redistribute it and/or modify
     
    788788 *      writes no trap logs).
    789789 *
     790 *      Registering hooks affects all threads that use
     791 *      the exception handlers.
     792 *
    790793 *      The hooks are as follows:
    791794 *
     
    914917     */
    915918
    916     if (pReportRec->fHandlerFlags & EH_EXIT_UNWIND)
    917        return XCPT_CONTINUE_SEARCH;
    918     if (pReportRec->fHandlerFlags & EH_UNWINDING)
    919        return XCPT_CONTINUE_SEARCH;
    920     if (pReportRec->fHandlerFlags & EH_NESTED_CALL)
     919    // XWP V1.0.4 (2005-10-09) [pr]: Optimize
     920    if (pReportRec->fHandlerFlags & (EH_EXIT_UNWIND | EH_UNWINDING | EH_NESTED_CALL))
    921921       return XCPT_CONTINUE_SEARCH;
    922922
     
    10101010                              PVOID pv)
    10111011{
    1012     if (pReportRec->fHandlerFlags & EH_EXIT_UNWIND)
    1013        return XCPT_CONTINUE_SEARCH;
    1014     if (pReportRec->fHandlerFlags & EH_UNWINDING)
    1015        return XCPT_CONTINUE_SEARCH;
    1016     if (pReportRec->fHandlerFlags & EH_NESTED_CALL)
     1012    // XWP V1.0.4 (2005-10-09) [pr]: Optimize
     1013    if (pReportRec->fHandlerFlags & (EH_EXIT_UNWIND | EH_UNWINDING | EH_NESTED_CALL))
    10171014       return XCPT_CONTINUE_SEARCH;
    10181015
  • branches/branch-1-0/src/helpers/memdebug.c

    r222 r297  
    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
  • branches/branch-1-0/src/helpers/memdebug_win.c

    r264 r297  
    1212
    1313/*
    14  *      Copyright (C) 2000 Ulrich M”ller.
     14 *      Copyright (C) 2000-2005 Ulrich M”ller.
    1515 *      This program is part of the XWorkplace package.
    1616 *      This program is free software; you can redistribute it and/or modify
     
    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
     
    285285
    286286    ULONG       cHeapItems = 0;
    287     BOOL        fLocked = FALSE;
     287    volatile BOOL       fLocked = FALSE; // XWP V1.0.4 (2005-10-09) [pr]
    288288
    289289    TRY_LOUD(excpt1)
     
    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
     
    843843    i++;
    844844}
    845 #endif
    846 
     845#endif // __XWPMEMDEBUG__
     846
  • branches/branch-1-0/src/helpers/nlscache.c

    r278 r297  
    1919
    2020/*
    21  *      Copyright (C) 2001-2002 Ulrich M”ller.
     21 *      Copyright (C) 2001-2005 Ulrich M”ller.
    2222 *      This file is part of the "XWorkplace helpers" source package.
    2323 *      This is free software; you can redistribute it and/or modify
     
    279279PCSZ nlsGetString(ULONG ulStringID)
    280280{
    281     BOOL    fLocked = FALSE;
     281    volatile BOOL    fLocked = FALSE; // XWP V1.0.4 (2005-10-09) [pr]
    282282    PSZ     pszReturn = "Error";
    283283
     
    331331            pszReturn = "Cannot get strings lock.";
    332332    }
    333     CATCH(excpt1) {} END_CATCH();
     333    CATCH(excpt1)
     334    {
     335        pszReturn = "Error";
     336    }
     337    END_CATCH();
    334338
    335339    if (fLocked)
  • branches/branch-1-0/src/helpers/timer.c

    r264 r297  
    6868
    6969/*
    70  *      Copyright (C) 2000-2001 Ulrich M”ller.
     70 *      Copyright (C) 2000-2005 Ulrich M”ller.
    7171 *      This file is part of the "XWorkplace helpers" source package.
    7272 *      This is free software; you can redistribute it and/or modify
     
    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
     
    468468VOID tmrTimerTick(PXTIMERSET pSet)      // in: timer set (from tmrCreateSet)
    469469{
    470     BOOL fLocked = FALSE;
     470    volatile BOOL fLocked = FALSE; // XWP V1.0.4 (2005-10-09) [pr]
    471471
    472472    TRY_LOUD(excpt1)
     
    733733    }
    734734
    735     return (usrc);
     735    return usrc;
    736736}
    737737
  • branches/branch-1-0/src/helpers/wphandle.c

    r222 r297  
    2424
    2525/*
    26  *      This file Copyright (C) 1997-2001 Ulrich M”ller,
     26 *      This file Copyright (C) 1997-2005 Ulrich M”ller,
    2727 *      This file is part of the "XWorkplace helpers" source package.
    2828 *      This is free software; you can redistribute it and/or modify
     
    795795    APIRET      arc = NO_ERROR;
    796796
    797     PSZ         pszActiveHandles = NULL;
    798     HHANDLES    hHandles = NULLHANDLE;
     797    volatile PSZ         pszActiveHandles = NULL; // XWP V1.0.4 (2005-10-09) [pr]
     798    volatile HHANDLES    hHandles = NULLHANDLE;
    799799
    800800    TRY_LOUD(excpt1)
Note: See TracChangeset for help on using the changeset viewer.