Translates a code label into an n-ary integer, reading the first nop as 0. * Example: nops A, B, C with base 3 * no nops = 0 * A = 0 * B = 1 * AA = 0 * AC = 2 * BB = 4 * CA = 6 */
| 78 | * CA = 6 |
| 79 | */ |
| 80 | int cCodeLabel::AsInt(const int base) const |
| 81 | { |
| 82 | int value = 0; |
| 83 | |
| 84 | for (int i = 0; i < m_nops.GetSize(); i++) { |
| 85 | value *= base; |
| 86 | value += m_nops[i]; |
| 87 | } |
| 88 | |
| 89 | return value; |
| 90 | } |
| 91 | |
| 92 | int cCodeLabel::AsIntGreyCode(const int base) const |
| 93 | { |
no test coverage detected