diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 5824042e663..f03a5ef9f73 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -160,14 +160,7 @@ int raw_keybuf_count; | |||
| 160 | 160 | ||
| 161 | #define GROW_RAW_KEYBUF \ | 161 | #define GROW_RAW_KEYBUF \ |
| 162 | if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \ | 162 | if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \ |
| 163 | { \ | 163 | raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil) \ |
| 164 | int newsize = 2 * XVECTOR (raw_keybuf)->size; \ | ||
| 165 | Lisp_Object new; \ | ||
| 166 | new = Fmake_vector (make_number (newsize), Qnil); \ | ||
| 167 | bcopy (XVECTOR (raw_keybuf)->contents, XVECTOR (new)->contents, \ | ||
| 168 | raw_keybuf_count * sizeof (Lisp_Object)); \ | ||
| 169 | raw_keybuf = new; \ | ||
| 170 | } | ||
| 171 | 164 | ||
| 172 | /* Number of elements of this_command_keys | 165 | /* Number of elements of this_command_keys |
| 173 | that precede this key sequence. */ | 166 | that precede this key sequence. */ |
| @@ -7598,13 +7591,7 @@ menu_bar_items (old) | |||
| 7598 | /* Add nil, nil, nil, nil at the end. */ | 7591 | /* Add nil, nil, nil, nil at the end. */ |
| 7599 | i = menu_bar_items_index; | 7592 | i = menu_bar_items_index; |
| 7600 | if (i + 4 > XVECTOR (menu_bar_items_vector)->size) | 7593 | if (i + 4 > XVECTOR (menu_bar_items_vector)->size) |
| 7601 | { | 7594 | menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil); |
| 7602 | Lisp_Object tem; | ||
| 7603 | tem = Fmake_vector (make_number (2 * i), Qnil); | ||
| 7604 | bcopy (XVECTOR (menu_bar_items_vector)->contents, | ||
| 7605 | XVECTOR (tem)->contents, i * sizeof (Lisp_Object)); | ||
| 7606 | menu_bar_items_vector = tem; | ||
| 7607 | } | ||
| 7608 | /* Add this item. */ | 7595 | /* Add this item. */ |
| 7609 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; | 7596 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; |
| 7610 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; | 7597 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; |
| @@ -7676,14 +7663,7 @@ menu_bar_item (key, item, dummy1, dummy2) | |||
| 7676 | { | 7663 | { |
| 7677 | /* If vector is too small, get a bigger one. */ | 7664 | /* If vector is too small, get a bigger one. */ |
| 7678 | if (i + 4 > XVECTOR (menu_bar_items_vector)->size) | 7665 | if (i + 4 > XVECTOR (menu_bar_items_vector)->size) |
| 7679 | { | 7666 | menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil); |
| 7680 | Lisp_Object tem; | ||
| 7681 | tem = Fmake_vector (make_number (2 * i), Qnil); | ||
| 7682 | bcopy (XVECTOR (menu_bar_items_vector)->contents, | ||
| 7683 | XVECTOR (tem)->contents, i * sizeof (Lisp_Object)); | ||
| 7684 | menu_bar_items_vector = tem; | ||
| 7685 | } | ||
| 7686 | |||
| 7687 | /* Add this item. */ | 7667 | /* Add this item. */ |
| 7688 | XVECTOR (menu_bar_items_vector)->contents[i++] = key; | 7668 | XVECTOR (menu_bar_items_vector)->contents[i++] = key; |
| 7689 | XVECTOR (menu_bar_items_vector)->contents[i++] | 7669 | XVECTOR (menu_bar_items_vector)->contents[i++] |
| @@ -8452,16 +8432,8 @@ append_tool_bar_item () | |||
| 8452 | /* Enlarge tool_bar_items_vector if necessary. */ | 8432 | /* Enlarge tool_bar_items_vector if necessary. */ |
| 8453 | if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS | 8433 | if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS |
| 8454 | >= XVECTOR (tool_bar_items_vector)->size) | 8434 | >= XVECTOR (tool_bar_items_vector)->size) |
| 8455 | { | 8435 | tool_bar_items_vector = larger_vector |
| 8456 | Lisp_Object new_vector; | 8436 | (tool_bar_items_vector, 2 * XVECTOR (tool_bar_items_vector)->size, Qnil); |
| 8457 | int old_size = XVECTOR (tool_bar_items_vector)->size; | ||
| 8458 | |||
| 8459 | new_vector = Fmake_vector (make_number (2 * old_size), Qnil); | ||
| 8460 | bcopy (XVECTOR (tool_bar_items_vector)->contents, | ||
| 8461 | XVECTOR (new_vector)->contents, | ||
| 8462 | old_size * sizeof (Lisp_Object)); | ||
| 8463 | tool_bar_items_vector = new_vector; | ||
| 8464 | } | ||
| 8465 | 8437 | ||
| 8466 | /* Append entries from tool_bar_item_properties to the end of | 8438 | /* Append entries from tool_bar_item_properties to the end of |
| 8467 | tool_bar_items_vector. */ | 8439 | tool_bar_items_vector. */ |