Changeset 196


Ignore:
Timestamp:
Aug 9, 2002, 12:35:28 AM (23 years ago)
Author:
umoeller
Message:

Misc fixes.

Location:
trunk
Files:
3 added
2 deleted
17 edited

Legend:

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

    r185 r196  
    1515
    1616/*
    17  *      Copyright (C) 1997-2001 Ulrich M”ller.
     17 *      Copyright (C) 1997-2002 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
  • trunk/src/helpers/cctl_chart.c

    r189 r196  
    166166
    167167/*
    168  *      Copyright (C) 1997-2000 Ulrich M”ller.
     168 *      Copyright (C) 1997-2002 Ulrich M”ller.
    169169 *      This file is part of the "XWorkplace helpers" source package.
    170170 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/cctl_checkcnr.c

    r191 r196  
    1515
    1616/*
    17  *      Copyright (C) 1997-2000 Ulrich M”ller.
     17 *      Copyright (C) 1997-2002 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
  • trunk/src/helpers/cctl_tooltip.c

    r191 r196  
    1515
    1616/*
    17  *      Copyright (C) 1997-2000 Ulrich M”ller.
     17 *      Copyright (C) 1997-2002 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
  • trunk/src/helpers/comctl.c

    r195 r196  
    5252
    5353/*
    54  *      Copyright (C) 1997-2000 Ulrich M”ller.
     54 *      Copyright (C) 1997-2002 Ulrich M”ller.
    5555 *      This file is part of the "XWorkplace helpers" source package.
    5656 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/configsys.c

    r184 r196  
    2222
    2323/*
    24  *      Copyright (C) 1997-2001 Ulrich M”ller.
     24 *      Copyright (C) 1997-2002 Ulrich M”ller.
    2525 *      This file is part of the "XWorkplace helpers" source package.
    2626 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/dialog.c

    r188 r196  
    2929
    3030/*
    31  *      Copyright (C) 2001 Ulrich M”ller.
     31 *      Copyright (C) 2001-2002 Ulrich M”ller.
    3232 *      This file is part of the "XWorkplace helpers" source package.
    3333 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/eah.c

    r169 r196  
    6666 *
    6767 *      Copyright (C) 1995 Massachusetts Institute of Technology.
    68  *      Copyright (C) 1997-2000 Ulrich M”ller.
     68 *      Copyright (C) 1997-2002 Ulrich M”ller.
    6969 *      This file is part of the "XWorkplace helpers" source package.
    7070 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/gpih.c

    r195 r196  
    26482648           )
    26492649        {
     2650            LONG    lPatternOld = -1;               // mark as "not changed" for now
     2651            LONG    lAndROP = ROP_SRCAND,           // 0x0088 = 10001000
     2652                    lPaintROP = ROP_SRCPAINT,       // 0x00EE = 11101110
     2653                    lInvertROP = ROP_SRCINVERT;     // 0x0066 = 01100110
     2654
    26502655            // colors are constant too
    26512656            GpiSetColor(hps, RGBCOL_WHITE);
     
    26532658
    26542659            if (fl & DP_HALFTONED) // V0.9.20 (2002-08-04) [umoeller]
     2660            {
     2661                lPatternOld = GpiQueryPattern(hps);
    26552662                GpiSetPattern(hps, PATSYM_HALFTONE);
     2663
     2664                lAndROP     = 0x00A8;               //          10101000
     2665                lInvertROP  = 0x00A6;               //          10100110
     2666            }
    26562667
    26572668            /*
     
    26882699                            4L,         // must always be 4
    26892700                            aptl,       // point array
    2690                             ROP_SRCAND,   // source AND target
     2701                            lAndROP, // ROP_SRCAND,   // source AND target
    26912702                            BBO_IGNORE);
    26922703            }
     
    27222733                            4L,         // must always be 4
    27232734                            aptl,       // point array
    2724                             ROP_SRCPAINT,
     2735                            lPaintROP, // ROP_SRCPAINT,
    27252736                            BBO_IGNORE);
    27262737            }
     
    27612772                            4L,         // must always be 4
    27622773                            aptl,       // point array
    2763                             ROP_SRCINVERT,   // source XOR target
     2774                            lInvertROP, // ROP_SRCINVERT,   // source XOR target
    27642775                            BBO_IGNORE);
    27652776            }
     2777
     2778            // reset old pattern, if changed
     2779            if (lPatternOld != -1)
     2780                GpiSetPattern(hps, lPatternOld);
    27662781
    27672782            return TRUE;
  • trunk/src/helpers/helpers_post.in

    r75 r196  
    2020
    2121.c.{$(OUTPUTDIR)}.obj:
    22         @echo $(MAKEDIR)\makefile: Compiling $(@B).c
     22    @echo $(MAKEDIR)\makefile: Compiling $(@B).c
    2323!ifdef EMX
    24         $(CC_HELPERS) -o $(OUTPUTDIR)\$(@B).obj $(@B).c
     24    $(CC_HELPERS) -o $(OUTPUTDIR)\$(@B).obj $(@B).c
    2525!else
    2626!ifndef PRECH
    27         $(CC_HELPERS) /Fo$(OUTPUTDIR)\$(@B).obj $(@B).c
     27    $(CC_HELPERS) /Fo$(OUTPUTDIR)\$(@B).obj $(@B).c
    2828!else
    29         $(CC_HELPERS) /fi"$(PRECH)\$(@B).pch" /si"$(PRECH)\$(@B).pch" /Fo$(OUTPUTDIR)\$(@B).obj $(@B).c
     29    $(CC_HELPERS) /fi"$(PRECH)\$(@B).pch" /si"$(PRECH)\$(@B).pch" /Fo$(OUTPUTDIR)\$(@B).obj $(@B).c
    3030!endif
    3131!endif
     32
     33$(OUTPUTDIR)\interlock.obj: $(@B).asm
     34    @echo $(MAKEDIR)\makefile: Assembling $(@B).asm
     35    alp -Sv:ALP -Fdo:$(OUTPUTDIR) $(@B).asm
    3236
    3337# The .OBJ-from-sources dependencies are now automatically
  • trunk/src/helpers/helpers_pre.in

    r174 r196  
    6969$(OUTPUTDIR)\prfh2.obj \
    7070$(OUTPUTDIR)\resh.obj \
    71 $(OUTPUTDIR)\semaphores.obj \
     71$(OUTPUTDIR)\sem.obj \
     72$(OUTPUTDIR)\interlock.obj \
    7273$(OUTPUTDIR)\stringh.obj \
    7374$(OUTPUTDIR)\syssound.obj \
  • trunk/src/helpers/stringh.c

    r178 r196  
    2323
    2424/*
    25  *      Copyright (C) 1997-2000 Ulrich M”ller.
     25 *      Copyright (C) 1997-2002 Ulrich M”ller.
    2626 *      Parts Copyright (C) 1991-1999 iMatix Corporation.
    2727 *      This file is part of the "XWorkplace helpers" source package.
  • trunk/src/helpers/threads.c

    r167 r196  
    2323
    2424/*
    25  *      Copyright (C) 1997-2000 Ulrich M”ller.
     25 *      Copyright (C) 1997-2002 Ulrich M”ller.
    2626 *      This file is part of the "XWorkplace helpers" source package.
    2727 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/tmsgfile.c

    r190 r196  
    5353
    5454/*
    55  *      Copyright (C) 2001 Ulrich M”ller.
     55 *      Copyright (C) 2001-2002 Ulrich M”ller.
    5656 *      This file is part of the "XWorkplace helpers" source package.
    5757 *      This is free software; you can redistribute it and/or modify
  • trunk/src/helpers/tree.c

    r116 r196  
    312312    if (ul1 < ul2)
    313313        return -1;
     314
    314315    if (ul1 > ul2)
    315316        return +1;
    316     return (0);
     317
     318    return 0;
    317319}
    318320
     
    336338    {
    337339        int i = strcmp(p1, p2);
    338         if (i < 0) return (-1);
    339         if (i > 0) return (+1);
     340        if (i < 0)
     341            return -1;
     342        if (i > 0)
     343            return +1;
    340344    }
    341345    else if (p1)
    342346        // but p2 is NULL: p1 greater than p2 then
    343         return (+1);
     347        return +1;
    344348    else if (p2)
    345349        // but p1 is NULL: p1 less than p2 then
    346         return (-1);
     350        return -1;
    347351
    348352    // return 0 if strcmp returned 0 above or both strings are NULL
    349     return (0);
     353    return 0;
    350354}
    351355
     
    358362                       TREE *x)
    359363{
    360    /**************************
    361     *  rotate node x to left *
    362     **************************/
     364    // rotate node x to left
    363365
    364366    TREE *y = x->right;
     
    372374    if (y != LEAF)
    373375        y->parent = x->parent;
     376
    374377    if (x->parent)
    375378    {
     
    396399                        TREE *x)
    397400{
    398 
    399    /****************************
    400     *  rotate node x to right  *
    401     ****************************/
     401    // rotate node x to right
    402402
    403403    TREE *y = x->left;
     
    411411    if (y != LEAF)
    412412        y->parent = x->parent;
     413
    413414    if (x->parent)
    414415    {
     
    435436                        TREE *x)
    436437{
    437    /*************************************
    438     *  maintain Red-Black tree balance  *
    439     *  after inserting node x           *
    440     *************************************/
    441 
    442438    // check Red-Black properties
    443439    while (    x != *root
     
    503499        }
    504500    }
     501
    505502    (*root)->color = BLACK;
    506503}
     
    546543    {
    547544        int iResult;
    548         if (0 == (iResult = pfnCompare(key, current->ulKey))) // if (compEQ(key, current->key))
     545        if (!(iResult = pfnCompare(key, current->ulKey)))
    549546            return STATUS_DUPLICATE_KEY;
    550547
    551548        parent = current;
    552         current = (iResult < 0)    // compLT(key, current->key)
     549        current = (iResult < 0)
    553550                    ? current->left
    554551                    : current->right;
     
    556553
    557554    // set up new node
    558     /* if ((x = malloc (sizeof(*x))) == 0)
    559         return STATUS_MEM_EXHAUSTED; */
    560555    x->parent = parent;
    561556    x->left = LEAF;
    562557    x->right = LEAF;
    563558    x->color = RED;
    564     // x->key = key;
    565     // x->rec = *rec;
    566559
    567560    // insert node in tree
     
    578571    insertFixup(root,
    579572                x);
    580     // lastFind = NULL;
    581573
    582574    if (plCount)
     
    667659        }
    668660    }
     661
    669662    tree->color = BLACK;
    670 
    671    /*************************************
    672     *  maintain Red-Black tree balance  *
    673     *  after deleting node x            *
    674     *************************************/
    675 
    676     /* while (    x != *root
    677             && x->color == BLACK
    678           )
    679     {
    680         if (x == x->parent->left)
    681         {
    682             TREE *w = x->parent->right;
    683             if (w->color == RED)
    684             {
    685                 w->color = BLACK;
    686                 x->parent->color = RED;
    687                 rotateLeft(root,
    688                            x->parent);
    689                 w = x->parent->right;
    690             }
    691             if (    w->left->color == BLACK
    692                  && w->right->color == BLACK
    693                )
    694             {
    695                 w->color = RED;
    696                 x = x->parent;
    697             }
    698             else
    699             {
    700                 if (w->right->color == BLACK)
    701                 {
    702                     w->left->color = BLACK;
    703                     w->color = RED;
    704                     rotateRight(root,
    705                                 w);
    706                     w = x->parent->right;
    707                 }
    708                 w->color = x->parent->color;
    709                 x->parent->color = BLACK;
    710                 w->right->color = BLACK;
    711                 rotateLeft(root,
    712                            x->parent);
    713                 x = *root;
    714             }
    715         }
    716         else
    717         {
    718             TREE *w = x->parent->left;
    719             if (w->color == RED)
    720             {
    721                 w->color = BLACK;
    722                 x->parent->color = RED;
    723                 rotateRight(root,
    724                             x->parent);
    725                 w = x->parent->left;
    726             }
    727             if (    w->right->color == BLACK
    728                  && w->left->color == BLACK
    729                )
    730             {
    731                 w->color = RED;
    732                 x = x->parent;
    733             }
    734             else
    735             {
    736                 if (w->left->color == BLACK)
    737                 {
    738                     w->right->color = BLACK;
    739                     w->color = RED;
    740                     rotateLeft(root,
    741                                w);
    742                     w = x->parent->left;
    743                 }
    744                 w->color = x->parent->color;
    745                 x->parent->color = BLACK;
    746                 w->left->color = BLACK;
    747                 rotateRight(root,
    748                             x->parent);
    749                 x = *root;
    750             }
    751         }
    752     }
    753     x->color = BLACK; */
    754663}
    755664
     
    803712    if (y != LEAF)
    804713        y->parent = d->parent;
     714
    805715    if (d->parent)
    806716    {
     
    863773               FNTREE_COMPARE *pfnCompare)    // in: comparison func
    864774{
    865    /*******************************
    866     *  find node containing data  *
    867     *******************************/
    868 
    869775    TREE *current = root;
    870776    while (current != LEAF)
    871777    {
    872778        int iResult;
    873         if (0 == (iResult = pfnCompare(key, current->ulKey)))
    874             return (current);
    875         else
    876         {
    877             current = (iResult < 0) // compLT (key, current->key)
    878                 ? current->left
    879                 : current->right;
    880         }
     779        if (!(iResult = pfnCompare(key, current->ulKey)))
     780            return current;
     781
     782        current = (iResult < 0)
     783            ? current->left
     784            : current->right;
    881785    }
    882786
     
    957861    p = r;
    958862    if (p->right != LEAF)
    959         return treeFirst (p->right);
    960     else
    961     {
    962         p = r;
    963         child   = LEAF;
    964         while (    (p->parent)
    965                 && (p->right == child)
    966               )
    967         {
    968             child = p;
    969             p = p->parent;
    970         }
    971         if (p->right != child)
    972             return p;
    973         else
    974             return NULL;
    975     }
     863        return treeFirst(p->right);
     864
     865    p = r;
     866    child   = LEAF;
     867    while (    (p->parent)
     868            && (p->right == child)
     869          )
     870    {
     871        child = p;
     872        p = p->parent;
     873    }
     874
     875    if (p->right != child)
     876        return p;
     877
     878    return NULL;
    976879}
    977880
     
    987890
    988891    if (    (!r)
    989          || (r == LEAF))
     892         || (r == LEAF)
     893       )
    990894        return NULL;
    991895
     
    993897    if (p->left != LEAF)
    994898        return treeLast (p->left);
    995     else
    996     {
    997         p = r;
    998         child   = LEAF;
    999         while ((p->parent)
    1000            &&  (p->left == child))
    1001         {
    1002             child = p;
    1003             p = p->parent;
    1004         }
    1005         if (p->left != child)
    1006             return p;
    1007         else
    1008             return NULL;
    1009     }
     899
     900    p = r;
     901    child   = LEAF;
     902    while (    (p->parent)
     903            && (p->left == child)
     904          )
     905    {
     906        child = p;
     907        p = p->parent;
     908    }
     909
     910    if (p->left != child)
     911        return p;
     912
     913    return NULL;
    1010914}
    1011915
  • trunk/src/helpers/winh.c

    r195 r196  
    1919
    2020/*
    21  *      Copyright (C) 1997-2000 Ulrich M”ller.
     21 *      Copyright (C) 1997-2002 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
  • trunk/src/helpers/xml.c

    r187 r196  
    107107
    108108/*
    109  *      Copyright (C) 2000-2001 Ulrich M”ller.
     109 *      Copyright (C) 2000-2002 Ulrich M”ller.
    110110 *      This file is part of the "XWorkplace helpers" source package.
    111111 *      This is free software; you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.