@@ -823,7 +823,7 @@ const BYTE emitter::emitInsModeFmtTab[] =
823823// clang-format on
824824
825825#ifdef DEBUG
826- unsigned const emitter::emitInsModeFmtCnt = sizeof (emitInsModeFmtTab) / sizeof (emitInsModeFmtTab[ 0 ] );
826+ unsigned const emitter::emitInsModeFmtCnt = _countof (emitInsModeFmtTab);
827827#endif
828828
829829/* ****************************************************************************
@@ -938,7 +938,7 @@ inline size_t insCode(instruction ins)
938938 };
939939 // clang-format on
940940
941- assert ((unsigned )ins < sizeof (insCodes) / sizeof (insCodes[ 0 ] ));
941+ assert ((unsigned )ins < _countof (insCodes));
942942 assert ((insCodes[ins] != BAD_CODE));
943943
944944 return insCodes[ins];
@@ -971,7 +971,7 @@ inline size_t insCodeACC(instruction ins)
971971 };
972972 // clang-format on
973973
974- assert ((unsigned )ins < sizeof (insCodesACC) / sizeof (insCodesACC[ 0 ] ));
974+ assert ((unsigned )ins < _countof (insCodesACC));
975975 assert ((insCodesACC[ins] != BAD_CODE));
976976
977977 return insCodesACC[ins];
@@ -1004,7 +1004,7 @@ inline size_t insCodeRR(instruction ins)
10041004 };
10051005 // clang-format on
10061006
1007- assert ((unsigned )ins < sizeof (insCodesRR) / sizeof (insCodesRR[ 0 ] ));
1007+ assert ((unsigned )ins < _countof (insCodesRR));
10081008 assert ((insCodesRR[ins] != BAD_CODE));
10091009
10101010 return insCodesRR[ins];
@@ -1033,7 +1033,7 @@ size_t insCodesRM[] =
10331033// Returns true iff the give CPU instruction has an RM encoding.
10341034inline bool hasCodeRM (instruction ins)
10351035{
1036- assert ((unsigned )ins < sizeof (insCodesRM) / sizeof (insCodesRM[ 0 ] ));
1036+ assert ((unsigned )ins < _countof (insCodesRM));
10371037 return ((insCodesRM[ins] != BAD_CODE));
10381038}
10391039
@@ -1044,7 +1044,7 @@ inline bool hasCodeRM(instruction ins)
10441044
10451045inline size_t insCodeRM (instruction ins)
10461046{
1047- assert ((unsigned )ins < sizeof (insCodesRM) / sizeof (insCodesRM[ 0 ] ));
1047+ assert ((unsigned )ins < _countof (insCodesRM));
10481048 assert ((insCodesRM[ins] != BAD_CODE));
10491049
10501050 return insCodesRM[ins];
@@ -1073,7 +1073,7 @@ size_t insCodesMI[] =
10731073// Returns true iff the give CPU instruction has an MI encoding.
10741074inline bool hasCodeMI (instruction ins)
10751075{
1076- assert ((unsigned )ins < sizeof (insCodesMI) / sizeof (insCodesMI[ 0 ] ));
1076+ assert ((unsigned )ins < _countof (insCodesMI));
10771077 return ((insCodesMI[ins] != BAD_CODE));
10781078}
10791079
@@ -1084,7 +1084,7 @@ inline bool hasCodeMI(instruction ins)
10841084
10851085inline size_t insCodeMI (instruction ins)
10861086{
1087- assert ((unsigned )ins < sizeof (insCodesMI) / sizeof (insCodesMI[ 0 ] ));
1087+ assert ((unsigned )ins < _countof (insCodesMI));
10881088 assert ((insCodesMI[ins] != BAD_CODE));
10891089
10901090 return insCodesMI[ins];
@@ -1113,7 +1113,7 @@ size_t insCodesMR[] =
11131113// Returns true iff the give CPU instruction has an MR encoding.
11141114inline bool hasCodeMR (instruction ins)
11151115{
1116- assert ((unsigned )ins < sizeof (insCodesMR) / sizeof (insCodesMR[ 0 ] ));
1116+ assert ((unsigned )ins < _countof (insCodesMR));
11171117 return ((insCodesMR[ins] != BAD_CODE));
11181118}
11191119
@@ -1124,7 +1124,7 @@ inline bool hasCodeMR(instruction ins)
11241124
11251125inline size_t insCodeMR (instruction ins)
11261126{
1127- assert ((unsigned )ins < sizeof (insCodesMR) / sizeof (insCodesMR[ 0 ] ));
1127+ assert ((unsigned )ins < _countof (insCodesMR));
11281128 assert ((insCodesMR[ins] != BAD_CODE));
11291129
11301130 return insCodesMR[ins];
@@ -5964,7 +5964,7 @@ const char* emitter::emitXMMregName(unsigned reg)
59645964 };
59655965
59665966 assert (reg < REG_COUNT);
5967- assert (reg < sizeof (regNames) / sizeof (regNames[ 0 ] ));
5967+ assert (reg < _countof (regNames));
59685968
59695969 return regNames[reg];
59705970}
@@ -5986,7 +5986,7 @@ const char* emitter::emitYMMregName(unsigned reg)
59865986 };
59875987
59885988 assert (reg < REG_COUNT);
5989- assert (reg < sizeof (regNames) / sizeof (regNames[ 0 ] ));
5989+ assert (reg < _countof (regNames));
59905990
59915991 return regNames[reg];
59925992}
0 commit comments