diff options
| author | Juanma Barranquero | 2010-07-20 22:21:03 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2010-07-20 22:21:03 +0200 |
| commit | 7c3320d8b9d3beaf952b20cfe1843181c1c7af65 (patch) | |
| tree | 188ab3f0c3582c2890365bd92939e32a6b01d44c /src | |
| parent | af4b9ae58662d50080a7661631ce6861dc6b6aa9 (diff) | |
| download | emacs-7c3320d8b9d3beaf952b20cfe1843181c1c7af65.tar.gz emacs-7c3320d8b9d3beaf952b20cfe1843181c1c7af65.zip | |
Convert some more functions to standard C.
* lib-src/emacsclient.c (get_current_dir_name, w32_get_resource)
(w32_getenv, w32_set_user_model_id, w32_window_app, w32_execvp)
(close_winsock, initialize_sockets, w32_find_emacs_process)
(w32_give_focus):
* lib-src/ntlib.c (getlogin, getuid, getgid, getegid):
* nt/addpm.c (add_registry, main):
* nt/cmdproxy.c (get_env_size):
* nt/ddeclient.c (main):
* nt/runemacs.c (set_user_model_id):
* src/alloc.c (emacs_blocked_free, emacs_blocked_malloc)
(emacs_blocked_realloc, uninterrupt_malloc):
* src/fringe.c (w32_reset_fringes):
* src/image.c (convert_mono_to_color_image, lookup_rgb_color)
(init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper):
* src/sound.c (be2hs, do_play_sound):
* src/vm-limit.c (get_lim_data, ret_lim_data):
* src/w32term.c (x_free_frame_resources):
* src/xfaces.c (x_create_gc, x_free_gc):
Convert definitions to standard C.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/alloc.c | 15 | ||||
| -rw-r--r-- | src/fringe.c | 2 | ||||
| -rw-r--r-- | src/image.c | 21 | ||||
| -rw-r--r-- | src/sound.c | 10 | ||||
| -rw-r--r-- | src/vm-limit.c | 12 | ||||
| -rw-r--r-- | src/w32term.c | 3 | ||||
| -rw-r--r-- | src/xfaces.c | 9 |
8 files changed, 37 insertions, 48 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 81b4560e06d..414f22d3bfd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2010-07-20 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * alloc.c (emacs_blocked_free, emacs_blocked_malloc) | ||
| 4 | (emacs_blocked_realloc, uninterrupt_malloc): | ||
| 5 | * fringe.c (w32_reset_fringes): | ||
| 6 | * image.c (convert_mono_to_color_image, lookup_rgb_color) | ||
| 7 | (init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper): | ||
| 8 | * sound.c (be2hs, do_play_sound): | ||
| 9 | * vm-limit.c (get_lim_data, ret_lim_data): | ||
| 10 | * w32term.c (x_free_frame_resources): | ||
| 11 | * xfaces.c (x_create_gc, x_free_gc): | ||
| 12 | Convert definitions to standard C. | ||
| 13 | |||
| 1 | 2010-07-20 Stefan Monnier <monnier@iro.umontreal.ca> | 14 | 2010-07-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 15 | ||
| 3 | * eval.c (Feval, Ffuncall): Use the new names. | 16 | * eval.c (Feval, Ffuncall): Use the new names. |
diff --git a/src/alloc.c b/src/alloc.c index 5c860bc1f8e..2ce74f97ff7 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1161,9 +1161,7 @@ static void (*old_free_hook) (void*, const void*); | |||
| 1161 | /* This function is used as the hook for free to call. */ | 1161 | /* This function is used as the hook for free to call. */ |
| 1162 | 1162 | ||
| 1163 | static void | 1163 | static void |
| 1164 | emacs_blocked_free (ptr, ptr2) | 1164 | emacs_blocked_free (void *ptr, const void *ptr2) |
| 1165 | void *ptr; | ||
| 1166 | const void *ptr2; | ||
| 1167 | { | 1165 | { |
| 1168 | BLOCK_INPUT_ALLOC; | 1166 | BLOCK_INPUT_ALLOC; |
| 1169 | 1167 | ||
| @@ -1211,9 +1209,7 @@ emacs_blocked_free (ptr, ptr2) | |||
| 1211 | /* This function is the malloc hook that Emacs uses. */ | 1209 | /* This function is the malloc hook that Emacs uses. */ |
| 1212 | 1210 | ||
| 1213 | static void * | 1211 | static void * |
| 1214 | emacs_blocked_malloc (size, ptr) | 1212 | emacs_blocked_malloc (size_t size, const void *ptr) |
| 1215 | size_t size; | ||
| 1216 | const void *ptr; | ||
| 1217 | { | 1213 | { |
| 1218 | void *value; | 1214 | void *value; |
| 1219 | 1215 | ||
| @@ -1260,10 +1256,7 @@ emacs_blocked_malloc (size, ptr) | |||
| 1260 | /* This function is the realloc hook that Emacs uses. */ | 1256 | /* This function is the realloc hook that Emacs uses. */ |
| 1261 | 1257 | ||
| 1262 | static void * | 1258 | static void * |
| 1263 | emacs_blocked_realloc (ptr, size, ptr2) | 1259 | emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2) |
| 1264 | void *ptr; | ||
| 1265 | size_t size; | ||
| 1266 | const void *ptr2; | ||
| 1267 | { | 1260 | { |
| 1268 | void *value; | 1261 | void *value; |
| 1269 | 1262 | ||
| @@ -1337,7 +1330,7 @@ reset_malloc_hooks () | |||
| 1337 | /* Called from main to set up malloc to use our hooks. */ | 1330 | /* Called from main to set up malloc to use our hooks. */ |
| 1338 | 1331 | ||
| 1339 | void | 1332 | void |
| 1340 | uninterrupt_malloc () | 1333 | uninterrupt_malloc (void) |
| 1341 | { | 1334 | { |
| 1342 | #ifdef HAVE_GTK_AND_PTHREAD | 1335 | #ifdef HAVE_GTK_AND_PTHREAD |
| 1343 | #ifdef DOUG_LEA_MALLOC | 1336 | #ifdef DOUG_LEA_MALLOC |
diff --git a/src/fringe.c b/src/fringe.c index cab3c6feabc..bfb2c217172 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -1836,7 +1836,7 @@ w32_init_fringe (struct redisplay_interface *rif) | |||
| 1836 | } | 1836 | } |
| 1837 | 1837 | ||
| 1838 | void | 1838 | void |
| 1839 | w32_reset_fringes () | 1839 | w32_reset_fringes (void) |
| 1840 | { | 1840 | { |
| 1841 | /* Destroy row bitmaps. */ | 1841 | /* Destroy row bitmaps. */ |
| 1842 | int bt; | 1842 | int bt; |
diff --git a/src/image.c b/src/image.c index 6e75921414b..d55d3ca0a6e 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2560,10 +2560,8 @@ w32_create_pixmap_from_bitmap_data (int width, int height, char *data) | |||
| 2560 | } | 2560 | } |
| 2561 | 2561 | ||
| 2562 | static void | 2562 | static void |
| 2563 | convert_mono_to_color_image (f, img, foreground, background) | 2563 | convert_mono_to_color_image (struct frame *f, struct image *img, |
| 2564 | struct frame *f; | 2564 | COLORREF foreground, COLORREF background) |
| 2565 | struct image *img; | ||
| 2566 | COLORREF foreground, background; | ||
| 2567 | { | 2565 | { |
| 2568 | HDC hdc, old_img_dc, new_img_dc; | 2566 | HDC hdc, old_img_dc, new_img_dc; |
| 2569 | HGDIOBJ old_prev, new_prev; | 2567 | HGDIOBJ old_prev, new_prev; |
| @@ -4357,9 +4355,7 @@ colors_in_color_table (int *n) | |||
| 4357 | #else /* COLOR_TABLE_SUPPORT */ | 4355 | #else /* COLOR_TABLE_SUPPORT */ |
| 4358 | 4356 | ||
| 4359 | static unsigned long | 4357 | static unsigned long |
| 4360 | lookup_rgb_color (f, r, g, b) | 4358 | lookup_rgb_color (struct frame *f, int r, int g, int b) |
| 4361 | struct frame *f; | ||
| 4362 | int r, g, b; | ||
| 4363 | { | 4359 | { |
| 4364 | unsigned long pixel; | 4360 | unsigned long pixel; |
| 4365 | 4361 | ||
| @@ -4374,7 +4370,7 @@ lookup_rgb_color (f, r, g, b) | |||
| 4374 | } | 4370 | } |
| 4375 | 4371 | ||
| 4376 | static void | 4372 | static void |
| 4377 | init_color_table () | 4373 | init_color_table (void) |
| 4378 | { | 4374 | { |
| 4379 | } | 4375 | } |
| 4380 | #endif /* COLOR_TABLE_SUPPORT */ | 4376 | #endif /* COLOR_TABLE_SUPPORT */ |
| @@ -4492,10 +4488,7 @@ x_to_xcolors (struct frame *f, struct image *img, int rgb_p) | |||
| 4492 | stored in ximg->data. */ | 4488 | stored in ximg->data. */ |
| 4493 | 4489 | ||
| 4494 | static void | 4490 | static void |
| 4495 | XPutPixel (ximg, x, y, color) | 4491 | XPutPixel (XImagePtr ximg, int x, int y, COLORREF color) |
| 4496 | XImagePtr ximg; | ||
| 4497 | int x, y; | ||
| 4498 | COLORREF color; | ||
| 4499 | { | 4492 | { |
| 4500 | int width = ximg->info.bmiHeader.biWidth; | 4493 | int width = ximg->info.bmiHeader.biWidth; |
| 4501 | int height = ximg->info.bmiHeader.biHeight; | 4494 | int height = ximg->info.bmiHeader.biHeight; |
| @@ -6071,9 +6064,7 @@ init_jpeg_functions (Lisp_Object libraries) | |||
| 6071 | /* Wrapper since we can't directly assign the function pointer | 6064 | /* Wrapper since we can't directly assign the function pointer |
| 6072 | to another function pointer that was declared more completely easily. */ | 6065 | to another function pointer that was declared more completely easily. */ |
| 6073 | static boolean | 6066 | static boolean |
| 6074 | jpeg_resync_to_restart_wrapper (cinfo, desired) | 6067 | jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired) |
| 6075 | j_decompress_ptr cinfo; | ||
| 6076 | int desired; | ||
| 6077 | { | 6068 | { |
| 6078 | return fn_jpeg_resync_to_restart (cinfo, desired); | 6069 | return fn_jpeg_resync_to_restart (cinfo, desired); |
| 6079 | } | 6070 | } |
diff --git a/src/sound.c b/src/sound.c index 2bf0b59ffd6..e0ebd565151 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -522,8 +522,7 @@ be2hl (u_int32_t value) | |||
| 522 | to host byte-order. */ | 522 | to host byte-order. */ |
| 523 | 523 | ||
| 524 | static u_int16_t | 524 | static u_int16_t |
| 525 | be2hs (value) | 525 | be2hs (u_int16_t value) |
| 526 | u_int16_t value; | ||
| 527 | { | 526 | { |
| 528 | #ifndef WORDS_BIG_ENDIAN | 527 | #ifndef WORDS_BIG_ENDIAN |
| 529 | unsigned char *p = (unsigned char *) &value; | 528 | unsigned char *p = (unsigned char *) &value; |
| @@ -1209,7 +1208,8 @@ alsa_write (struct sound_device *sd, const char *buffer, int nbytes) | |||
| 1209 | } | 1208 | } |
| 1210 | 1209 | ||
| 1211 | static void | 1210 | static void |
| 1212 | snd_error_quiet (const char *file, int line, const char *function, int err, const char *fmt) | 1211 | snd_error_quiet (const char *file, int line, const char *function, int err, |
| 1212 | const char *fmt) | ||
| 1213 | { | 1213 | { |
| 1214 | } | 1214 | } |
| 1215 | 1215 | ||
| @@ -1266,9 +1266,7 @@ alsa_init (struct sound_device *sd) | |||
| 1266 | } | 1266 | } |
| 1267 | 1267 | ||
| 1268 | static int | 1268 | static int |
| 1269 | do_play_sound (psz_file, ui_volume) | 1269 | do_play_sound (const char *psz_file, unsigned long ui_volume) |
| 1270 | const char *psz_file; | ||
| 1271 | unsigned long ui_volume; | ||
| 1272 | { | 1270 | { |
| 1273 | int i_result = 0; | 1271 | int i_result = 0; |
| 1274 | MCIERROR mci_error = 0; | 1272 | MCIERROR mci_error = 0; |
diff --git a/src/vm-limit.c b/src/vm-limit.c index aca0e0afb47..b288276f394 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c | |||
| @@ -69,7 +69,7 @@ get_lim_data (void) | |||
| 69 | #ifdef USG | 69 | #ifdef USG |
| 70 | 70 | ||
| 71 | static void | 71 | static void |
| 72 | get_lim_data () | 72 | get_lim_data (void) |
| 73 | { | 73 | { |
| 74 | extern long ulimit (); | 74 | extern long ulimit (); |
| 75 | 75 | ||
| @@ -93,7 +93,7 @@ get_lim_data () | |||
| 93 | #ifdef WINDOWSNT | 93 | #ifdef WINDOWSNT |
| 94 | 94 | ||
| 95 | static void | 95 | static void |
| 96 | get_lim_data () | 96 | get_lim_data (void) |
| 97 | { | 97 | { |
| 98 | extern unsigned long reserved_heap_size; | 98 | extern unsigned long reserved_heap_size; |
| 99 | lim_data = reserved_heap_size; | 99 | lim_data = reserved_heap_size; |
| @@ -104,7 +104,7 @@ get_lim_data () | |||
| 104 | 104 | ||
| 105 | #ifdef MSDOS | 105 | #ifdef MSDOS |
| 106 | void | 106 | void |
| 107 | get_lim_data () | 107 | get_lim_data (void) |
| 108 | { | 108 | { |
| 109 | _go32_dpmi_meminfo info; | 109 | _go32_dpmi_meminfo info; |
| 110 | unsigned long lim1, lim2; | 110 | unsigned long lim1, lim2; |
| @@ -135,14 +135,14 @@ get_lim_data () | |||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | unsigned long | 137 | unsigned long |
| 138 | ret_lim_data () | 138 | ret_lim_data (void) |
| 139 | { | 139 | { |
| 140 | get_lim_data (); | 140 | get_lim_data (); |
| 141 | return lim_data; | 141 | return lim_data; |
| 142 | } | 142 | } |
| 143 | #else /* not MSDOS */ | 143 | #else /* not MSDOS */ |
| 144 | static void | 144 | static void |
| 145 | get_lim_data () | 145 | get_lim_data (void) |
| 146 | { | 146 | { |
| 147 | lim_data = vlimit (LIM_DATA, -1); | 147 | lim_data = vlimit (LIM_DATA, -1); |
| 148 | } | 148 | } |
| @@ -151,7 +151,7 @@ get_lim_data () | |||
| 151 | #else /* BSD4_2 */ | 151 | #else /* BSD4_2 */ |
| 152 | 152 | ||
| 153 | static void | 153 | static void |
| 154 | get_lim_data () | 154 | get_lim_data (void) |
| 155 | { | 155 | { |
| 156 | struct rlimit XXrlimit; | 156 | struct rlimit XXrlimit; |
| 157 | 157 | ||
diff --git a/src/w32term.c b/src/w32term.c index 9db533eb5e9..3a0a1b1abae 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5694,8 +5694,7 @@ x_iconify_frame (struct frame *f) | |||
| 5694 | /* Free X resources of frame F. */ | 5694 | /* Free X resources of frame F. */ |
| 5695 | 5695 | ||
| 5696 | void | 5696 | void |
| 5697 | x_free_frame_resources (f) | 5697 | x_free_frame_resources (struct frame *f) |
| 5698 | struct frame *f; | ||
| 5699 | { | 5698 | { |
| 5700 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | 5699 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
| 5701 | 5700 | ||
diff --git a/src/xfaces.c b/src/xfaces.c index ea0f57469e1..d5aabd40c0c 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -726,10 +726,7 @@ x_free_gc (struct frame *f, GC gc) | |||
| 726 | /* W32 emulation of GCs */ | 726 | /* W32 emulation of GCs */ |
| 727 | 727 | ||
| 728 | static INLINE GC | 728 | static INLINE GC |
| 729 | x_create_gc (f, mask, xgcv) | 729 | x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv) |
| 730 | struct frame *f; | ||
| 731 | unsigned long mask; | ||
| 732 | XGCValues *xgcv; | ||
| 733 | { | 730 | { |
| 734 | GC gc; | 731 | GC gc; |
| 735 | BLOCK_INPUT; | 732 | BLOCK_INPUT; |
| @@ -743,9 +740,7 @@ x_create_gc (f, mask, xgcv) | |||
| 743 | /* Free GC which was used on frame F. */ | 740 | /* Free GC which was used on frame F. */ |
| 744 | 741 | ||
| 745 | static INLINE void | 742 | static INLINE void |
| 746 | x_free_gc (f, gc) | 743 | x_free_gc (struct frame *f, GC gc) |
| 747 | struct frame *f; | ||
| 748 | GC gc; | ||
| 749 | { | 744 | { |
| 750 | IF_DEBUG (xassert (--ngcs >= 0)); | 745 | IF_DEBUG (xassert (--ngcs >= 0)); |
| 751 | xfree (gc); | 746 | xfree (gc); |