summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2010-07-20 22:21:03 +0200
committerJuanma Barranquero <lekktu@gmail.com>2010-07-20 22:21:03 +0200
commit7c3320d8b9d3beaf952b20cfe1843181c1c7af65 (patch)
tree188ab3f0c3582c2890365bd92939e32a6b01d44c /lib-src
parentaf4b9ae58662d50080a7661631ce6861dc6b6aa9 (diff)
downloademacs-7c3320d8b9d3beaf952b20cfe1843181c1c7af65.tar.gz
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 'lib-src')
-rw-r--r--lib-src/ChangeLog9
-rw-r--r--lib-src/emacsclient.c32
-rw-r--r--lib-src/ntlib.c22
3 files changed, 32 insertions, 31 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 03cf3efbd06..1b6a16dd524 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,12 @@
+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)
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 79143ff7a34..bafc7e02720 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -235,7 +235,7 @@ xstrdup (const char *s)
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;
@@ -311,10 +311,7 @@ get_current_dir_name ()
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;
@@ -347,8 +344,7 @@ w32_get_resource (predefined, key, type)
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;
@@ -396,7 +392,7 @@ w32_getenv (envvar)
}
void
-w32_set_user_model_id ()
+w32_set_user_model_id (void)
{
HMODULE shell;
HRESULT (WINAPI * set_user_model) (wchar_t * id);
@@ -423,7 +419,7 @@ w32_set_user_model_id ()
}
int
-w32_window_app ()
+w32_window_app (void)
{
static int window_app = -1;
char szTitle[MAX_PATH];
@@ -446,13 +442,11 @@ w32_window_app ()
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;
@@ -900,15 +894,15 @@ file_name_absolute_p (const unsigned char *filename)
#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;
@@ -1408,9 +1402,7 @@ FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
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];
@@ -1438,7 +1430,7 @@ w32_find_emacs_process (hWnd, lParam)
* process id = emacs_pid. If found, allow it to grab the focus.
*/
void
-w32_give_focus ()
+w32_give_focus (void)
{
HANDLE user32;
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index c815f32d51d..c24b35d9a19 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -38,7 +38,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
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);
}
@@ -56,7 +56,7 @@ static HANDLE getppid_parent;
static int getppid_ppid;
int
-getppid(void)
+getppid (void)
{
char *ppid;
DWORD result;
@@ -64,7 +64,7 @@ getppid(void)
ppid = getenv ("EM_PARENT_PROCESS_ID");
if (!ppid)
{
- printf("no pid.\n");
+ printf ("no pid.\n");
return 0;
}
else
@@ -74,11 +74,11 @@ getppid(void)
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);
}
}
@@ -94,13 +94,13 @@ getppid(void)
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);
@@ -120,19 +120,19 @@ cuserid (char * s)
}
unsigned
-getuid ()
+getuid (void)
{
return 0;
}
unsigned
-getgid ()
+getgid (void)
{
return 0;
}
unsigned
-getegid ()
+getegid (void)
{
return 0;
}
@@ -219,7 +219,7 @@ sys_ctime (const time_t *t)
}
FILE *
-sys_fopen(const char * path, const char * mode)
+sys_fopen (const char * path, const char * mode)
{
return fopen (path, mode);
}