Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

392 lines
10 KiB

  1. /*
  2. ** Copyright 1992, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. **
  17. */
  18. #include <stdlib.h>
  19. #include <setjmp.h>
  20. struct JumpBuffer {
  21. jmp_buf buf;
  22. };
  23. #define mysetjmp(x) setjmp((x)->buf)
  24. #define mylongjmp(x,y) longjmp((x)->buf, y)
  25. /* <<AT&T USL C++ Language System <3.0.1> 02/03/92>> */
  26. /* < ../core/varray.c++ > */
  27. void *__vec_new (void *, int , int , void *);
  28. void __vec_ct (void *, int , int , void *);
  29. void __vec_dt (void *, int , int , void *);
  30. void __vec_delete (void *, int , int , void *, int , int );
  31. typedef int (*__vptp)(void);
  32. struct __mptr {short d; short i; __vptp f; };
  33. typedef unsigned int size_t ;
  34. // extern void *malloc (size_t );
  35. // extern void free (void *);
  36. typedef float REAL ;
  37. typedef void (*Pfvv )(void );
  38. typedef void (*Pfvf )(float *);
  39. typedef int (*cmpfunc )(void *, void *);
  40. typedef REAL Knot ;
  41. typedef REAL *Knot_ptr ;
  42. struct Arc;
  43. struct Varray;
  44. struct Varray {
  45. REAL *varray__6Varray ;
  46. REAL vval__6Varray [1000];
  47. long voffset__6Varray [1000];
  48. long numquads__6Varray ;
  49. long size__6Varray ;
  50. };
  51. struct Buffer;
  52. struct Buffer {
  53. struct Buffer *next__6Buffer ;
  54. };
  55. struct Pool;
  56. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  57. struct Pool {
  58. struct Buffer *freelist__4Pool ;
  59. char *blocklist__4Pool [32];
  60. int nextblock__4Pool ;
  61. char *curblock__4Pool ;
  62. int buffersize__4Pool ;
  63. int nextsize__4Pool ;
  64. int nextfree__4Pool ;
  65. int initsize__4Pool ;
  66. char *name__4Pool ;
  67. int magic__4Pool ;
  68. };
  69. void __glgrow__4PoolFv (struct Pool *);
  70. struct PooledObj;
  71. struct PooledObj {
  72. char __W3__9PooledObj ;
  73. };
  74. struct TrimVertex;
  75. struct PwlArc;
  76. struct PwlArc {
  77. char __W3__9PooledObj ;
  78. struct TrimVertex *pts__6PwlArc ;
  79. int npts__6PwlArc ;
  80. long type__6PwlArc ;
  81. };
  82. struct TrimVertex;
  83. struct TrimVertex {
  84. REAL param__10TrimVertex [2];
  85. long nuid__10TrimVertex ;
  86. };
  87. typedef struct TrimVertex *TrimVertex_p ;
  88. struct Bin;
  89. struct Arc;
  90. struct BezierArc;
  91. typedef struct Arc *Arc_ptr ;
  92. enum arc_side { arc_none = 0, arc_right = 1, arc_top = 2, arc_left = 3, arc_bottom = 4} ;
  93. struct Arc;
  94. struct Arc {
  95. char __W3__9PooledObj ;
  96. Arc_ptr prev__3Arc ;
  97. Arc_ptr next__3Arc ;
  98. Arc_ptr link__3Arc ;
  99. struct BezierArc *bezierArc__3Arc ;
  100. struct PwlArc *pwlArc__3Arc ;
  101. long type__3Arc ;
  102. long nuid__3Arc ;
  103. };
  104. extern int __glbezier_tag__3Arc ;
  105. extern int __glarc_tag__3Arc ;
  106. extern int __gltail_tag__3Arc ;
  107. extern struct __mptr* __ptbl_vec_____core_varray_c_____ct_[];
  108. struct Varray *__gl__ct__6VarrayFv (struct Varray *__0this )
  109. {
  110. void *__1__Xp00uzigaiaa ;
  111. if (__0this || (__0this = (struct Varray *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Varray))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) )){
  112. __0this -> varray__6Varray = 0 ;
  113. __0this -> size__6Varray = 0 ;
  114. } return __0this ;
  115. }
  116. void __gl__dt__6VarrayFv (struct Varray *__0this ,
  117. int __0__free )
  118. {
  119. void *__1__X5 ;
  120. if (__0this ){
  121. if (__0this -> varray__6Varray )( (__1__X5 = (void *)__0this -> varray__6Varray ), ( (__1__X5 ?( free ( __1__X5 ) ,
  122. 0 ) :( 0 ) )) ) ;
  123. if (__0this )if (__0__free & 1)( (((void *)__0this )?( free ( ((void *)__0this )) , 0 ) :( 0 ) ))
  124. ;
  125. }
  126. }
  127. static REAL *tail__3ArcFv (struct Arc *);
  128. void __glgrow__6VarrayFl (struct Varray *__0this , long __1guess )
  129. {
  130. if (__0this -> size__6Varray < __1guess ){
  131. void *__1__X8 ;
  132. void *__1__Xp00uzigaiaa ;
  133. __0this -> size__6Varray = (__1guess * 2 );
  134. if (__0this -> varray__6Varray )( (__1__X8 = (void *)__0this -> varray__6Varray ), ( (__1__X8 ?( free ( __1__X8 ) , 0 ) :(
  135. 0 ) )) ) ;
  136. __0this -> varray__6Varray = (((float *)( (__1__Xp00uzigaiaa = malloc ( ((sizeof (float ))* __0this -> size__6Varray )) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void
  137. *)__1__Xp00uzigaiaa )))) ));
  138. ((void )0 );
  139. }
  140. }
  141. long __glinit__6VarrayFfP3ArcT2 (struct Varray *__0this , REAL __1delta , Arc_ptr __1toparc , Arc_ptr __1botarc )
  142. {
  143. Arc_ptr __1left ;
  144. Arc_ptr __1right ;
  145. long __1ldir [2];
  146. long __1rdir [2];
  147. float __1__X9 ;
  148. float __1__X10 ;
  149. float __1__X11 ;
  150. float __1__X12 ;
  151. float __1__X17 ;
  152. __1left = __1toparc -> next__3Arc ;
  153. __1right = __1toparc ;
  154. (__1ldir [0 ])= ( (__1__X9 = ((( (((REAL *)(((struct Arc *)__1left )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])- (tail__3ArcFv ( (struct Arc *)__1left -> prev__3Arc )
  155. [0 ]))), ( (((long )((__1__X9 < 0.0 )?-1:((__1__X9 > 0.0 )?1 :0 ))))) ) ;
  156. (__1ldir [1 ])= ( (__1__X10 = ((( (((REAL *)(((struct Arc *)__1left )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])- (tail__3ArcFv ( (struct Arc *)__1left -> prev__3Arc )
  157. [1 ]))), ( (((long )((__1__X10 < 0.0 )?-1:((__1__X10 > 0.0 )?1 :0 ))))) ) ;
  158. (__1rdir [0 ])= ( (__1__X11 = ((( (((REAL *)(((struct Arc *)__1right )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])- (tail__3ArcFv ( (struct Arc *)__1right -> prev__3Arc )
  159. [0 ]))), ( (((long )((__1__X11 < 0.0 )?-1:((__1__X11 > 0.0 )?1 :0 ))))) ) ;
  160. (__1rdir [1 ])= ( (__1__X12 = ((( (((REAL *)(((struct Arc *)__1right )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])- (tail__3ArcFv ( (struct Arc *)__1right -> prev__3Arc )
  161. [1 ]))), ( (((long )((__1__X12 < 0.0 )?-1:((__1__X12 > 0.0 )?1 :0 ))))) ) ;
  162. (__0this -> vval__6Varray [0 ])= (( (((REAL *)(((struct Arc *)__1toparc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ]);
  163. __0this -> numquads__6Varray = 0 ;
  164. while (1 ){
  165. float __1__X13 ;
  166. switch (( (__1__X13 = ((( (((REAL *)(((struct Arc *)__1left )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])- (tail__3ArcFv ( (struct Arc *)__1right -> prev__3Arc )
  167. [1 ]))), ( (((long )((__1__X13 < 0.0 )?-1:((__1__X13 > 0.0 )?1 :0 ))))) ) ){
  168. struct Arc *__0__X14 ;
  169. float __1__X15 ;
  170. register long __1__Xds00a4bkaimc ;
  171. register long __1__Xdt00a4bkaimc ;
  172. float __1__X6 ;
  173. float __1__X7 ;
  174. float __1__X16 ;
  175. case 1 :
  176. __1left = __1left -> next__3Arc ;
  177. ( (__1__X15 = (( (__0__X14 = (struct Arc *)__1left -> prev__3Arc ), ( (((REAL *)(__0__X14 -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) ) [1 ])),
  178. ( (__1__Xds00a4bkaimc = ( (__1__X6 = ((( (((REAL *)(((struct Arc *)__1left )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])- (tail__3ArcFv ( (struct Arc *)__1left ->
  179. prev__3Arc ) [0 ]))), ( (((long )((__1__X6 < 0.0 )?-1:((__1__X6 > 0.0 )?1 :0 ))))) ) ), ( (__1__Xdt00a4bkaimc = ( (__1__X7 = (((
  180. (((REAL *)(((struct Arc *)__1left )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])- (tail__3ArcFv ( (struct Arc *)__1left -> prev__3Arc ) [1 ]))), ( (((long )((__1__X7 <
  181. 0.0 )?-1:((__1__X7 > 0.0 )?1 :0 ))))) ) ), ((((((long *)__1ldir )[0 ])!= __1__Xds00a4bkaimc )|| ((((long *)__1ldir )[1 ])!= __1__Xdt00a4bkaimc ))?( ( ((((long *)__1ldir )[0 ])= __1__Xds00a4bkaimc ),
  182. ( ((((long *)__1ldir )[1 ])= __1__Xdt00a4bkaimc ), ( ((__1__X15 != (__0this -> vval__6Varray [__0this -> numquads__6Varray ]))?( ((__0this -> vval__6Varray [(++ __0this -> numquads__6Varray )])= __1__X15 ),
  183. 0 ) :0 )) ) ) , 0 ) :( 0 ) )) ) ) ;
  184. break ;
  185. case -1:
  186. __1right = __1right -> prev__3Arc ;
  187. ( (__1__X16 = (( (((REAL *)(((struct Arc *)__1right )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])), ( (__1__Xds00a4bkaimc = ( (__1__X6 = (((
  188. (((REAL *)(((struct Arc *)__1right )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [0 ])- (tail__3ArcFv ( (struct Arc *)__1right -> prev__3Arc ) [0 ]))), ( (((long )((__1__X6 <
  189. 0.0 )?-1:((__1__X6 > 0.0 )?1 :0 ))))) ) ), ( (__1__Xdt00a4bkaimc = ( (__1__X7 = ((( (((REAL *)(((struct Arc *)__1right )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex )))
  190. [1 ])- (tail__3ArcFv ( (struct Arc *)__1right -> prev__3Arc ) [1 ]))), ( (((long )((__1__X7 < 0.0 )?-1:((__1__X7 > 0.0 )?1 :0 ))))) ) ), ((((((long
  191. *)__1rdir )[0 ])!= __1__Xds00a4bkaimc )|| ((((long *)__1rdir )[1 ])!= __1__Xdt00a4bkaimc ))?( ( ((((long *)__1rdir )[0 ])= __1__Xds00a4bkaimc ), ( ((((long *)__1rdir )[1 ])= __1__Xdt00a4bkaimc ), (
  192. ((__1__X16 != (__0this -> vval__6Varray [__0this -> numquads__6Varray ]))?( ((__0this -> vval__6Varray [(++ __0this -> numquads__6Varray )])= __1__X16 ), 0 ) :0 )) ) ) ,
  193. 0 ) :( 0 ) )) ) ) ;
  194. break ;
  195. case 0 :
  196. if ((( (((REAL *)(((struct Arc *)__1left )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])== (( (((REAL *)(((struct Arc *)__1botarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]).
  197. param__10TrimVertex ))) [1 ]))goto end ;
  198. __1left = __1left -> next__3Arc ;
  199. break ;
  200. }
  201. }
  202. end :
  203. ( (__1__X17 = (( (((REAL *)(((struct Arc *)__1botarc )-> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ))) [1 ])), ( ((__1__X17 != (__0this -> vval__6Varray [__0this -> numquads__6Varray ]))?(
  204. ((__0this -> vval__6Varray [(++ __0this -> numquads__6Varray )])= __1__X17 ), 0 ) :0 )) ) ;
  205. __glgrow__6VarrayFl ( __0this , ((((long )(((__0this -> vval__6Varray [0 ])- (__0this -> vval__6Varray [__0this -> numquads__6Varray ]))/ __1delta )))+ __0this -> numquads__6Varray )+ 2 ) ;
  206. { long __1index ;
  207. __1index = 0 ;
  208. { { long __1i ;
  209. __1i = 0 ;
  210. for(;__1i < __0this -> numquads__6Varray ;__1i ++ ) {
  211. (__0this -> voffset__6Varray [__1i ])= __1index ;
  212. (__0this -> varray__6Varray [(__1index ++ )])= (__0this -> vval__6Varray [__1i ]);
  213. { REAL __2dist ;
  214. __2dist = ((__0this -> vval__6Varray [__1i ])- (__0this -> vval__6Varray [(__1i + 1 )]));
  215. if (__2dist > __1delta ){
  216. long __3steps ;
  217. float __3deltav ;
  218. __3steps = ((((long )(__2dist / __1delta )))+ 1 );
  219. __3deltav = ((- __2dist )/ (((float )__3steps )));
  220. { { long __3j ;
  221. __3j = 1 ;
  222. for(;__3j < __3steps ;__3j ++ )
  223. (__0this -> varray__6Varray [(__1index ++ )])= ((__0this -> vval__6Varray [__1i ])+ (__3j * __3deltav ));
  224. }
  225. }
  226. }
  227. }
  228. }
  229. (__0this -> voffset__6Varray [__1i ])= __1index ;
  230. (__0this -> varray__6Varray [__1index ])= (__0this -> vval__6Varray [__1i ]);
  231. return __1index ;
  232. }
  233. }
  234. }
  235. }
  236. static REAL *tail__3ArcFv (struct Arc *__0this ){ return (__0this -> pwlArc__3Arc -> pts__6PwlArc [0 ]). param__10TrimVertex ;
  237. }
  238. /* the end */