| 629 | |
| 630 | /* Pick the nth TRUE entry in the given boolean array. */ |
| 631 | staticfn xint16 |
| 632 | pick_level( |
| 633 | boolean *map, /* an array MAXLEVEL+1 in size */ |
| 634 | int nth) |
| 635 | { |
| 636 | xint16 i; |
| 637 | for (i = 1; i <= MAXLEVEL; i++) |
| 638 | if (map[i] && !nth--) |
| 639 | return i; |
| 640 | panic("pick_level: ran out of valid levels"); |
| 641 | /*NOTREACHED*/ |
| 642 | return 0; |
| 643 | } |
| 644 | |
| 645 | RESTORE_WARNING_UNREACHABLE_CODE |
| 646 |