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.

88 lines
1.8 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. pragma.cxx
  5. Abstract:
  6. Implementation of the object that maintains flags for each warning/error
  7. message. The flag indicates whether or not the warning should be emitted.
  8. Error messages are always emitted.
  9. Notes:
  10. Author:
  11. NishadM Dec-30-1997 Created.
  12. Notes:
  13. ----------------------------------------------------------------------------*/
  14. #pragma warning ( disable : 4514 4512 )
  15. #include "Pragma.hxx"
  16. CMessageNumberList::CMessageNumberList()
  17. {
  18. SetAll();
  19. }
  20. void CMessageNumberList::SetAll()
  21. {
  22. for ( unsigned long i = 0; i < c_nMsgs; i++ )
  23. {
  24. fMessageNumber[i] = ( unsigned long ) -1;
  25. }
  26. }
  27. void CMessageNumberList::ResetAll()
  28. {
  29. for ( unsigned long i = 0; i < c_nMsgs; i++ )
  30. {
  31. fMessageNumber[i] = 0;
  32. }
  33. }
  34. unsigned long CMessageNumberList::BitIndex( unsigned long ulMsg )
  35. {
  36. if ( ulMsg >= C_ERR_START && ulMsg <= C_ERR_MAX )
  37. {
  38. ulMsg = ulMsg - C_ERR_START + D_ERR_MAX - D_ERR_START + 2;
  39. }
  40. else if ( ulMsg >= D_ERR_START && ulMsg <= D_ERR_MAX )
  41. {
  42. ulMsg = ulMsg - D_ERR_START + 1;
  43. }
  44. else
  45. {
  46. ulMsg = 0;
  47. }
  48. return ulMsg;
  49. }
  50. void CMessageNumberList::SetMessageFlags( CMessageNumberList& list )
  51. {
  52. for ( unsigned long i = 0; i < c_nMsgs; i++ )
  53. {
  54. fMessageNumber[i] |= list.fMessageNumber[i];
  55. }
  56. }
  57. void CMessageNumberList::ResetMessageFlags( CMessageNumberList& list )
  58. {
  59. for ( unsigned long i = 0; i < c_nMsgs; i++ )
  60. {
  61. fMessageNumber[i] &= ~(list.fMessageNumber[i]);
  62. }
  63. }
  64. /*
  65. GlobalMainMessageNumberList contains the list of currently enabled/disabled warnings.
  66. */
  67. CMessageNumberList GlobalMainMessageNumberList;