diff options
| author | Dmitry Antipov | 2013-08-14 20:36:16 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-14 20:36:16 +0400 |
| commit | 5b71542de3ef7f08b7c30e93340502d7cc120910 (patch) | |
| tree | dfb9bee6c19bf4467852500cf6b53771652e3d84 /src/image.c | |
| parent | d48d97ee4ab07e0c3e8c1a63efcfb707eef1b352 (diff) | |
| download | emacs-5b71542de3ef7f08b7c30e93340502d7cc120910.tar.gz emacs-5b71542de3ef7f08b7c30e93340502d7cc120910.zip | |
Utility function and macro to copy Lisp string to C string.
* lisp.h (xlispstrdupa): New macro.
(xlispstrdup): New prototype.
* alloc.c (xlispstrdup): New function.
* callint.c (Fcall_interactively):
* fileio.c (Ffile_name_directory, Fexpand_file_name)
(Fsubstitute_in_file_name):
* frame.c (Fmake_terminal_frame): Use xlispstrdupa.
* image.c (x_create_bitmap_from_file):
* w32term.c (w32_term_init):
* xterm.c (x_term_init): Use xlispstrdup.
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/image.c b/src/image.c index b2d6726c1a4..f71ba211d44 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -302,11 +302,10 @@ x_create_bitmap_from_file (struct frame *f, Lisp_Object file) | |||
| 302 | id = x_allocate_bitmap_record (f); | 302 | id = x_allocate_bitmap_record (f); |
| 303 | dpyinfo->bitmaps[id - 1].img = bitmap; | 303 | dpyinfo->bitmaps[id - 1].img = bitmap; |
| 304 | dpyinfo->bitmaps[id - 1].refcount = 1; | 304 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 305 | dpyinfo->bitmaps[id - 1].file = xmalloc (SBYTES (file) + 1); | 305 | dpyinfo->bitmaps[id - 1].file = xlispstrdup (file); |
| 306 | dpyinfo->bitmaps[id - 1].depth = 1; | 306 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 307 | dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap); | 307 | dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap); |
| 308 | dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap); | 308 | dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap); |
| 309 | strcpy (dpyinfo->bitmaps[id - 1].file, SSDATA (file)); | ||
| 310 | return id; | 309 | return id; |
| 311 | #endif | 310 | #endif |
| 312 | 311 | ||
| @@ -345,11 +344,10 @@ x_create_bitmap_from_file (struct frame *f, Lisp_Object file) | |||
| 345 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 344 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 346 | dpyinfo->bitmaps[id - 1].have_mask = 0; | 345 | dpyinfo->bitmaps[id - 1].have_mask = 0; |
| 347 | dpyinfo->bitmaps[id - 1].refcount = 1; | 346 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 348 | dpyinfo->bitmaps[id - 1].file = xmalloc (SBYTES (file) + 1); | 347 | dpyinfo->bitmaps[id - 1].file = xlispstrdup (file); |
| 349 | dpyinfo->bitmaps[id - 1].depth = 1; | 348 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 350 | dpyinfo->bitmaps[id - 1].height = height; | 349 | dpyinfo->bitmaps[id - 1].height = height; |
| 351 | dpyinfo->bitmaps[id - 1].width = width; | 350 | dpyinfo->bitmaps[id - 1].width = width; |
| 352 | strcpy (dpyinfo->bitmaps[id - 1].file, SSDATA (file)); | ||
| 353 | 351 | ||
| 354 | return id; | 352 | return id; |
| 355 | #endif /* HAVE_X_WINDOWS */ | 353 | #endif /* HAVE_X_WINDOWS */ |