mirror of
https://review.haiku-os.org/haiku
synced 2025-01-24 15:24:50 +01:00
3302521556
This fixes a maintainance problem where you have to update this otherwise unrelated file to keep it in sync whenever you add a color constant. I've added a B_COLOR_WHICH_COUNT constant to the color_which enum which should be updated to point to the newest color constants as new ones are added. I reworked ServerReadOnlyMemory to use this constant instead of using to the current largest color constant directly. If you use B_COLOR_WHICH_COUNT to refer to a color in your code expect to get unpredictable and nonsensical results. Most likely you'll get an undefined result which will return black but don't depend on it. The net effect of this is that ServerReadOnlyMemory doesn't need to be updated anymore when new color constants are introduced but will continue to produce correct results. Eliminate kNumColors constant, replace it with B_COLOR_WHICH_COUNT