• Post Reply Bookmark Topic Watch Topic
  • New Topic

Removing bitmask...?  RSS feed

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bitmask as follows:



Am I removing the action from the mask properly? Is there any chance it'll remove other actions? I'm assuming as long as I stay with every action being a power of 2, that there'll be no overlaps, correct?
 
Campbell Ritchie
Marshal
Posts: 56207
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I can tell just looking at your code for a few seconds, you are doing it all correctly.
CR
 
Anand Hariharan
Rancher
Posts: 272
C++ Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dan Bizman:

Am I removing the action from the mask properly? Is there any chance it'll remove other actions? I'm assuming as long as I stay with every action being a power of 2, that there'll be no overlaps, correct?


If you are worried about someone calling your removeAction with 0xffff (or addAction -- which ever is to your detriment), you could implement nullary methods - one for each action.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!