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.

199 lines
4.4 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/knotvector.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 Knotvector;
  43. struct Knotvector {
  44. long order__10Knotvector ;
  45. long knotcount__10Knotvector ;
  46. long stride__10Knotvector ;
  47. Knot *knotlist__10Knotvector ;
  48. };
  49. extern struct __mptr* __ptbl_vec_____core_knotvector_c___init_[];
  50. void __glinit__10KnotvectorFlN21Pf (struct Knotvector *__0this , long __1_knotcount , long __1_stride , long __1_order , float *__1_knotlist )
  51. {
  52. void *__1__Xp00uzigaiaa ;
  53. __0this -> knotcount__10Knotvector = __1_knotcount ;
  54. __0this -> stride__10Knotvector = __1_stride ;
  55. __0this -> order__10Knotvector = __1_order ;
  56. __0this -> knotlist__10Knotvector = (((float *)( (__1__Xp00uzigaiaa = malloc ( ((sizeof (float ))* __1_knotcount )) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa ))))
  57. ));
  58. ((void )0 );
  59. { { int __1i ;
  60. __1i = 0 ;
  61. for(;__1i != __1_knotcount ;__1i ++ )
  62. (__0this -> knotlist__10Knotvector [__1i ])= (((float )(__1_knotlist [__1i ])));
  63. }
  64. }
  65. }
  66. struct Knotvector *__gl__ct__10KnotvectorFv (struct Knotvector *__0this )
  67. {
  68. void *__1__Xp00uzigaiaa ;
  69. if (__0this || (__0this = (struct Knotvector *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Knotvector))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) ))
  70. __0this ->
  71. knotlist__10Knotvector = 0 ;
  72. return __0this ;
  73. }
  74. void __gl__dt__10KnotvectorFv (struct Knotvector *__0this ,
  75. int __0__free )
  76. {
  77. void *__1__X2 ;
  78. if (__0this ){
  79. if (__0this -> knotlist__10Knotvector )( (__1__X2 = (void *)__0this -> knotlist__10Knotvector ), ( (__1__X2 ?( free ( __1__X2 ) ,
  80. 0 ) :( 0 ) )) ) ;
  81. if (__0this )if (__0__free & 1)( (((void *)__0this )?( free ( ((void *)__0this )) , 0 ) :( 0 ) ))
  82. ;
  83. }
  84. }
  85. int __glvalidate__10KnotvectorFv (struct Knotvector *__0this )
  86. {
  87. long __1kindex ;
  88. __1kindex = (__0this -> knotcount__10Knotvector - 1 );
  89. if ((__0this -> order__10Knotvector < 1 )|| (__0this -> order__10Knotvector > 24 )){
  90. return 1 ;
  91. }
  92. if (__0this -> knotcount__10Knotvector < (2 * __0this -> order__10Knotvector )){
  93. return 2 ;
  94. }
  95. if (( ((((__0this -> knotlist__10Knotvector [(__1kindex - (__0this -> order__10Knotvector - 1 ))])- (__0this -> knotlist__10Knotvector [(__0this -> order__10Knotvector - 1 )]))< 10.0e-5 )?1 :0 )) ){
  96. return
  97. 3 ;
  98. }
  99. { { long __1i ;
  100. __1i = 0 ;
  101. for(;__1i < __1kindex ;__1i ++ )
  102. if ((__0this -> knotlist__10Knotvector [__1i ])> (__0this -> knotlist__10Knotvector [(__1i + 1 )])){
  103. return 4 ;
  104. }
  105. { long __1multi ;
  106. __1multi = 1 ;
  107. for(-- __1kindex ;__1kindex > 1 ;__1kindex -- ) {
  108. if (((__0this -> knotlist__10Knotvector [__1kindex ])- (__0this -> knotlist__10Knotvector [(__1kindex - 1 )]))< 10.0e-5 ){
  109. __1multi ++ ;
  110. continue ;
  111. }
  112. if (__1multi > __0this -> order__10Knotvector ){
  113. return 5 ;
  114. }
  115. __1multi = 1 ;
  116. }
  117. if (__1multi > __0this -> order__10Knotvector ){
  118. return 5 ;
  119. }
  120. return 0 ;
  121. }
  122. }
  123. }
  124. }
  125. void __glshow__10KnotvectorFPc (struct Knotvector *__0this , char *__1msg )
  126. {
  127. }
  128. /* the end */