Ignore:
Timestamp:
Jul 15, 2001, 10:57:25 AM (24 years ago)
Author:
umoeller
Message:

Misc changes.

File:
1 edited

Legend:

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

    r74 r86  
    263263}
    264264
    265 #endif      // __DEBUG_MALLOC_ENABLED__
     265#else       // __DEBUG_MALLOC_ENABLED__
    266266
    267267/*
     
    286286 */
    287287
    288 PLINKLIST (lstCreate)(BOOL fItemsFreeable)    // in: invoke free() on the data
     288PLINKLIST lstCreate(BOOL fItemsFreeable)    // in: invoke free() on the data
    289289                                            // item pointers upon destruction?
    290290{
     
    294294    return (pNewList);
    295295}
     296
     297#endif      // __DEBUG_MALLOC_ENABLED__
    296298
    297299/*
     
    614616}
    615617
    616 #endif // __DEBUG_MALLOC_ENABLED__
     618#else // __DEBUG_MALLOC_ENABLED__
    617619
    618620/*
     
    626628 */
    627629
    628 PLISTNODE (lstAppendItem)(PLINKLIST pList,
     630PLISTNODE lstAppendItem(PLINKLIST pList,
    629631                        void* pNewItemData)     // in: data to store in list node
    630632{
     
    668670}
    669671
     672#endif // __DEBUG_MALLOC_ENABLED__
     673
    670674/*
    671675 *@@ lstInsertItemBefore:
     
    688692 *      This returns the LISTNODE of the new list item,
    689693 *      or NULL upon errors.
     694 *
     695 *@@changed V0.9.14 (2001-07-14) [umoeller]: this never worked on empty lists, fixed
    690696 */
    691697
     
    716722                    pList->pFirst = pNewNode;
    717723
    718                     pList->ulCount++;
     724                    if (!pList->pLast)
     725                        // the list was empty:
     726                        pList->pLast = pNewNode;        // V0.9.14 (2001-07-14) [umoeller]
     727
     728                    (pList->ulCount)++;
    719729                }
    720730                else
     
    744754                            pList->pLast = pNewNode;
    745755
    746                         pList->ulCount++;
     756                        (pList->ulCount)++;
    747757                    }
    748758                    else
Note: See TracChangeset for help on using the changeset viewer.