--- rxvt-unicode/src/keyboard.C 2011/12/03 11:31:56 1.54 +++ rxvt-unicode/src/keyboard.C 2012/05/18 00:10:47 1.59 @@ -26,11 +26,10 @@ #ifdef KEYSYM_RESOURCE -#include +#include #include "rxvtperl.h" #include "keyboard.h" -#include "command.h" /* an intro to the data structure: * @@ -114,28 +113,19 @@ keysym_t *key = new keysym_t; - if (key && translation) - { - key->keysym = keysym; - key->state = state; - key->str = translation; - key->type = keysym_t::STRING; + key->keysym = keysym; + key->state = state; + key->str = translation; + key->type = keysym_t::STRING; - if (strncmp (translation, "builtin:", 8) == 0) - key->type = keysym_t::BUILTIN; + if (strncmp (translation, "builtin:", 8) == 0) + key->type = keysym_t::BUILTIN; - if (keymap.size () == keymap.capacity ()) - keymap.reserve (keymap.size () * 2); + if (keymap.size () == keymap.capacity ()) + keymap.reserve (keymap.size () * 2); - keymap.push_back (key); - hash[0] = 3; - } - else - { - delete key; - free (translation); - rxvt_fatal ("memory allocation failure. aborting.\n"); - } + keymap.push_back (key); + hash[0] = 3; } bool @@ -180,7 +170,6 @@ keyboard_manager::register_done () { unsigned int i, index, hashkey; - vector sorted_keymap; uint16_t hash_bucket_size[KEYSYM_HASH_BUCKETS]; // size of each bucket memset (hash_bucket_size, 0, sizeof (hash_bucket_size)); @@ -202,7 +191,7 @@ } // and allocate just enough space - sorted_keymap.insert (sorted_keymap.begin (), index + hash_bucket_size [i - 1], 0); + simplevec sorted_keymap (index + hash_bucket_size [i - 1], 0); memset (hash_bucket_size, 0, sizeof (hash_bucket_size));