+2010-07-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * 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):
+ * ntlib.c (getlogin, getuid, getgid, getegid):
+ Convert definitions to standard C.
+
2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
* Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
Any other returned value must be freed with free. This is used
only when get_current_dir_name is not defined on the system. */
char*
-get_current_dir_name ()
+get_current_dir_name (void)
{
char *buf;
char *pwd;
Return NULL if the variable was not found, or it was empty.
This code is based on w32_get_resource (w32.c). */
char *
-w32_get_resource (predefined, key, type)
- HKEY predefined;
- char *key;
- LPDWORD type;
+w32_get_resource (HKEY predefined, char *key, LPDWORD type)
{
HKEY hrootkey = NULL;
char *result = NULL;
variables in the registry if they don't appear in the environment.
*/
char *
-w32_getenv (envvar)
- char *envvar;
+w32_getenv (char *envvar)
{
char *value;
DWORD dwType;
}
void
-w32_set_user_model_id ()
+w32_set_user_model_id (void)
{
HMODULE shell;
HRESULT (WINAPI * set_user_model) (wchar_t * id);
}
int
-w32_window_app ()
+w32_window_app (void)
{
static int window_app = -1;
char szTitle[MAX_PATH];
This is necessary due to the broken implementation of exec* routines in
the Microsoft libraries: they concatenate the arguments together without
quoting special characters, and pass the result to CreateProcess, with
- predictably bad results. By contrast, Posix execvp passes the arguments
+ predictably bad results. By contrast, POSIX execvp passes the arguments
directly into the argv array of the child process.
*/
int
-w32_execvp (path, argv)
- char *path;
- char **argv;
+w32_execvp (const char *path, char **argv)
{
int i;
#ifdef WINDOWSNT
/* Wrapper to make WSACleanup a cdecl, as required by atexit. */
-void
-__cdecl close_winsock ()
+void __cdecl
+close_winsock (void)
{
WSACleanup ();
}
/* Initialize the WinSock2 library. */
void
-initialize_sockets ()
+initialize_sockets (void)
{
WSADATA wsaData;
FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
BOOL CALLBACK
-w32_find_emacs_process (hWnd, lParam)
- HWND hWnd;
- LPARAM lParam;
+w32_find_emacs_process (HWND hWnd, LPARAM lParam)
{
DWORD pid;
char class[6];
* process id = emacs_pid. If found, allow it to grab the focus.
*/
void
-w32_give_focus ()
+w32_give_focus (void)
{
HANDLE user32;
would necessitate including windows.h in the files that used it.
This is much easier. */
void
-sleep(unsigned long seconds)
+sleep (unsigned long seconds)
{
Sleep (seconds * 1000);
}
static int getppid_ppid;
int
-getppid(void)
+getppid (void)
{
char *ppid;
DWORD result;
ppid = getenv ("EM_PARENT_PROCESS_ID");
if (!ppid)
{
- printf("no pid.\n");
+ printf ("no pid.\n");
return 0;
}
else
if (!getppid_parent)
{
- getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid));
+ getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi (ppid));
if (!getppid_parent)
{
printf ("Failed to open handle to parent process: %d\n",
- GetLastError());
+ GetLastError ());
exit (1);
}
}
return 1;
case WAIT_FAILED:
default:
- printf ("Checking parent status failed: %d\n", GetLastError());
+ printf ("Checking parent status failed: %d\n", GetLastError ());
exit (1);
}
}
char *
-getlogin ()
+getlogin (void)
{
static char user_name[256];
DWORD length = sizeof (user_name);
}
unsigned
-getuid ()
+getuid (void)
{
return 0;
}
unsigned
-getgid ()
+getgid (void)
{
return 0;
}
unsigned
-getegid ()
+getegid (void)
{
return 0;
}
}
FILE *
-sys_fopen(const char * path, const char * mode)
+sys_fopen (const char * path, const char * mode)
{
return fopen (path, mode);
}
+2010-07-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * addpm.c (add_registry, main):
+ * cmdproxy.c (get_env_size):
+ * ddeclient.c (main):
+ * runemacs.c (set_user_model_id):
+ Convert definitions to standard C.
+
2010-07-20 Juanma Barranquero <lekktu@gmail.com>
* gmake.defs (CHECKING_CFLAGS) [ENABLECHECKS]: Add -fno-crossjumping.
};
BOOL
-add_registry (path)
- char *path;
+add_registry (char *path)
{
HKEY hrootkey = NULL;
int i;
}
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
char start_folder[MAX_PATH + 1];
int shortcuts_created = 0;
if (SUCCEEDED (IPersistFile_Save (lnk, unicode_path, TRUE)))
shortcuts_created = 1;
IPersistFile_Release (lnk);
-
+
}
}
- }
+ }
}
if (com_available)
/* Return size of current environment block. */
int
-get_env_size ()
+get_env_size (void)
{
char * start = GetEnvironmentStrings ();
char * tmp = start;
CF_TEXT, XTYP_EXECUTE, 30000, NULL)
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
DWORD idDde = 0;
HCONV HConversation;
return 1;
}
-void set_user_model_id ()
+void
+set_user_model_id (void)
{
HMODULE shell;
HRESULT (WINAPI * set_user_model) (wchar_t * id);
+2010-07-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * alloc.c (emacs_blocked_free, emacs_blocked_malloc)
+ (emacs_blocked_realloc, uninterrupt_malloc):
+ * fringe.c (w32_reset_fringes):
+ * image.c (convert_mono_to_color_image, lookup_rgb_color)
+ (init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper):
+ * sound.c (be2hs, do_play_sound):
+ * vm-limit.c (get_lim_data, ret_lim_data):
+ * w32term.c (x_free_frame_resources):
+ * xfaces.c (x_create_gc, x_free_gc):
+ Convert definitions to standard C.
+
2010-07-20 Stefan Monnier <monnier@iro.umontreal.ca>
* eval.c (Feval, Ffuncall): Use the new names.
/* This function is used as the hook for free to call. */
static void
-emacs_blocked_free (ptr, ptr2)
- void *ptr;
- const void *ptr2;
+emacs_blocked_free (void *ptr, const void *ptr2)
{
BLOCK_INPUT_ALLOC;
/* This function is the malloc hook that Emacs uses. */
static void *
-emacs_blocked_malloc (size, ptr)
- size_t size;
- const void *ptr;
+emacs_blocked_malloc (size_t size, const void *ptr)
{
void *value;
/* This function is the realloc hook that Emacs uses. */
static void *
-emacs_blocked_realloc (ptr, size, ptr2)
- void *ptr;
- size_t size;
- const void *ptr2;
+emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2)
{
void *value;
/* Called from main to set up malloc to use our hooks. */
void
-uninterrupt_malloc ()
+uninterrupt_malloc (void)
{
#ifdef HAVE_GTK_AND_PTHREAD
#ifdef DOUG_LEA_MALLOC
}
void
-w32_reset_fringes ()
+w32_reset_fringes (void)
{
/* Destroy row bitmaps. */
int bt;
}
static void
-convert_mono_to_color_image (f, img, foreground, background)
- struct frame *f;
- struct image *img;
- COLORREF foreground, background;
+convert_mono_to_color_image (struct frame *f, struct image *img,
+ COLORREF foreground, COLORREF background)
{
HDC hdc, old_img_dc, new_img_dc;
HGDIOBJ old_prev, new_prev;
#else /* COLOR_TABLE_SUPPORT */
static unsigned long
-lookup_rgb_color (f, r, g, b)
- struct frame *f;
- int r, g, b;
+lookup_rgb_color (struct frame *f, int r, int g, int b)
{
unsigned long pixel;
}
static void
-init_color_table ()
+init_color_table (void)
{
}
#endif /* COLOR_TABLE_SUPPORT */
stored in ximg->data. */
static void
-XPutPixel (ximg, x, y, color)
- XImagePtr ximg;
- int x, y;
- COLORREF color;
+XPutPixel (XImagePtr ximg, int x, int y, COLORREF color)
{
int width = ximg->info.bmiHeader.biWidth;
int height = ximg->info.bmiHeader.biHeight;
/* Wrapper since we can't directly assign the function pointer
to another function pointer that was declared more completely easily. */
static boolean
-jpeg_resync_to_restart_wrapper (cinfo, desired)
- j_decompress_ptr cinfo;
- int desired;
+jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired)
{
return fn_jpeg_resync_to_restart (cinfo, desired);
}
to host byte-order. */
static u_int16_t
-be2hs (value)
- u_int16_t value;
+be2hs (u_int16_t value)
{
#ifndef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
}
static void
-snd_error_quiet (const char *file, int line, const char *function, int err, const char *fmt)
+snd_error_quiet (const char *file, int line, const char *function, int err,
+ const char *fmt)
{
}
}
static int
-do_play_sound (psz_file, ui_volume)
- const char *psz_file;
- unsigned long ui_volume;
+do_play_sound (const char *psz_file, unsigned long ui_volume)
{
int i_result = 0;
MCIERROR mci_error = 0;
#ifdef USG
static void
-get_lim_data ()
+get_lim_data (void)
{
extern long ulimit ();
#ifdef WINDOWSNT
static void
-get_lim_data ()
+get_lim_data (void)
{
extern unsigned long reserved_heap_size;
lim_data = reserved_heap_size;
#ifdef MSDOS
void
-get_lim_data ()
+get_lim_data (void)
{
_go32_dpmi_meminfo info;
unsigned long lim1, lim2;
}
unsigned long
-ret_lim_data ()
+ret_lim_data (void)
{
get_lim_data ();
return lim_data;
}
#else /* not MSDOS */
static void
-get_lim_data ()
+get_lim_data (void)
{
lim_data = vlimit (LIM_DATA, -1);
}
#else /* BSD4_2 */
static void
-get_lim_data ()
+get_lim_data (void)
{
struct rlimit XXrlimit;
/* Free X resources of frame F. */
void
-x_free_frame_resources (f)
- struct frame *f;
+x_free_frame_resources (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
/* W32 emulation of GCs */
static INLINE GC
-x_create_gc (f, mask, xgcv)
- struct frame *f;
- unsigned long mask;
- XGCValues *xgcv;
+x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv)
{
GC gc;
BLOCK_INPUT;
/* Free GC which was used on frame F. */
static INLINE void
-x_free_gc (f, gc)
- struct frame *f;
- GC gc;
+x_free_gc (struct frame *f, GC gc)
{
IF_DEBUG (xassert (--ngcs >= 0));
xfree (gc);