OSDN Git Service

Merge remote-tracking branch 'remotes/hengbandosx/english-mind-edits' into feature...
[hengband/hengband.git] / src / util / bit-flags-calculator.h
1 #pragma once
2
3 #define has_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX) / 32] & (1L << ((INDEX) % 32)))
4 #define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX) / 32] |= (1L << ((INDEX) % 32)))
5 #define remove_flag(ARRAY, INDEX) ((ARRAY)[(INDEX) / 32] &= ~(1L << ((INDEX) % 32)))
6 #define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
7 #define has_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))