diff options
| author | Jan D | 2010-08-06 12:12:41 +0200 |
|---|---|---|
| committer | Jan D | 2010-08-06 12:12:41 +0200 |
| commit | 3d608a86503ae057e0d2e721a9d9718eae22bf89 (patch) | |
| tree | 01ae2c34b91e9357f41bda331a8ed4e3422683bf /src/image.c | |
| parent | 0613f5d515c2f7fe7930ad5f7d3e177e1fd3b44c (diff) | |
| download | emacs-3d608a86503ae057e0d2e721a9d9718eae22bf89.tar.gz emacs-3d608a86503ae057e0d2e721a9d9718eae22bf89.zip | |
Fix missing prototypes for HAVE_NS (caused crash) and vrious warnings.
* configure.in: Check for util.h.
* src/bidi.c (bidi_dump_cached_states): Fix fprintf warning.
* src/emacs.c: Include src/nsterm.h if HAVE_NS.
* src/image.c (xpm_scan, xpm_make_color_table_v)
(xpm_put_color_table_v, xpm_get_color_table_v)
(xpm_make_color_table_h, xpm_put_color_table_h)
(xpm_get_color_table_h, xpm_str_to_color_key, xpm_load_image)
(xpm_load): Convert to ANSI C prototypes.
* src/lisp.h (fmod_float): Declare.
* src/menu.h (x_set_menu_bar_line): Declare.
(free_menubar_widget_value_tree et.al): Add HAVE_NS for these functions.
* src/window.c: Include menu.h.
* src/nsfns.m (have_menus_p, ns_display_info_for_name)
(x_set_cursor_type, ns_appkit_version_str)
(ns_appkit_version_int, ns_do_applescript)
(x_set_scroll_bar_default_width, x_sync, compute_tip_xy)
(syms_of_nsfns): Convert to ANSI C prototypes.
* src/nsfont.m (ns_fallback_entity, syms_of_nsfont): Convert to ANSI C
prototypes.
* src/nsimage.m (ns_load_image): Move NSTRACE after declarations.
* src/nsmenu.m (popup_activated, name_is_separator)
(syms_of_nsmenu): Convert to ANSI C prototypes.
(runMenuAt): Prototypes and move declarations before code.
* src/nsterm.h : Include sysselect.h.
(x_sync, x_get_focus_frame, x_set_mouse_position)
(x_set_mouse_pixel_position, x_make_frame_visible)
(x_make_frame_invisible, x_iconify_frame, x_char_width, x_char_height)
(x_pixel_width, x_pixel_height, x_set_frame_alpha, x_set_tool_bar_lines)
(x_activate_menubar, free_frame_menubar, ns_init_paths, ns_select)
(syms_of_nsterm, syms_of_nsfns, syms_of_nsmenu, syms_of_nsselect):
Declare
* src/process.c: Check HAVE_UTIL_H. Include src/nsterm.h if HAVE_NS.
* src/nsterm.m (ns_init_paths, ns_alloc_autorelease_pool)
(ns_ring_bell, ns_defined_color, hide_hourglass)
(x_display_pixel_height, x_display_pixel_width, syms_of_nsterm):
Convert to ANSI C prototypes.
(x_set_window_size, ns_draw_fringe_bitmap, judge): Move declarations
before code.
* src/sysdep.c: Check HAVE_TERM_H
* src/term.c: Check HAVE_SYS_IOCTL_H.
* src/unexmacosx.c (print_region_list, print_regions)
(build_region_list, find_emacs_zone_regions)
(unexec_regions_merge, read_load_commands, dump_it)
(unexec_init_emacs_zone): Convert to ANSI C prototypes.
* src/xfaces.c (x_create_gc, x_free_gc): Convert to ANSI C prototypes.
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/src/image.c b/src/image.c index f6282f6619b..2b8eb1830bc 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -3658,9 +3658,10 @@ enum xpm_token | |||
| 3658 | length of the corresponding token, respectively. */ | 3658 | length of the corresponding token, respectively. */ |
| 3659 | 3659 | ||
| 3660 | static int | 3660 | static int |
| 3661 | xpm_scan (s, end, beg, len) | 3661 | xpm_scan (const unsigned char **s, |
| 3662 | const unsigned char **s, *end, **beg; | 3662 | const unsigned char *end, |
| 3663 | int *len; | 3663 | const unsigned char **beg, |
| 3664 | int *len) | ||
| 3664 | { | 3665 | { |
| 3665 | int c; | 3666 | int c; |
| 3666 | 3667 | ||
| @@ -3724,9 +3725,13 @@ xpm_scan (s, end, beg, len) | |||
| 3724 | hash table is used. */ | 3725 | hash table is used. */ |
| 3725 | 3726 | ||
| 3726 | static Lisp_Object | 3727 | static Lisp_Object |
| 3727 | xpm_make_color_table_v (put_func, get_func) | 3728 | xpm_make_color_table_v (void (**put_func) (Lisp_Object, |
| 3728 | void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object); | 3729 | const unsigned char *, |
| 3729 | Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int); | 3730 | int, |
| 3731 | Lisp_Object), | ||
| 3732 | Lisp_Object (**get_func) (Lisp_Object, | ||
| 3733 | const unsigned char *, | ||
| 3734 | int)) | ||
| 3730 | { | 3735 | { |
| 3731 | *put_func = xpm_put_color_table_v; | 3736 | *put_func = xpm_put_color_table_v; |
| 3732 | *get_func = xpm_get_color_table_v; | 3737 | *get_func = xpm_get_color_table_v; |
| @@ -3734,28 +3739,30 @@ xpm_make_color_table_v (put_func, get_func) | |||
| 3734 | } | 3739 | } |
| 3735 | 3740 | ||
| 3736 | static void | 3741 | static void |
| 3737 | xpm_put_color_table_v (color_table, chars_start, chars_len, color) | 3742 | xpm_put_color_table_v (Lisp_Object color_table, |
| 3738 | Lisp_Object color_table; | 3743 | const unsigned char *chars_start, |
| 3739 | const unsigned char *chars_start; | 3744 | int chars_len, |
| 3740 | int chars_len; | 3745 | Lisp_Object color) |
| 3741 | Lisp_Object color; | ||
| 3742 | { | 3746 | { |
| 3743 | XVECTOR (color_table)->contents[*chars_start] = color; | 3747 | XVECTOR (color_table)->contents[*chars_start] = color; |
| 3744 | } | 3748 | } |
| 3745 | 3749 | ||
| 3746 | static Lisp_Object | 3750 | static Lisp_Object |
| 3747 | xpm_get_color_table_v (color_table, chars_start, chars_len) | 3751 | xpm_get_color_table_v (Lisp_Object color_table, |
| 3748 | Lisp_Object color_table; | 3752 | const unsigned char *chars_start, |
| 3749 | const unsigned char *chars_start; | 3753 | int chars_len) |
| 3750 | int chars_len; | ||
| 3751 | { | 3754 | { |
| 3752 | return XVECTOR (color_table)->contents[*chars_start]; | 3755 | return XVECTOR (color_table)->contents[*chars_start]; |
| 3753 | } | 3756 | } |
| 3754 | 3757 | ||
| 3755 | static Lisp_Object | 3758 | static Lisp_Object |
| 3756 | xpm_make_color_table_h (put_func, get_func) | 3759 | xpm_make_color_table_h (void (**put_func) (Lisp_Object, |
| 3757 | void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object); | 3760 | const unsigned char *, |
| 3758 | Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int); | 3761 | int, |
| 3762 | Lisp_Object), | ||
| 3763 | Lisp_Object (**get_func) (Lisp_Object, | ||
| 3764 | const unsigned char *, | ||
| 3765 | int)) | ||
| 3759 | { | 3766 | { |
| 3760 | *put_func = xpm_put_color_table_h; | 3767 | *put_func = xpm_put_color_table_h; |
| 3761 | *get_func = xpm_get_color_table_h; | 3768 | *get_func = xpm_get_color_table_h; |
| @@ -3766,11 +3773,10 @@ xpm_make_color_table_h (put_func, get_func) | |||
| 3766 | } | 3773 | } |
| 3767 | 3774 | ||
| 3768 | static void | 3775 | static void |
| 3769 | xpm_put_color_table_h (color_table, chars_start, chars_len, color) | 3776 | xpm_put_color_table_h (Lisp_Object color_table, |
| 3770 | Lisp_Object color_table; | 3777 | const unsigned char *chars_start, |
| 3771 | const unsigned char *chars_start; | 3778 | int chars_len, |
| 3772 | int chars_len; | 3779 | Lisp_Object color) |
| 3773 | Lisp_Object color; | ||
| 3774 | { | 3780 | { |
| 3775 | struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); | 3781 | struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); |
| 3776 | unsigned hash_code; | 3782 | unsigned hash_code; |
| @@ -3781,10 +3787,9 @@ xpm_put_color_table_h (color_table, chars_start, chars_len, color) | |||
| 3781 | } | 3787 | } |
| 3782 | 3788 | ||
| 3783 | static Lisp_Object | 3789 | static Lisp_Object |
| 3784 | xpm_get_color_table_h (color_table, chars_start, chars_len) | 3790 | xpm_get_color_table_h (Lisp_Object color_table, |
| 3785 | Lisp_Object color_table; | 3791 | const unsigned char *chars_start, |
| 3786 | const unsigned char *chars_start; | 3792 | int chars_len) |
| 3787 | int chars_len; | ||
| 3788 | { | 3793 | { |
| 3789 | struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); | 3794 | struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); |
| 3790 | int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len), | 3795 | int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len), |
| @@ -3804,8 +3809,7 @@ enum xpm_color_key { | |||
| 3804 | static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"}; | 3809 | static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"}; |
| 3805 | 3810 | ||
| 3806 | static int | 3811 | static int |
| 3807 | xpm_str_to_color_key (s) | 3812 | xpm_str_to_color_key (const char *s) |
| 3808 | const char *s; | ||
| 3809 | { | 3813 | { |
| 3810 | int i; | 3814 | int i; |
| 3811 | 3815 | ||
| @@ -3818,10 +3822,10 @@ xpm_str_to_color_key (s) | |||
| 3818 | } | 3822 | } |
| 3819 | 3823 | ||
| 3820 | static int | 3824 | static int |
| 3821 | xpm_load_image (f, img, contents, end) | 3825 | xpm_load_image (struct frame *f, |
| 3822 | struct frame *f; | 3826 | struct image *img, |
| 3823 | struct image *img; | 3827 | const unsigned char *contents, |
| 3824 | const unsigned char *contents, *end; | 3828 | const unsigned char *end) |
| 3825 | { | 3829 | { |
| 3826 | const unsigned char *s = contents, *beg, *str; | 3830 | const unsigned char *s = contents, *beg, *str; |
| 3827 | unsigned char buffer[BUFSIZ]; | 3831 | unsigned char buffer[BUFSIZ]; |
| @@ -4053,9 +4057,8 @@ xpm_load_image (f, img, contents, end) | |||
| 4053 | } | 4057 | } |
| 4054 | 4058 | ||
| 4055 | static int | 4059 | static int |
| 4056 | xpm_load (f, img) | 4060 | xpm_load (struct frame *f, |
| 4057 | struct frame *f; | 4061 | struct image *img) |
| 4058 | struct image *img; | ||
| 4059 | { | 4062 | { |
| 4060 | int success_p = 0; | 4063 | int success_p = 0; |
| 4061 | Lisp_Object file_name; | 4064 | Lisp_Object file_name; |