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.

28 lines
506 B

  1. // Copyright (c) 1993-1999 Microsoft Corporation
  2. #include "y4.h"
  3. nxti()
  4. {
  5. /* finds the next i */
  6. register i, maxi;
  7. SSIZE_T max;
  8. max = 0;
  9. for( i=1; i<= nnonter; ++i ) if( ggreed[i] >= max )
  10. {
  11. max = ggreed[i];
  12. maxi = -i;
  13. }
  14. for( i=0; i<nstate; ++i ) if( greed[i] >= max )
  15. {
  16. max = greed[i];
  17. maxi = i;
  18. }
  19. if( nxdb ) fprintf( ftable, "nxti = %d, max = %d\n", maxi, max );
  20. if( max==0 ) return( NOMORE );
  21. else return( maxi );
  22. }