Windows NT 4.0 source code leak
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.

53 lines
850 B

4 years ago
  1. //////////////////////////////////////////////////////////////////////////////
  2. // UDTRefs bit maps
  3. #include "pdbimpl.h"
  4. #include "dbiimpl.h"
  5. #include <stdio.h>
  6. UDTRefs::UDTRefs(unsigned int cti_) : cti(cti_), ucur(0)
  7. {
  8. }
  9. UDTRefs::~UDTRefs()
  10. {
  11. }
  12. unsigned int UDTRefs::normalize(TI ti)
  13. {
  14. dassert(!CV_IS_PRIMITIVE(ti));
  15. unsigned int retval = ti - CV_FIRST_NONPRIM;
  16. dassert(retval <= cti);
  17. return retval;
  18. }
  19. TI UDTRefs::denormalize(unsigned int u)
  20. {
  21. return u + CV_FIRST_NONPRIM;
  22. }
  23. BOOL UDTRefs::fNoteRef(TI ti)
  24. {
  25. return isetRefs.add(normalize(ti));
  26. }
  27. BOOL UDTRefs::tiNext(TI *pti)
  28. {
  29. unsigned int u = ucur;
  30. do {
  31. if (isetRefs.contains(u) && !isetProcessed.contains(u)) {
  32. *pti = denormalize(u);
  33. ucur = (u + 1) % cti;
  34. return isetProcessed.add(u);
  35. }
  36. u = (u + 1) % cti;
  37. } while (u != ucur);
  38. *pti = tiNil;
  39. return TRUE;
  40. }