Changeset 4311 for trunk/src/opengl


Ignore:
Timestamp:
Sep 22, 2000, 10:51:27 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

Location:
trunk/src/opengl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/glu/nurbs/internals/sorter.cpp

    r2689 r4311  
    1 /* $Id: sorter.cpp,v 1.1 2000-02-09 08:50:28 jeroen Exp $ */
     1/* $Id: sorter.cpp,v 1.2 2000-09-22 20:49:20 jeroen Exp $ */
    22/*
    33** License Applicability. Except to the extent portions of this file are
     
    3737 * sorter.c++
    3838 *
    39  * $Date: 2000-02-09 08:50:28 $ $Revision: 1.1 $
    40  * $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/src/opengl/glu/nurbs/internals/sorter.cpp,v 1.1 2000-02-09 08:50:28 jeroen Exp $
     39 * $Date: 2000-09-22 20:49:20 $ $Revision: 1.2 $
     40 * $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/src/opengl/glu/nurbs/internals/sorter.cpp,v 1.2 2000-09-22 20:49:20 jeroen Exp $
    4141 */
    4242
     
    8181{
    8282    char *i, *j;
    83     char        *lp, *hp;
    84     int c;
     83    char        *lp, *hp;
     84    int c;
    8585    unsigned int n;
     86    int redo=1;
    8687
    87 start:
     88//start:
     89while(redo)
     90  {
     91    redo=0;
     92
    8893    if((n=l-a) <= es)
    89             return;
     94            return;
    9095    n = es * (n / (2*es));
    9196    hp = lp = a+n;
    9297    i = a;
    9398    j = l-es;
    94     while(1) {
    95         if(i < lp) {
    96             if((c = qscmp(i, lp)) == 0) {
    97                 qsexc(i, lp -= es);
    98                 continue;
    99             }
    100             if(c < 0) {
    101                 i += es;
    102                 continue;
    103             }
    104         }
     99    while(1)
     100    {
     101        if(i < lp) {
     102            if((c = qscmp(i, lp)) == 0) {
     103                qsexc(i, lp -= es);
     104                continue;
     105            }
     106            if(c < 0) {
     107                i += es;
     108                continue;
     109            }
     110        }
    105111
    106112loop:
    107         if(j > hp) {
    108             if((c = qscmp(hp, j)) == 0) {
    109                 qsexc(hp += es, j);
    110                 goto loop;
    111             }
    112             if(c > 0) {
    113                 if(i == lp) {
    114                     qstexc(i, hp += es, j);
    115                     i = lp += es;
    116                     goto loop;
    117                 }
    118                 qsexc(i, j);
    119                 j -= es;
    120                 i += es;
    121                 continue;
    122             }
    123             j -= es;
    124             goto loop;
    125         }
     113        if(j > hp) {
     114            if((c = qscmp(hp, j)) == 0) {
     115                qsexc(hp += es, j);
     116                goto loop;
     117            }
     118            if(c > 0) {
     119                if(i == lp) {
     120                    qstexc(i, hp += es, j);
     121                    i = lp += es;
     122                    goto loop;
     123                }
     124                qsexc(i, j);
     125                j -= es;
     126                i += es;
     127                continue;
     128            }
     129            j -= es;
     130            goto loop;
     131        }
    126132
    127         if(i == lp) {
    128             if(lp-a >= l-hp) {
    129                 qs1(hp+es, l);
    130                 l = lp;
    131             } else {
    132                 qs1(a, lp);
    133                 a = hp+es;
    134             }
    135             goto start;
    136         }
     133        if(i == lp) {
     134            if(lp-a >= l-hp) {
     135                qs1(hp+es, l);
     136                l = lp;
     137            } else {
     138                qs1(a, lp);
     139                a = hp+es;
     140            }
     141            /*goto start;*/ redo=1; break;
     142        }
    137143
    138         qstexc(j, lp -= es, i);
    139         j = hp -= es;
     144        qstexc(j, lp -= es, i);
     145        j = hp -= es;
    140146    }
     147  }
    141148}
    142149
  • trunk/src/opengl/mesa/glthread.c

    r3598 r4311  
    1 /* $Id: glthread.c,v 1.1 2000-05-23 20:40:36 jeroen Exp $ */
     1/* $Id: glthread.c,v 1.2 2000-09-22 20:49:20 jeroen Exp $ */
    22
    33/*
     
    6363#define INIT_MAGIC 0xff8adc98
    6464
     65#ifdef __WIN32OS2__
     66#include <odinwrap.h>
     67inline void ** __threadstore()
     68{
     69  USHORT sel=RestoreOS2FS();
     70  void **p=_threadstore();
     71  SetFS(sel);
     72  return p;
     73}
     74#endif
    6575
    6676
     
    248258_glthread_GetID(void)
    249259{
    250    return (unsigned long) _threadstore();
    251 }
    252 
    253 
    254 void
    255 _glthread_InitTSD(_glthread_TSD *tsd)
    256 {
    257    tsd->key = (ULONG) (_threadstore());
    258    tsd->initMagic = INIT_MAGIC;
    259 }
    260 
    261 
    262 void *
    263 _glthread_GetTSD(_glthread_TSD *tsd)
    264 {
    265    if (tsd->initMagic != INIT_MAGIC) {
    266       _glthread_InitTSD(tsd);
    267    }
    268    return _threadstore();
     260   return (unsigned long) __threadstore();
     261}
     262
     263
     264void
     265_glthread_InitTSD(_glthread_TSD *tsd)
     266{
     267   tsd->key = (ULONG) (__threadstore());
     268   tsd->initMagic = INIT_MAGIC;
     269}
     270
     271
     272void *
     273_glthread_GetTSD(_glthread_TSD *tsd)
     274{
     275   if (tsd->initMagic != INIT_MAGIC) {
     276      _glthread_InitTSD(tsd);
     277   }
     278   return __threadstore();
    269279}
    270280
     
    279289   }
    280290
    281    (*_threadstore())=(void *)ptr;
     291   (*__threadstore())=(void *)ptr;
    282292}
    283293
Note: See TracChangeset for help on using the changeset viewer.