diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/xfns.c b/src/xfns.c index e11fbcf52c8..bc704cc15f3 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -599,7 +599,8 @@ x_create_bitmap_from_file (f, file) | |||
| 599 | id = x_allocate_bitmap_record (f); | 599 | id = x_allocate_bitmap_record (f); |
| 600 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 600 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 601 | dpyinfo->bitmaps[id - 1].refcount = 1; | 601 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 602 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); | 602 | dpyinfo->bitmaps[id - 1].file |
| 603 | = (char *) xmalloc (XSTRING (file)->size_byte + 1); | ||
| 603 | dpyinfo->bitmaps[id - 1].depth = 1; | 604 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 604 | dpyinfo->bitmaps[id - 1].height = height; | 605 | dpyinfo->bitmaps[id - 1].height = height; |
| 605 | dpyinfo->bitmaps[id - 1].width = width; | 606 | dpyinfo->bitmaps[id - 1].width = width; |
| @@ -1822,14 +1823,14 @@ x_set_name (f, name, explicit) | |||
| 1822 | text.value = XSTRING (name)->data; | 1823 | text.value = XSTRING (name)->data; |
| 1823 | text.encoding = XA_STRING; | 1824 | text.encoding = XA_STRING; |
| 1824 | text.format = 8; | 1825 | text.format = 8; |
| 1825 | text.nitems = XSTRING (name)->size; | 1826 | text.nitems = XSTRING (name)->size_byte; |
| 1826 | 1827 | ||
| 1827 | icon_name = (!NILP (f->icon_name) ? f->icon_name : name); | 1828 | icon_name = (!NILP (f->icon_name) ? f->icon_name : name); |
| 1828 | 1829 | ||
| 1829 | icon.value = XSTRING (icon_name)->data; | 1830 | icon.value = XSTRING (icon_name)->data; |
| 1830 | icon.encoding = XA_STRING; | 1831 | icon.encoding = XA_STRING; |
| 1831 | icon.format = 8; | 1832 | icon.format = 8; |
| 1832 | icon.nitems = XSTRING (icon_name)->size; | 1833 | icon.nitems = XSTRING (icon_name)->size_byte; |
| 1833 | #ifdef USE_X_TOOLKIT | 1834 | #ifdef USE_X_TOOLKIT |
| 1834 | XSetWMName (FRAME_X_DISPLAY (f), | 1835 | XSetWMName (FRAME_X_DISPLAY (f), |
| 1835 | XtWindow (f->output_data.x->widget), &text); | 1836 | XtWindow (f->output_data.x->widget), &text); |
| @@ -1912,14 +1913,14 @@ x_set_title (f, name) | |||
| 1912 | text.value = XSTRING (name)->data; | 1913 | text.value = XSTRING (name)->data; |
| 1913 | text.encoding = XA_STRING; | 1914 | text.encoding = XA_STRING; |
| 1914 | text.format = 8; | 1915 | text.format = 8; |
| 1915 | text.nitems = XSTRING (name)->size; | 1916 | text.nitems = XSTRING (name)->size_byte; |
| 1916 | 1917 | ||
| 1917 | icon_name = (!NILP (f->icon_name) ? f->icon_name : name); | 1918 | icon_name = (!NILP (f->icon_name) ? f->icon_name : name); |
| 1918 | 1919 | ||
| 1919 | icon.value = XSTRING (icon_name)->data; | 1920 | icon.value = XSTRING (icon_name)->data; |
| 1920 | icon.encoding = XA_STRING; | 1921 | icon.encoding = XA_STRING; |
| 1921 | icon.format = 8; | 1922 | icon.format = 8; |
| 1922 | icon.nitems = XSTRING (icon_name)->size; | 1923 | icon.nitems = XSTRING (icon_name)->size_byte; |
| 1923 | #ifdef USE_X_TOOLKIT | 1924 | #ifdef USE_X_TOOLKIT |
| 1924 | XSetWMName (FRAME_X_DISPLAY (f), | 1925 | XSetWMName (FRAME_X_DISPLAY (f), |
| 1925 | XtWindow (f->output_data.x->widget), &text); | 1926 | XtWindow (f->output_data.x->widget), &text); |
| @@ -2049,7 +2050,7 @@ validate_x_resource_name () | |||
| 2049 | unsigned char *p = XSTRING (Vx_resource_name)->data; | 2050 | unsigned char *p = XSTRING (Vx_resource_name)->data; |
| 2050 | int i; | 2051 | int i; |
| 2051 | 2052 | ||
| 2052 | len = XSTRING (Vx_resource_name)->size; | 2053 | len = XSTRING (Vx_resource_name)->size_byte; |
| 2053 | 2054 | ||
| 2054 | /* Only letters, digits, - and _ are valid in resource names. | 2055 | /* Only letters, digits, - and _ are valid in resource names. |
| 2055 | Count the valid characters and count the invalid ones. */ | 2056 | Count the valid characters and count the invalid ones. */ |
| @@ -2133,16 +2134,16 @@ and the class is `Emacs.CLASS.SUBCLASS'.") | |||
| 2133 | 2134 | ||
| 2134 | /* Allocate space for the components, the dots which separate them, | 2135 | /* Allocate space for the components, the dots which separate them, |
| 2135 | and the final '\0'. Make them big enough for the worst case. */ | 2136 | and the final '\0'. Make them big enough for the worst case. */ |
| 2136 | name_key = (char *) alloca (XSTRING (Vx_resource_name)->size | 2137 | name_key = (char *) alloca (XSTRING (Vx_resource_name)->size_byte |
| 2137 | + (STRINGP (component) | 2138 | + (STRINGP (component) |
| 2138 | ? XSTRING (component)->size : 0) | 2139 | ? XSTRING (component)->size_byte : 0) |
| 2139 | + XSTRING (attribute)->size | 2140 | + XSTRING (attribute)->size_byte |
| 2140 | + 3); | 2141 | + 3); |
| 2141 | 2142 | ||
| 2142 | class_key = (char *) alloca (XSTRING (Vx_resource_class)->size | 2143 | class_key = (char *) alloca (XSTRING (Vx_resource_class)->size_byte |
| 2143 | + XSTRING (class)->size | 2144 | + XSTRING (class)->size_byte |
| 2144 | + (STRINGP (subclass) | 2145 | + (STRINGP (subclass) |
| 2145 | ? XSTRING (subclass)->size : 0) | 2146 | ? XSTRING (subclass)->size_byte : 0) |
| 2146 | + 3); | 2147 | + 3); |
| 2147 | 2148 | ||
| 2148 | /* Start with emacs.FRAMENAME for the name (the specific one) | 2149 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| @@ -2201,16 +2202,16 @@ display_x_get_resource (dpyinfo, attribute, class, component, subclass) | |||
| 2201 | 2202 | ||
| 2202 | /* Allocate space for the components, the dots which separate them, | 2203 | /* Allocate space for the components, the dots which separate them, |
| 2203 | and the final '\0'. Make them big enough for the worst case. */ | 2204 | and the final '\0'. Make them big enough for the worst case. */ |
| 2204 | name_key = (char *) alloca (XSTRING (Vx_resource_name)->size | 2205 | name_key = (char *) alloca (XSTRING (Vx_resource_name)->size_byte |
| 2205 | + (STRINGP (component) | 2206 | + (STRINGP (component) |
| 2206 | ? XSTRING (component)->size : 0) | 2207 | ? XSTRING (component)->size_byte : 0) |
| 2207 | + XSTRING (attribute)->size | 2208 | + XSTRING (attribute)->size_byte |
| 2208 | + 3); | 2209 | + 3); |
| 2209 | 2210 | ||
| 2210 | class_key = (char *) alloca (XSTRING (Vx_resource_class)->size | 2211 | class_key = (char *) alloca (XSTRING (Vx_resource_class)->size_byte |
| 2211 | + XSTRING (class)->size | 2212 | + XSTRING (class)->size_byte |
| 2212 | + (STRINGP (subclass) | 2213 | + (STRINGP (subclass) |
| 2213 | ? XSTRING (subclass)->size : 0) | 2214 | ? XSTRING (subclass)->size_byte : 0) |
| 2214 | + 3); | 2215 | + 3); |
| 2215 | 2216 | ||
| 2216 | /* Start with emacs.FRAMENAME for the name (the specific one) | 2217 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| @@ -2253,7 +2254,7 @@ x_get_resource_string (attribute, class) | |||
| 2253 | 2254 | ||
| 2254 | /* Allocate space for the components, the dots which separate them, | 2255 | /* Allocate space for the components, the dots which separate them, |
| 2255 | and the final '\0'. */ | 2256 | and the final '\0'. */ |
| 2256 | name_key = (char *) alloca (XSTRING (Vinvocation_name)->size | 2257 | name_key = (char *) alloca (XSTRING (Vinvocation_name)->size_byte |
| 2257 | + strlen (attribute) + 2); | 2258 | + strlen (attribute) + 2); |
| 2258 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 2259 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 2259 | + strlen (class) + 2); | 2260 | + strlen (class) + 2); |
| @@ -4870,7 +4871,7 @@ also be depressed for NEWSTRING to appear.") | |||
| 4870 | 4871 | ||
| 4871 | if (NILP (modifiers)) | 4872 | if (NILP (modifiers)) |
| 4872 | XRebindKeysym (x_current_display, keysym, modifier_list, 0, | 4873 | XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
| 4873 | XSTRING (newstring)->data, XSTRING (newstring)->size); | 4874 | XSTRING (newstring)->data, XSTRING (newstring)->size_byte); |
| 4874 | else | 4875 | else |
| 4875 | { | 4876 | { |
| 4876 | register Lisp_Object rest, mod; | 4877 | register Lisp_Object rest, mod; |
| @@ -4898,7 +4899,7 @@ also be depressed for NEWSTRING to appear.") | |||
| 4898 | } | 4899 | } |
| 4899 | 4900 | ||
| 4900 | XRebindKeysym (x_current_display, keysym, modifier_list, i, | 4901 | XRebindKeysym (x_current_display, keysym, modifier_list, i, |
| 4901 | XSTRING (newstring)->data, XSTRING (newstring)->size); | 4902 | XSTRING (newstring)->data, XSTRING (newstring)->size_byte); |
| 4902 | } | 4903 | } |
| 4903 | 4904 | ||
| 4904 | return Qnil; | 4905 | return Qnil; |
| @@ -4929,7 +4930,7 @@ See the documentation of `x-rebind-key' for more information.") | |||
| 4929 | if (!NILP (item)) | 4930 | if (!NILP (item)) |
| 4930 | { | 4931 | { |
| 4931 | CHECK_STRING (item, 2); | 4932 | CHECK_STRING (item, 2); |
| 4932 | strsize = XSTRING (item)->size; | 4933 | strsize = XSTRING (item)->size_byte; |
| 4933 | rawstring = (unsigned char *) xmalloc (strsize); | 4934 | rawstring = (unsigned char *) xmalloc (strsize); |
| 4934 | bcopy (XSTRING (item)->data, rawstring, strsize); | 4935 | bcopy (XSTRING (item)->data, rawstring, strsize); |
| 4935 | modifier[1] = 1 << i; | 4936 | modifier[1] = 1 << i; |