emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116944: Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeo


From: Paul Eggert
Subject: [Emacs-diffs] trunk r116944: Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.
Date: Sat, 05 Apr 2014 19:30:49 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116944
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sat 2014-04-05 12:30:36 -0700
message:
  Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.
  
  * alloc.c (memory_full):
  * charset.c (syms_of_charset):
  * doc.c (Fsnarf_documentation):
  * emacs.c (main):
  * font.c (BUILD_STYLE_TABLE):
  * keyboard.c (make_lispy_event):
  * profiler.c (setup_cpu_timer):
  * xgselect.c (xg_select):
  * xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG):
  Use ARRAYELTS.
  * font.c (FONT_PROPERTY_TABLE_SIZE): Remove.
  Replace the only use with ARRAYELTS (font_property_table).
  * xfaces.c (DIM): Remove.  All uses replaced by ARRAYELTS.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/alloc.c                    alloc.c-20091113204419-o5vbwnq5f7feedwu-252
  src/charset.c                  charset.c-20091113204419-o5vbwnq5f7feedwu-1075
  src/coding.c                   coding.c-20091113204419-o5vbwnq5f7feedwu-1077
  src/coding.h                   coding.h-20091113204419-o5vbwnq5f7feedwu-1078
  src/doc.c                      doc.c-20091113204419-o5vbwnq5f7feedwu-250
  src/emacs.c                    emacs.c-20091113204419-o5vbwnq5f7feedwu-241
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
  src/gnutls.c                   gnutls.c-20100926054902-dzayyj6wycit6kzn-3
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  src/keymap.c                   keymap.c-20091113204419-o5vbwnq5f7feedwu-219
  src/keymap.h                   keymap.h-20091113204419-o5vbwnq5f7feedwu-2247
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
  src/process.c                  process.c-20091113204419-o5vbwnq5f7feedwu-462
  src/profiler.c                 profiler.c-20120822062536-8tk8gghazaoi1nyq-2
  src/sysdep.c                   sysdep.c-20091113204419-o5vbwnq5f7feedwu-448
  src/unexcoff.c                 unexec.c-20091113204419-o5vbwnq5f7feedwu-184
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
  src/xgselect.c                 xgselect.c-20091121171556-bypaf8oo9ygoo13w-2
  src/xsmfns.c                   xsmfns.c-20091113204419-o5vbwnq5f7feedwu-2385
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
  src/xterm.h                    xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-04-05 18:40:52 +0000
+++ b/src/ChangeLog     2014-04-05 19:30:36 +0000
@@ -1,3 +1,20 @@
+2014-04-05  Paul Eggert  <address@hidden>
+
+       Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.
+       * alloc.c (memory_full):
+       * charset.c (syms_of_charset):
+       * doc.c (Fsnarf_documentation):
+       * emacs.c (main):
+       * font.c (BUILD_STYLE_TABLE):
+       * keyboard.c (make_lispy_event):
+       * profiler.c (setup_cpu_timer):
+       * xgselect.c (xg_select):
+       * xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG):
+       Use ARRAYELTS.
+       * font.c (FONT_PROPERTY_TABLE_SIZE): Remove.
+       Replace the only use with ARRAYELTS (font_property_table).
+       * xfaces.c (DIM): Remove.  All uses replaced by ARRAYELTS.
+
 2014-04-03  Daniel Colascione  <address@hidden>
 
        * xterm.c (x_term_init):

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2014-04-03 20:46:04 +0000
+++ b/src/alloc.c       2014-04-05 19:30:36 +0000
@@ -208,19 +208,19 @@
 
 #ifdef SUSPICIOUS_OBJECT_CHECKING
 struct suspicious_free_record {
-  void* suspicious_object;
+  void *suspicious_object;
 #ifdef HAVE_EXECINFO_H
-  void* backtrace[128];
+  void *backtrace[128];
 #endif
 };
-static void* suspicious_objects[32];
+static void *suspicious_objects[32];
 static int suspicious_object_index;
 struct suspicious_free_record suspicious_free_history[64];
 static int suspicious_free_history_index;
 /* Find the first currently-monitored suspicious pointer in range
    [begin,end) or NULL if no such pointer exists.  */
-static void* find_suspicious_object_in_range (void* begin, void* end);
-static void detect_suspicious_free (void* ptr);
+static void *find_suspicious_object_in_range (void *begin, void *end);
+static void detect_suspicious_free (void *ptr);
 #else
 #define find_suspicious_object_in_range(begin, end) NULL
 #define detect_suspicious_free(ptr) (void)
@@ -3116,7 +3116,7 @@
         mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
 #endif
 
-      if (find_suspicious_object_in_range (p, (char*)p + nbytes))
+      if (find_suspicious_object_in_range (p, (char *) p + nbytes))
         emacs_abort ();
 
       consing_since_gc += nbytes;
@@ -3765,7 +3765,7 @@
       memory_full_cons_threshold = sizeof (struct cons_block);
 
       /* The first time we get here, free the spare memory.  */
-      for (i = 0; i < sizeof (spare_memory) / sizeof (char *); i++)
+      for (i = 0; i < ARRAYELTS (spare_memory); i++)
        if (spare_memory[i])
          {
            if (i == 0)
@@ -3818,7 +3818,6 @@
     Vmemory_full = Qnil;
 #endif
 }
-
 
 /************************************************************************
                           C Stack Marking
@@ -6829,23 +6828,24 @@
 #ifdef SUSPICIOUS_OBJECT_CHECKING
 
 static void*
-find_suspicious_object_in_range (void* begin, void* end)
+find_suspicious_object_in_range (void *begin, void *end)
 {
-  char* begin_a = begin;
-  char* end_a = end;
+  char *begin_a = begin;
+  char *end_a = end;
   int i;
 
-  for (i = 0; i < ARRAYELTS (suspicious_objects); ++i) {
-    char* suspicious_object = suspicious_objects[i];
-    if (begin_a <= suspicious_object && suspicious_object < end_a)
-      return suspicious_object;
-  }
+  for (i = 0; i < ARRAYELTS (suspicious_objects); ++i)
+    {
+      char *suspicious_object = suspicious_objects[i];
+      if (begin_a <= suspicious_object && suspicious_object < end_a)
+       return suspicious_object;
+    }
 
   return NULL;
 }
 
 static void
-detect_suspicious_free (void* ptr)
+detect_suspicious_free (void *ptr)
 {
   int i;
   struct suspicious_free_record* rec;
@@ -6882,11 +6882,12 @@
 {
 #ifdef SUSPICIOUS_OBJECT_CHECKING
   /* Right now, we care only about vectors.  */
-  if (VECTORLIKEP (obj)) {
-    suspicious_objects[suspicious_object_index++] = XVECTOR (obj);
-    if (suspicious_object_index == ARRAYELTS (suspicious_objects))
-      suspicious_object_index = 0;
-  }
+  if (VECTORLIKEP (obj))
+    {
+      suspicious_objects[suspicious_object_index++] = XVECTOR (obj);
+      if (suspicious_object_index == ARRAYELTS (suspicious_objects))
+       suspicious_object_index = 0;
+    }
 #endif
   return obj;
 }

=== modified file 'src/charset.c'
--- a/src/charset.c     2014-03-20 01:21:52 +0000
+++ b/src/charset.c     2014-04-05 19:30:36 +0000
@@ -2386,7 +2386,7 @@
   }
 
   charset_table = charset_table_init;
-  charset_table_size = sizeof charset_table_init / sizeof *charset_table_init;
+  charset_table_size = ARRAYELTS (charset_table_init);
   charset_table_used = 0;
 
   defsubr (&Scharsetp);

=== modified file 'src/coding.c'
--- a/src/coding.c      2014-01-29 13:21:25 +0000
+++ b/src/coding.c      2014-04-05 19:30:36 +0000
@@ -8443,11 +8443,11 @@
 }
 
 Lisp_Object
-from_unicode_buffer (const wchar_t* wstr)
+from_unicode_buffer (const wchar_t *wstr)
 {
     return from_unicode (
         make_unibyte_string (
-            (char*) wstr,
+            (char *) wstr,
             /* we get one of the two final 0 bytes for free. */
             1 + sizeof (wchar_t) * wcslen (wstr)));
 }

=== modified file 'src/coding.h'
--- a/src/coding.h      2014-01-29 13:21:25 +0000
+++ b/src/coding.h      2014-04-05 19:30:36 +0000
@@ -743,7 +743,7 @@
 extern Lisp_Object from_unicode (Lisp_Object str);
 
 /* Convert WSTR to an Emacs string.  */
-extern Lisp_Object from_unicode_buffer (const wchar_t* wstr);
+extern Lisp_Object from_unicode_buffer (const wchar_t *wstr);
 
 #endif /* WINDOWSNT || CYGWIN */
 

=== modified file 'src/doc.c'
--- a/src/doc.c 2014-03-21 19:04:57 +0000
+++ b/src/doc.c 2014-04-05 19:30:36 +0000
@@ -595,7 +595,7 @@
        {
          #include "buildobj.h"
        };
-      int i = sizeof buildobj / sizeof *buildobj;
+      int i = ARRAYELTS (buildobj);
       while (0 <= --i)
        Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files);
       Vbuild_files = Fpurecopy (Vbuild_files);

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2014-04-03 20:46:04 +0000
+++ b/src/emacs.c       2014-04-05 19:30:36 +0000
@@ -136,7 +136,7 @@
 /* From glibc, a routine that returns a copy of the malloc internal state.  */
 extern void *malloc_get_state (void);
 /* From glibc, a routine that overwrites the malloc internal state.  */
-extern int malloc_set_state (void*);
+extern int malloc_set_state (void *);
 /* True if the MALLOC_CHECK_ environment variable was set while
    dumping.  Used to work around a bug in glibc's malloc.  */
 static bool malloc_using_checking;
@@ -1008,7 +1008,7 @@
     {
       int i;
       printf ("Usage: %s [OPTION-OR-FILENAME]...\n", argv[0]);
-      for (i = 0; i < sizeof usage_message / sizeof *usage_message; i++)
+      for (i = 0; i < ARRAYELTS (usage_message); i++)
        fputs (usage_message[i], stdout);
       exit (0);
     }

=== modified file 'src/font.c'
--- a/src/font.c        2014-04-02 13:24:19 +0000
+++ b/src/font.c        2014-04-05 19:30:36 +0000
@@ -662,10 +662,6 @@
     { &QCotf, font_prop_validate_otf }
   };
 
-/* Size (number of elements) of the above table.  */
-#define FONT_PROPERTY_TABLE_SIZE \
-  ((sizeof font_property_table) / (sizeof *font_property_table))
-
 /* Return an index number of font property KEY or -1 if KEY is not an
    already known property.  */
 
@@ -674,7 +670,7 @@
 {
   int i;
 
-  for (i = 0; i < FONT_PROPERTY_TABLE_SIZE; i++)
+  for (i = 0; i < ARRAYELTS (font_property_table); i++)
     if (EQ (key, *font_property_table[i].key))
       return i;
   return -1;
@@ -4935,8 +4931,7 @@
 #endif
 
 
-#define BUILD_STYLE_TABLE(TBL) \
-  build_style_table ((TBL), sizeof TBL / sizeof (struct table_entry))
+#define BUILD_STYLE_TABLE(TBL) build_style_table (TBL, ARRAYELTS (TBL))
 
 static Lisp_Object
 build_style_table (const struct table_entry *entry, int nelement)

=== modified file 'src/gnutls.c'
--- a/src/gnutls.c      2014-03-17 21:29:56 +0000
+++ b/src/gnutls.c      2014-04-05 19:30:36 +0000
@@ -56,7 +56,7 @@
 static Lisp_Object QCgnutls_bootprop_callbacks_verify;
 
 static void gnutls_log_function (int, const char *);
-static void gnutls_log_function2 (int, const char*, const char*);
+static void gnutls_log_function2 (int, const char *, const char *);
 #ifdef HAVE_GNUTLS3
 static void gnutls_audit_log_function (gnutls_session_t, const char *);
 #endif
@@ -267,7 +267,7 @@
 #ifdef HAVE_GNUTLS3
 /* Function to log a simple audit message.  */
 static void
-gnutls_audit_log_function (gnutls_session_t session, const char* string)
+gnutls_audit_log_function (gnutls_session_t session, const char *string)
 {
   if (global_gnutls_log_level >= 1)
     {
@@ -278,21 +278,21 @@
 
 /* Function to log a simple message.  */
 static void
-gnutls_log_function (int level, const char* string)
+gnutls_log_function (int level, const char *string)
 {
   message ("gnutls.c: [%d] %s", level, string);
 }
 
 /* Function to log a message and a string.  */
 static void
-gnutls_log_function2 (int level, const char* string, const char* extra)
+gnutls_log_function2 (int level, const char *string, const char *extra)
 {
   message ("gnutls.c: [%d] %s %s", level, string, extra);
 }
 
 /* Function to log a message and an integer.  */
 static void
-gnutls_log_function2i (int level, const char* string, int extra)
+gnutls_log_function2i (int level, const char *string, int extra)
 {
   message ("gnutls.c: [%d] %s %d", level, string, extra);
 }
@@ -794,7 +794,7 @@
   Lisp_Object global_init;
   char const *priority_string_ptr = "NORMAL"; /* default priority string.  */
   unsigned int peer_verification;
-  char* c_hostname;
+  char *c_hostname;
 
   /* Placeholders for the property list elements.  */
   Lisp_Object priority_string;

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2014-04-03 20:46:04 +0000
+++ b/src/keyboard.c    2014-04-05 19:30:36 +0000
@@ -5478,7 +5478,7 @@
     case NON_ASCII_KEYSTROKE_EVENT:
       button_down_time = 0;
 
-      for (i = 0; i < sizeof (lispy_accent_codes) / sizeof (int); i++)
+      for (i = 0; i < ARRAYELTS (lispy_accent_codes); i++)
        if (event->code == lispy_accent_codes[i])
          return modify_event_symbol (i,
                                      event->modifiers,
@@ -5511,7 +5511,7 @@
       if (event->code & (1 << 28)
          || event->code - FUNCTION_KEY_OFFSET < 0
          || (event->code - FUNCTION_KEY_OFFSET
-             >= sizeof lispy_function_keys / sizeof *lispy_function_keys)
+             >= ARRAYELTS (lispy_function_keys))
          || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET])
        {
          /* We need to use an alist rather than a vector as the cache
@@ -7282,7 +7282,7 @@
 }
 
 
-static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
+static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void *);
 static Lisp_Object menu_bar_one_keymap_changed_items;
 
 /* These variables hold the vector under construction within
@@ -7292,7 +7292,7 @@
 static int menu_bar_items_index;
 
 
-static const char* separator_names[] = {
+static const char *separator_names[] = {
   "space",
   "no-line",
   "single-line",
@@ -7900,7 +7900,8 @@
 /* Function prototypes.  */
 
 static void init_tool_bar_items (Lisp_Object);
-static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, 
void*);
+static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object,
+                                  void *);
 static bool parse_tool_bar_item (Lisp_Object, Lisp_Object);
 static void append_tool_bar_item (void);
 

=== modified file 'src/keymap.c'
--- a/src/keymap.c      2014-01-01 07:43:34 +0000
+++ b/src/keymap.c      2014-04-05 19:30:36 +0000
@@ -1894,7 +1894,7 @@
 
 static void
 accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void 
*data)
-/* Use void* data to be compatible with map_keymap_function_t.  */
+/* Use void * data to be compatible with map_keymap_function_t.  */
 {
   struct accessible_keymaps_data *d = data; /* Cast! */
   Lisp_Object maps = d->maps;

=== modified file 'src/keymap.h'
--- a/src/keymap.h      2014-01-01 07:43:34 +0000
+++ b/src/keymap.h      2014-04-05 19:30:36 +0000
@@ -46,7 +46,7 @@
 extern void keys_of_keymap (void);
 
 typedef void (*map_keymap_function_t)
-     (Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data);
+     (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data);
 extern void map_keymap (Lisp_Object, map_keymap_function_t, Lisp_Object,
                        void *, bool);
 extern void map_keymap_canonical (Lisp_Object map,

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2014-04-03 20:46:04 +0000
+++ b/src/lisp.h        2014-04-05 19:30:36 +0000
@@ -58,8 +58,8 @@
 #define max(a, b) ((a) > (b) ? (a) : (b))
 #define min(a, b) ((a) < (b) ? (a) : (b))
 
-/* Find number of elements in array */
-#define ARRAYELTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
+/* Number of elements in an array.  */
+#define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0])
 
 /* EMACS_INT - signed integer wide enough to hold an Emacs value
    EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if

=== modified file 'src/process.c'
--- a/src/process.c     2014-03-26 15:57:13 +0000
+++ b/src/process.c     2014-04-05 19:30:36 +0000
@@ -2022,11 +2022,11 @@
            terminator, however.  */
         if (name_length > 0 && sockun->sun_path[0] != '\0')
           {
-            const char* terminator =
-              memchr (sockun->sun_path, '\0', name_length);
+            const char *terminator
+             = memchr (sockun->sun_path, '\0', name_length);
 
             if (terminator)
-              name_length = terminator - (const char*) sockun->sun_path;
+              name_length = terminator - (const char *) sockun->sun_path;
           }
 
        return make_unibyte_string (sockun->sun_path, name_length);

=== modified file 'src/profiler.c'
--- a/src/profiler.c    2014-01-01 07:43:34 +0000
+++ b/src/profiler.c    2014-04-05 19:30:36 +0000
@@ -294,7 +294,7 @@
       sigev.sigev_signo = SIGPROF;
       sigev.sigev_notify = SIGEV_SIGNAL;
 
-      for (i = 0; i < sizeof system_clock / sizeof *system_clock; i++)
+      for (i = 0; i < ARRAYELTS (system_clock); i++)
        if (timer_create (system_clock[i], &sigev, &profiler_timer) == 0)
          {
            profiler_timer_ok = 1;

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2014-04-03 20:46:04 +0000
+++ b/src/sysdep.c      2014-04-05 19:30:36 +0000
@@ -128,7 +128,7 @@
 /* Return the current working directory.  Returns NULL on errors.
    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*
+char *
 get_current_dir_name (void)
 {
   char *buf;

=== modified file 'src/unexcoff.c'
--- a/src/unexcoff.c    2014-01-01 07:43:34 +0000
+++ b/src/unexcoff.c    2014-04-05 19:30:36 +0000
@@ -120,7 +120,7 @@
    into an int which is the number of a byte.
    This is a no-op on ordinary machines, but not on all.  */
 
-#define ADDR_CORRECT(x) ((char *)(x) - (char*)0)
+#define ADDR_CORRECT(x) ((char *) (x) - (char *) 0)
 
 #include "lisp.h"
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-03-23 15:57:25 +0000
+++ b/src/xdisp.c       2014-04-05 19:30:36 +0000
@@ -22639,7 +22639,7 @@
        return decode_mode_spec_buf;
     no_value:
         {
-         char* p = decode_mode_spec_buf;
+         char *p = decode_mode_spec_buf;
          int pad = width - 2;
          while (pad-- > 0)
            *p++ = ' ';

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2014-04-03 20:46:04 +0000
+++ b/src/xfaces.c      2014-04-05 19:30:36 +0000
@@ -273,10 +273,6 @@
 
 #define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface)
 
-/* Value is the number of elements of VECTOR.  */
-
-#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
-
 /* Size of hash table of realized faces in face caches (should be a
    prime number).  */
 
@@ -5093,14 +5089,14 @@
 {
   Lisp_Object list;
   int i;
-  int indices[DIM (font_sort_order)];
+  int indices[ARRAYELTS (font_sort_order)];
 
   CHECK_LIST (order);
   memset (indices, 0, sizeof indices);
   i = 0;
 
   for (list = order;
-       CONSP (list) && i < DIM (indices);
+       CONSP (list) && i < ARRAYELTS (indices);
        list = XCDR (list), ++i)
     {
       Lisp_Object attr = XCAR (list);
@@ -5122,9 +5118,9 @@
       indices[i] = xlfd;
     }
 
-  if (!NILP (list) || i != DIM (indices))
+  if (!NILP (list) || i != ARRAYELTS (indices))
     signal_error ("Invalid font sort order", order);
-  for (i = 0; i < DIM (font_sort_order); ++i)
+  for (i = 0; i < ARRAYELTS (font_sort_order); ++i)
     if (indices[i] == 0)
       signal_error ("Invalid font sort order", order);
 
@@ -6348,7 +6344,7 @@
       int i;
 
       fprintf (stderr, "font selection order: ");
-      for (i = 0; i < DIM (font_sort_order); ++i)
+      for (i = 0; i < ARRAYELTS (font_sort_order); ++i)
        fprintf (stderr, "%d ", font_sort_order[i]);
       fprintf (stderr, "\n");
 

=== modified file 'src/xgselect.c'
--- a/src/xgselect.c    2014-03-05 06:31:57 +0000
+++ b/src/xgselect.c    2014-04-05 19:30:36 +0000
@@ -41,7 +41,7 @@
   int have_wfds = wfds != NULL;
   GPollFD gfds_buf[128];
   GPollFD *gfds = gfds_buf;
-  int gfds_size = sizeof gfds_buf / sizeof *gfds_buf;
+  int gfds_size = ARRAYELTS (gfds_buf);
   int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1;
   int i, nfds, tmo_in_millisec;
   bool need_to_dispatch;

=== modified file 'src/xsmfns.c'
--- a/src/xsmfns.c      2014-01-01 07:43:34 +0000
+++ b/src/xsmfns.c      2014-04-05 19:30:36 +0000
@@ -395,7 +395,7 @@
 {
 #define SM_ERRORSTRING_LEN 512
   char errorstring[SM_ERRORSTRING_LEN];
-  char* previous_id = NULL;
+  char *previous_id = NULL;
   SmcCallbacks callbacks;
   ptrdiff_t name_len = 0;
 

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2014-04-03 20:46:04 +0000
+++ b/src/xterm.c       2014-04-05 19:30:36 +0000
@@ -308,7 +308,7 @@
 void
 record_event (char *locus, int type)
 {
-  if (event_record_index == sizeof (event_record) / sizeof (struct record))
+  if (event_record_index == ARRAYELTS (event_record))
     event_record_index = 0;
 
   event_record[event_record_index].locus = locus;
@@ -5624,7 +5624,7 @@
 static short temp_buffer[100];
 
 #define STORE_KEYSYM_FOR_DEBUG(keysym)                         \
-  if (temp_index == sizeof temp_buffer / sizeof (short))       \
+  if (temp_index == ARRAYELTS (temp_buffer))                   \
     temp_index = 0;                                            \
   temp_buffer[temp_index++] = (keysym)
 

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2014-03-03 08:27:58 +0000
+++ b/src/xterm.h       2014-04-05 19:30:36 +0000
@@ -996,7 +996,7 @@
 
 #ifdef USE_GTK
 extern int xg_set_icon (struct frame *, Lisp_Object);
-extern int xg_set_icon_from_xpm_data (struct frame *, const char**);
+extern int xg_set_icon_from_xpm_data (struct frame *, const char **);
 #endif /* USE_GTK */
 
 extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);


reply via email to

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