--- rxvt-unicode/src/keyboard.C 2006/02/20 22:40:35 1.25 +++ rxvt-unicode/src/keyboard.C 2007/07/29 09:37:01 1.27 @@ -140,30 +140,13 @@ return len; } -//////////////////////////////////////////////////////////////////////////////// -// return: #bits of '1' -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) -# define bitcount(n) (__extension__ ({ uint32_t n__ = (n); __builtin_popcount (n__); })) -#else -static int -bitcount (uint16_t n) -{ - int i; - - for (i = 0; n; ++i, n &= n - 1) - ; - - return i; -} -#endif - // return: priority_of_a - priority_of_b static int compare_priority (keysym_t *a, keysym_t *b) { // (the more '1's in state; the less range): the greater priority - int ca = bitcount (a->state /* & OtherModMask */); - int cb = bitcount (b->state /* & OtherModMask */); + int ca = popcount (a->state /* & OtherModMask */); + int cb = popcount (b->state /* & OtherModMask */); if (ca != cb) return ca - cb; @@ -238,7 +221,7 @@ key->type = keysym_t::LIST; key->range = suffix - middle - 1; - strcpy (translation, translation + 4); + memmove (translation, translation + 4, strlen (translation + 4) + 1); } else rxvt_warn ("cannot parse list-type keysym '%s', treating as normal keysym.\n", translation);