emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100858: Convert some more functions


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100858: Convert some more functions to standard C.
Date: Tue, 20 Jul 2010 22:21:03 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100858
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Tue 2010-07-20 22:21:03 +0200
message:
  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.
modified:
  lib-src/ChangeLog
  lib-src/emacsclient.c
  lib-src/ntlib.c
  nt/ChangeLog
  nt/addpm.c
  nt/cmdproxy.c
  nt/ddeclient.c
  nt/runemacs.c
  src/ChangeLog
  src/alloc.c
  src/fringe.c
  src/image.c
  src/sound.c
  src/vm-limit.c
  src/w32term.c
  src/xfaces.c
=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2010-07-20 11:13:25 +0000
+++ b/lib-src/ChangeLog 2010-07-20 20:21:03 +0000
@@ -1,3 +1,12 @@
+2010-07-20  Juanma Barranquero  <address@hidden>
+
+       * 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  <address@hidden>
 
        * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)

=== modified file 'lib-src/emacsclient.c'
--- a/lib-src/emacsclient.c     2010-07-11 10:31:10 +0000
+++ b/lib-src/emacsclient.c     2010-07-20 20:21:03 +0000
@@ -235,7 +235,7 @@
    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 @@
    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 @@
   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 @@
 }
 
 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 @@
 }
 
 int
-w32_window_app ()
+w32_window_app (void)
 {
   static int window_app = -1;
   char szTitle[MAX_PATH];
@@ -446,13 +442,11 @@
   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 @@
 
 #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 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 @@
  * process id = emacs_pid.  If found, allow it to grab the focus.
  */
 void
-w32_give_focus ()
+w32_give_focus (void)
 {
   HANDLE user32;
 

=== modified file 'lib-src/ntlib.c'
--- a/lib-src/ntlib.c   2010-04-19 15:07:52 +0000
+++ b/lib-src/ntlib.c   2010-07-20 20:21:03 +0000
@@ -38,7 +38,7 @@
    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 int    getppid_ppid;
 
 int
-getppid(void)
+getppid (void)
 {
   char *ppid;
   DWORD result;
@@ -64,7 +64,7 @@
   ppid = getenv ("EM_PARENT_PROCESS_ID");
   if (!ppid)
     {
-      printf("no pid.\n");
+      printf ("no pid.\n");
       return 0;
     }
   else
@@ -74,11 +74,11 @@
 
   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 @@
       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 @@
 }
 
 unsigned
-getuid ()
-{
-  return 0;
-}
-
-unsigned
-getgid ()
-{
-  return 0;
-}
-
-unsigned
-getegid ()
+getuid (void)
+{
+  return 0;
+}
+
+unsigned
+getgid (void)
+{
+  return 0;
+}
+
+unsigned
+getegid (void)
 {
   return 0;
 }
@@ -219,7 +219,7 @@
 }
 
 FILE *
-sys_fopen(const char * path, const char * mode)
+sys_fopen (const char * path, const char * mode)
 {
   return fopen (path, mode);
 }

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2010-07-20 18:01:17 +0000
+++ b/nt/ChangeLog      2010-07-20 20:21:03 +0000
@@ -1,5 +1,13 @@
 2010-07-20  Juanma Barranquero  <address@hidden>
 
+       * 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  <address@hidden>
+
        * gmake.defs (CHECKING_CFLAGS) [ENABLECHECKS]: Add -fno-crossjumping.
 
 2010-07-18  Juanma Barranquero  <address@hidden>

=== modified file 'nt/addpm.c'
--- a/nt/addpm.c        2010-01-13 08:35:10 +0000
+++ b/nt/addpm.c        2010-07-20 20:21:03 +0000
@@ -83,8 +83,7 @@
 };
 
 BOOL
-add_registry (path)
-     char *path;
+add_registry (char *path)
 {
   HKEY hrootkey = NULL;
   int i;
@@ -175,9 +174,7 @@
 }
 
 int
-main (argc, argv)
-     int argc;
-     char *argv[];
+main (int argc, char *argv[])
 {
   char start_folder[MAX_PATH + 1];
   int shortcuts_created = 0;
@@ -315,10 +312,10 @@
                  if (SUCCEEDED (IPersistFile_Save (lnk, unicode_path, TRUE)))
                    shortcuts_created = 1;
                  IPersistFile_Release (lnk);
-                 
+
                }
            }
-       }      
+       }
     }
 
   if (com_available)

=== modified file 'nt/cmdproxy.c'
--- a/nt/cmdproxy.c     2010-01-13 08:35:10 +0000
+++ b/nt/cmdproxy.c     2010-07-20 20:21:03 +0000
@@ -407,7 +407,7 @@
 
 /* Return size of current environment block.  */
 int
-get_env_size ()
+get_env_size (void)
 {
   char * start = GetEnvironmentStrings ();
   char * tmp = start;

=== modified file 'nt/ddeclient.c'
--- a/nt/ddeclient.c    2010-01-13 08:35:10 +0000
+++ b/nt/ddeclient.c    2010-07-20 20:21:03 +0000
@@ -35,9 +35,7 @@
                              CF_TEXT, XTYP_EXECUTE, 30000, NULL)
 
 int
-main (argc, argv)
-     int argc;
-     char *argv[];
+main (int argc, char *argv[])
 {
   DWORD idDde = 0;
   HCONV HConversation;

=== modified file 'nt/runemacs.c'
--- a/nt/runemacs.c     2010-01-13 08:35:10 +0000
+++ b/nt/runemacs.c     2010-07-20 20:21:03 +0000
@@ -174,7 +174,8 @@
   return 1;
 }
 
-void set_user_model_id ()
+void
+set_user_model_id (void)
 {
   HMODULE shell;
   HRESULT (WINAPI * set_user_model) (wchar_t * id);

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-07-20 15:26:53 +0000
+++ b/src/ChangeLog     2010-07-20 20:21:03 +0000
@@ -1,3 +1,16 @@
+2010-07-20  Juanma Barranquero  <address@hidden>
+
+       * 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  <address@hidden>
 
        * eval.c (Feval, Ffuncall): Use the new names.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2010-07-11 18:34:43 +0000
+++ b/src/alloc.c       2010-07-20 20:21:03 +0000
@@ -1161,9 +1161,7 @@
 /* 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;
 
@@ -1211,9 +1209,7 @@
 /* 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;
 
@@ -1260,10 +1256,7 @@
 /* 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;
 
@@ -1337,7 +1330,7 @@
 /* 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

=== modified file 'src/fringe.c'
--- a/src/fringe.c      2010-07-15 16:48:34 +0000
+++ b/src/fringe.c      2010-07-20 20:21:03 +0000
@@ -1836,7 +1836,7 @@
 }
 
 void
-w32_reset_fringes ()
+w32_reset_fringes (void)
 {
   /* Destroy row bitmaps.  */
   int bt;

=== modified file 'src/image.c'
--- a/src/image.c       2010-07-10 18:52:53 +0000
+++ b/src/image.c       2010-07-20 20:21:03 +0000
@@ -2560,10 +2560,8 @@
 }
 
 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;
@@ -4357,9 +4355,7 @@
 #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;
 
@@ -4374,7 +4370,7 @@
 }
 
 static void
-init_color_table ()
+init_color_table (void)
 {
 }
 #endif /* COLOR_TABLE_SUPPORT */
@@ -4492,10 +4488,7 @@
    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;
@@ -6071,9 +6064,7 @@
 /* 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);
 }

=== modified file 'src/sound.c'
--- a/src/sound.c       2010-07-08 21:25:08 +0000
+++ b/src/sound.c       2010-07-20 20:21:03 +0000
@@ -522,8 +522,7 @@
    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;
@@ -1209,7 +1208,8 @@
 }
 
 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)
 {
 }
 
@@ -1266,9 +1266,7 @@
   }
 
 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;

=== modified file 'src/vm-limit.c'
--- a/src/vm-limit.c    2010-07-11 09:27:13 +0000
+++ b/src/vm-limit.c    2010-07-20 20:21:03 +0000
@@ -69,7 +69,7 @@
 #ifdef USG
 
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   extern long ulimit ();
 
@@ -93,7 +93,7 @@
 #ifdef WINDOWSNT
 
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   extern unsigned long reserved_heap_size;
   lim_data = reserved_heap_size;
@@ -104,7 +104,7 @@
 
 #ifdef MSDOS
 void
-get_lim_data ()
+get_lim_data (void)
 {
   _go32_dpmi_meminfo info;
   unsigned long lim1, lim2;
@@ -135,14 +135,14 @@
 }
 
 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);
 }
@@ -151,7 +151,7 @@
 #else /* BSD4_2 */
 
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   struct rlimit XXrlimit;
 

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2010-07-10 18:52:53 +0000
+++ b/src/w32term.c     2010-07-20 20:21:03 +0000
@@ -5694,8 +5694,7 @@
 /* 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);
 

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2010-07-12 19:29:49 +0000
+++ b/src/xfaces.c      2010-07-20 20:21:03 +0000
@@ -726,10 +726,7 @@
 /* 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;
@@ -743,9 +740,7 @@
 /* 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);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]