… | |
… | |
143 | // return: priority_of_a - priority_of_b |
143 | // return: priority_of_a - priority_of_b |
144 | static int |
144 | static int |
145 | compare_priority (keysym_t *a, keysym_t *b) |
145 | compare_priority (keysym_t *a, keysym_t *b) |
146 | { |
146 | { |
147 | // (the more '1's in state; the less range): the greater priority |
147 | // (the more '1's in state; the less range): the greater priority |
148 | int ca = popcount (a->state /* & OtherModMask */); |
148 | int ca = rxvt_popcount (a->state /* & OtherModMask */); |
149 | int cb = popcount (b->state /* & OtherModMask */); |
149 | int cb = rxvt_popcount (b->state /* & OtherModMask */); |
150 | |
150 | |
151 | if (ca != cb) |
151 | if (ca != cb) |
152 | return ca - cb; |
152 | return ca - cb; |
153 | //else if (a->state != b->state) // this behavior is to be disscussed |
153 | //else if (a->state != b->state) // this behavior is to be disscussed |
154 | // return b->state - a->state; |
154 | // return b->state - a->state; |
… | |
… | |
426 | ++hash_budget_counter [hashkey]; |
426 | ++hash_budget_counter [hashkey]; |
427 | } |
427 | } |
428 | |
428 | |
429 | keymap.swap (sorted_keymap); |
429 | keymap.swap (sorted_keymap); |
430 | |
430 | |
431 | #ifdef DEBUG_STRICT |
431 | #ifndef NDEBUG |
432 | // check for invariants |
432 | // check for invariants |
433 | for (i = 0; i < KEYSYM_HASH_BUDGETS; ++i) |
433 | for (i = 0; i < KEYSYM_HASH_BUDGETS; ++i) |
434 | { |
434 | { |
435 | index = hash[i]; |
435 | index = hash[i]; |
436 | for (int j = 0; j < hash_budget_size [i]; ++j) |
436 | for (int j = 0; j < hash_budget_size [i]; ++j) |