Merge from trunk.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 18 Aug 2011 17:01:52 +0000 (10:01 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 18 Aug 2011 17:01:52 +0000 (10:01 -0700)
16 files changed:
doc/lispref/ChangeLog
doc/lispref/display.texi
doc/lispref/nonascii.texi
etc/NEWS
lisp/ChangeLog
lisp/buff-menu.el
lisp/dired.el
lisp/emacs-lisp/tabulated-list.el
lisp/faces.el
lisp/font-lock.el
lisp/international/characters.el
lisp/progmodes/compile.el
lisp/subr.el
src/ChangeLog
src/dispextern.h
src/process.c

index 56175a3..4cb4d0a 100644 (file)
@@ -1,3 +1,16 @@
+2011-08-18  Eli Zaretskii  <eliz@gnu.org>
+
+       * nonascii.texi (Character Properties): Document use of
+       `bidi-class' and `mirroring' properties as part of reordering.
+       Provide cross-references to "Bidirectional Display".
+
+       * display.texi (Bidirectional Display): Document the pitfalls of
+       concatenating strings with bidirectional content, with possible
+       solutions.  Document bidi-string-mark-left-to-right.  Mention
+       paragraph direction in modes that inherit from prog-mode.
+       Document use of `bidi-class' and `mirroring' properties as part of
+       reordering.
+
 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
 
        * modes.texi (Major Mode Conventions): Improve the documentation
index 64a9054..8f7f400 100644 (file)
@@ -5992,6 +5992,7 @@ left-to-right and right-to-left characters.
 for editing and displaying bidirectional text.
 
 @cindex logical order
+@cindex reading order
 @cindex visual order
 @cindex unicode bidirectional algorithm
   Emacs stores right-to-left and bidirectional text in the so-called
@@ -6006,17 +6007,16 @@ for display.  Reordering of bidirectional text for display in Emacs is
 a ``Full bidirectionality'' class implementation of the @acronym{UBA}.
 
 @defvar bidi-display-reordering
-  The buffer-local variable @code{bidi-display-reordering} controls
-whether text in the buffer is reordered for display.  If its value is
-non-@code{nil}, Emacs reorders characters that have right-to-left
-directionality when they are displayed.  The default value is
-@code{t}.  Text in overlay strings (@pxref{Overlay
-Properties,,before-string}), display strings (@pxref{Overlay
-Properties,,display}), and @code{display} text properties
-(@pxref{Display Property}) is also reordered if the buffer whose text
-includes these strings is reordered for display.  Turning off
-@code{bidi-display-reordering} for a buffer turns off reordering of
-all the overlay and display strings in that buffer.
+  This buffer-local variable controls whether text in the buffer is
+reordered for display.  If its value is non-@code{nil}, Emacs reorders
+characters that have right-to-left directionality when they are
+displayed.  The default value is @code{t}.  Text in overlay strings
+(@pxref{Overlay Properties,,before-string}), display strings
+(@pxref{Overlay Properties,,display}), and @code{display} text
+properties (@pxref{Display Property}) is also reordered for display if
+the buffer whose text includes these strings is reordered.  Turning
+off @code{bidi-display-reordering} for a buffer turns off reordering
+of all the overlay and display strings in that buffer.
 
   Reordering of strings that are unrelated to any buffer, such as text
 displayed on the mode line (@pxref{Mode Line Format}) or header line
@@ -6056,7 +6056,7 @@ it is reordered for display.  That is, the entire chunk of text
 covered by these properties is reordered together.  Moreover, the
 bidirectional properties of the characters in this chunk of text are
 ignored, and Emacs reorders them as if they were replaced with a
-single character @code{u+FFFC}, known as the @dfn{Object Replacement
+single character @code{U+FFFC}, known as the @dfn{Object Replacement
 Character}.  This means that placing a display property over a portion
 of text may change the way that the surrounding text is reordered for
 display.  To prevent this unexpected effect, always place such
@@ -6073,9 +6073,9 @@ begins at the right margin and is continued or truncated at the left
 margin.
 
 @defvar bidi-paragraph-direction
-  Emacs determines the base direction of each paragraph dynamically,
-based on the text at the beginning of the paragraph.  The precise
-method of determining the base direction is specified by the
+  By default, Emacs determines the base direction of each paragraph
+dynamically, based on the text at the beginning of the paragraph.  The
+precise method of determining the base direction is specified by the
 @acronym{UBA}; in a nutshell, the first character in a paragraph that
 has an explicit directionality determines the base direction of the
 paragraph.  However, sometimes a buffer may need to force a certain
@@ -6087,6 +6087,13 @@ dynamic determination of the base direction, and instead forces all
 paragraphs in the buffer to have the direction specified by its
 buffer-local value.  The value can be either @code{right-to-left} or
 @code{left-to-right}.  Any other value is interpreted as @code{nil}.
+The default is @code{nil}.
+
+@cindex @code{prog-mode}, and @code{bidi-paragraph-direction}
+Modes that are meant to display program source code should force a
+@code{left-to-right} paragraph direction.  The easiest way of doing so
+is to derive the mode from Prog Mode, which already sets
+@code{bidi-paragraph-direction} to that value.
 @end defvar
 
 @defun current-bidi-paragraph-direction &optional buffer
@@ -6099,3 +6106,70 @@ non-@code{nil}, the returned value will be identical to that value;
 otherwise, the returned value reflects the paragraph direction
 determined dynamically by Emacs.
 @end defun
+
+@cindex layout on display, and bidirectional text
+@cindex jumbled display of bidirectional text
+@cindex concatenating bidirectional strings
+  Reordering of bidirectional text for display can have surprising and
+unpleasant effects when two strings with bidirectional content are
+juxtaposed in a buffer, or otherwise programmatically concatenated
+into a string of text.  A typical example is a buffer whose lines are
+actually sequences of items, or fields, separated by whitespace or
+punctuation characters.  This is used in specialized modes such as
+Buffer-menu Mode or various email summary modes, like Rmail Summary
+Mode.  Because these separator characters are @dfn{weak}, i.e.@: have
+no strong directionality, they take on the directionality of
+surrounding text.  As result, a numeric field that follows a field
+with bidirectional content can be displayed @emph{to the left} of the
+preceding field, producing a jumbled display and messing up the
+expected layout.
+
+  To countermand this, you can use one of the following techniques for
+forcing correct order of fields on display:
+
+@itemize @minus
+@item
+Append the special character @code{U+200E}, LEFT-TO-RIGHT MARK, or
+@acronym{LRM}, to the end of each field that may have bidirectional
+content, or prepend it to the beginning of the following field.  The
+function @code{bidi-string-mark-left-to-right}, described below, comes
+in handy for this purpose.  (In a right-to-left paragraph, use
+@code{U+200F}, RIGHT-TO-LEFT MARK, or @acronym{RLM}, instead.)  This
+is one of the solutions recommended by
+@uref{http://www.unicode.org/reports/tr9/#Separators, the
+@acronym{UBA}}.
+
+@item
+Include the tab character in the field separator.  The tab character
+plays the role of @dfn{segment separator} in the @acronym{UBA}
+reordering, whose effect is to make each field a separate segment, and
+thus reorder them separately.
+@end itemize
+
+@defun bidi-string-mark-left-to-right string
+This subroutine returns its argument @var{string}, possibly modified,
+such that the result can be safely concatenated with another string,
+or juxtaposed with another string in a buffer, without disrupting the
+relative layout of this string and the next one on display.  If the
+string returned by this function is displayed as part of a
+left-to-right paragraph, it will always appear on display to the left
+of the text that follows it.  The function works by examining the
+characters of its argument, and if any of those characters could cause
+reordering on display, the function appends the @acronym{LRM}
+character to the string.  The appended @acronym{LRM} character is made
+@emph{invisible} (@pxref{Invisible Text}), to hide it on display.
+@end defun
+
+  The reordering algorithm uses the bidirectional properties of the
+characters stored as their @code{bidi-class} property
+(@pxref{Character Properties}).  Lisp programs can change these
+properties by calling the @code{put-char-code-property} function.
+However, doing this requires a thorough understanding of the
+@acronym{UBA}, and is therefore not recommended.  Any changes to the
+bidirectional properties of a character have global effect: they
+affect all Emacs frames and windows.
+
+  Similarly, the @code{mirroring} property is used to display the
+appropriate mirrored character in the reordered text.  Lisp programs
+can affect the mirrored display by changing this property.  Again, any
+such changes affect all of Emacs display.
index 83f9f42..7b6d665 100644 (file)
@@ -392,7 +392,8 @@ The value is an integer number.
 @item bidi-class
 Corresponds to the Unicode @code{Bidi_Class} property.  The value is a
 symbol whose name is the Unicode @dfn{directional type} of the
-character.
+character.  Emacs uses this property when it reorders bidirectional
+text for display (@pxref{Bidirectional Display}).
 
 @item decomposition
 Corresponds to the Unicode @code{Decomposition_Type} and
@@ -440,7 +441,9 @@ defined mirroring glyph.  All the characters whose @code{mirrored}
 property is @code{N} have @code{nil} as their @code{mirroring}
 property; however, some characters whose @code{mirrored} property is
 @code{Y} also have @code{nil} for @code{mirroring}, because no
-appropriate characters exist with mirrored glyphs.
+appropriate characters exist with mirrored glyphs.  Emacs uses this
+property to display mirror images of characters when appropriate
+(@pxref{Bidirectional Display}).
 
 @item old-name
 Corresponds to the Unicode @code{Unicode_1_Name} property.  The value
index 8707a8b..ec863da 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -234,6 +234,9 @@ these image types, minus those listed in `imagemagick-types-inhibit'.
 
 See the Emacs Lisp Reference Manual for more information.
 
+** New basic faces `error', `warning', `success' are available to
+highlight strings that indicate failure, caution or successful operation.
+
 ** The colors for selected text (the region face) are taken from the GTK
 theme when Emacs is built with GTK.
 
@@ -1043,15 +1046,17 @@ of function value which looks like (closure ENV ARGS &rest BODY).
 *** New function `special-variable-p' to check whether a variable is
 declared as dynamically bound.
 
-** New function `string-mark-left-to-right'.
++++
+** New function `bidi-string-mark-left-to-right'.
 Given a string containing right-to-left (RTL) script, this function
-returns another string with a terminating LRM (left-to-right mark)
-character.  If this string is inserted into a buffer, Emacs treats the
-LRM as the end of an RTL segment and displays following text as LTR.
+returns another string which can be safely inserted into a buffer as a
+distinct RTL "segment", without causing any following text to be
+displayed as RTL.  (This is done by appending a Unicode "left-to-right
+mark" character.)
 
 This is useful when the buffer has overall left-to-right (LTR)
-paragraph direction and you need to insert a string whose contents
-(and hence directionality) are not known in advance.
+paragraph direction and you need to insert a string whose contents and
+directionality are not known in advance.
 
 ** pre/post-command-hook are not reset to nil upon error.
 Instead, the offending function is removed.
index f57bd43..38c536a 100644 (file)
@@ -1,3 +1,27 @@
+2011-08-18  Chong Yidong  <cyd@stupidchicken.com>
+
+       * international/characters.el: Add L and R categories.
+
+       * subr.el (bidi-string-mark-left-to-right): Rename from
+       string-mark-left-to-right.  Use category search.
+
+       * buff-menu.el (Buffer-menu-buffer+size): Callers changed.
+
+2011-08-18  Juri Linkov  <juri@jurta.org>
+
+       * faces.el (error, warning, success): New faces with definitions
+       copied from old default values of `font-lock-warning-face',
+       `compilation-warning', `compilation-info' (bug#6117).
+
+       * font-lock.el (font-lock-warning-face): Inherit from `error'.
+
+       * progmodes/compile.el (compilation-error): Inherit from `error'.
+       (compilation-warning): Inherit from `warning'.
+       (compilation-info): Inherit from `success'.
+
+       * dired.el (dired-marked): Inherit from `warning'.
+       (dired-flagged): Inherit from `error'.
+
 2011-08-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * mail/smtpmail.el (auth-source): Require to avoid problems with
index a5b4592..2eac33d 100644 (file)
@@ -681,9 +681,9 @@ For more information, see the function `buffer-menu'."
                           (string-width tail)
                           2))
                       Buffer-menu-short-ellipsis
-                      (string-mark-left-to-right tail))))
+                      (bidi-string-mark-left-to-right tail))))
     ;; Don't put properties on (buffer-name).
-    (setq name (string-mark-left-to-right name)))
+    (setq name (bidi-string-mark-left-to-right name)))
   (add-text-properties 0 (length name) name-props name)
   (add-text-properties 0 (length size) size-props size)
   (let ((name+space-width (- Buffer-menu-buffer+size-width
index 746c16f..ecb626a 100644 (file)
@@ -342,7 +342,7 @@ Subexpression 2 must end right before the \\n or \\r.")
   "Face name used for dired marks.")
 
 (defface dired-marked
-  '((t (:inherit font-lock-warning-face)))
+  '((t (:inherit warning)))
   "Face used for marked files."
   :group 'dired-faces
   :version "22.1")
@@ -350,7 +350,7 @@ Subexpression 2 must end right before the \\n or \\r.")
   "Face name used for marked files.")
 
 (defface dired-flagged
-  '((t (:inherit font-lock-variable-name-face)))
+  '((t (:inherit error)))
   "Face used for files flagged for deletion."
   :group 'dired-faces
   :version "22.1")
index 9b485b5..75c9a01 100644 (file)
@@ -283,7 +283,7 @@ of column descriptors."
             (> (length label) width)
             (setq label (concat (substring label 0 (- width 3))
                                 "...")))
-       (setq label (string-mark-left-to-right label))
+       (setq label (bidi-string-mark-left-to-right label))
        (if (stringp desc)
            (insert (propertize label 'help-echo help-echo))
          (apply 'insert-text-button label (cdr desc)))
index 9a78ab6..404bd7b 100644 (file)
@@ -2413,6 +2413,39 @@ Note: Other faces cannot inherit from the cursor face."
 It is used for characters of no fonts too."
   :version "24.1"
   :group 'basic-faces)
+
+(defface error
+  '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold))
+    (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
+    (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold))
+    (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
+    (((class color) (min-colors 8)) (:foreground "red"))
+    (t (:inverse-video t :weight bold)))
+  "Basic face used to highlight errors and to denote failure."
+  :version "24.1"
+  :group 'basic-faces)
+
+(defface warning
+  '((((class color) (min-colors 16)) (:foreground "DarkOrange" :weight bold))
+    (((class color)) (:foreground "yellow" :weight bold))
+    (t (:weight bold)))
+  "Basic face used to highlight warnings."
+  :version "24.1"
+  :group 'basic-faces)
+
+(defface success
+  '((((class color) (min-colors 16) (background light))
+     (:foreground "Green3" :weight bold))
+    (((class color) (min-colors 88) (background dark))
+     (:foreground "Green1" :weight bold))
+    (((class color) (min-colors 16) (background dark))
+     (:foreground "Green" :weight bold))
+    (((class color)) (:foreground "green" :weight bold))
+    (t (:weight bold)))
+  "Basic face used to indicate successful operation."
+  :version "24.1"
+  :group 'basic-faces)
+
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Manipulating font names.
index 6902ce9..9cf889e 100644 (file)
@@ -1959,12 +1959,7 @@ Sets various variables using `font-lock-defaults' and
   :group 'font-lock-faces)
 
 (defface font-lock-warning-face
-  '((((class color) (min-colors 88) (background light)) (:foreground "Red1" :weight bold))
-    (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
-    (((class color) (min-colors 16) (background light)) (:foreground "Red1" :weight bold))
-    (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
-    (((class color) (min-colors 8)) (:foreground "red"))
-    (t (:inverse-video t :weight bold)))
+  '((t :inherit error))
   "Font Lock mode face used to highlight warnings."
   :group 'font-lock-faces)
 
index a9657c1..4742678 100644 (file)
@@ -114,6 +114,16 @@ A character which can't be placed at end of line.")
 Base characters (Unicode General Category L,N,P,S,Zs)")
 (define-category ?^ "Combining
 Combining diacritic or mark (Unicode General Category M)")
+
+;; bidi types
+(define-category ?R "Right-to-left (strong)
+Characters with \"strong\" right-to-left directionality, i.e.
+with R, AL, RLE, or RLO Unicode bidi character type.")
+
+(define-category ?L "Left-to-right (strong)
+Characters with \"strong\" left-to-right directionality, i.e.
+with L, LRE, or LRO Unicode bidi character type.")
+
 \f
 ;;; Setting syntax and category.
 
@@ -478,6 +488,16 @@ Combining diacritic or mark (Unicode General Category M)")
                  (modify-category-entry x category))
              chars)))))
 
+;; Bidi categories
+
+(map-char-table (lambda (key val)
+                 (cond
+                  ((memq val '(R AL RLO RLE))
+                   (modify-category-entry key ?R))
+                  ((memq val '(L LRE LRO))
+                   (modify-category-entry key ?L))))
+               (unicode-property-table-internal 'bidi-class))
+
 ;; Latin
 
 (modify-category-entry '(#x80 . #x024F) ?l)
index 503698f..f3b873c 100644 (file)
@@ -647,19 +647,19 @@ starting the compilation process.")
 (defvar compile-history nil)
 
 (defface compilation-error
-  '((t :inherit font-lock-warning-face))
+  '((t :inherit error))
   "Face used to highlight compiler errors."
   :group 'compilation
   :version "22.1")
 
 (defface compilation-warning
-  '((t :inherit font-lock-variable-name-face))
+  '((t :inherit warning))
   "Face used to highlight compiler warnings."
   :group 'compilation
   :version "22.1")
 
 (defface compilation-info
-  '((t :inherit font-lock-type-face))
+  '((t :inherit success))
   "Face used to highlight compiler information."
   :group 'compilation
   :version "22.1")
index a4251b6..9aa895b 100644 (file)
@@ -3539,30 +3539,23 @@ to case differences."
   (eq t (compare-strings str1 nil nil
                          str2 0 (length str1) ignore-case)))
 
-(defun string-mark-left-to-right (str)
+(defun bidi-string-mark-left-to-right (str)
   "Return a string that can be safely inserted in left-to-right text.
-If STR contains right-to-left (RTL) script, return a string
-consisting of STR followed by a terminating invisible
-left-to-right mark (LRM) character.
 
-The LRM character marks the end of an RTL segment, and resets the
-display direction of any subsequent text to left-to-right.
-\(Otherwise, some of that text might be displayed as part of the
-RTL segment, based on the bidirectional display algorithm.)
+Normally, inserting a string with right-to-left (RTL) script into
+a buffer may cause some subsequent text to be displayed as part
+of the RTL segment (usually this affects punctuation characters).
+This function returns a string which displays as STR but forces
+subsequent text to be displayed as left-to-right.
 
-If STR contains no RTL characters, return STR."
+If STR contains any RTL character, this function returns a string
+consisting of STR followed by an invisible left-to-right mark
+\(LRM) character.  Otherwise, it returns STR."
   (unless (stringp str)
     (signal 'wrong-type-argument (list 'stringp str)))
-  (let ((len (length str))
-       (n 0)
-       rtl-found)
-    (while (and (not rtl-found) (< n len))
-      (setq rtl-found (memq (get-char-code-property
-                            (aref str n) 'bidi-class) '(R AL RLO))
-           n (1+ n)))
-    (if rtl-found
-       (concat str (propertize (string ?\x200e) 'invisible t))
-      str)))
+  (if (string-match "\\cR" str)
+      (concat str (propertize (string ?\x200e) 'invisible t))
+    str))
 \f
 ;;;; invisibility specs
 
index fe8df6f..275856c 100644 (file)
        (gs_load): Use printmax_t to print the widest integers possible.
        Check for integer overflow when computing image height and width.
 
+2011-08-18  Eli Zaretskii  <eliz@gnu.org>
+
+       * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
+       members before the level stack, so they would be saved and
+       restored when copying iterator state.  Fixes incorrect reordering
+       around TABs covered by display properties.
+
+2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * process.c (Fnetwork_interface_list): Correctly determine buffer
+       size.
+
 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
 
        * eval.c (internal_condition_case, internal_condition_case_1)
index 14f2b3a..9cefea2 100644 (file)
@@ -1860,6 +1860,9 @@ struct bidi_it {
   EMACS_INT ignore_bn_limit;   /* position until which to ignore BNs */
   bidi_dir_t sor;              /* direction of start-of-run in effect */
   int scan_dir;                        /* direction of text scan, 1: forw, -1: back */
+  EMACS_INT disp_pos;          /* position of display string after ch */
+  int disp_prop_p;             /* if non-zero, there really is a
+                                  `display' property/string at disp_pos */
   int stack_idx;               /* index of current data on the stack */
   /* Note: Everything from here on is not copied/saved when the bidi
      iterator state is saved, pushed, or popped.  So only put here
@@ -1868,9 +1871,6 @@ struct bidi_it {
   struct bidi_string_data string;      /* string to reorder */
   bidi_dir_t paragraph_dir;    /* current paragraph direction */
   EMACS_INT separator_limit;   /* where paragraph separator should end */
-  EMACS_INT disp_pos;          /* position of display string after ch */
-  int disp_prop_p;             /* if non-zero, there really is a
-                                  `display' property/string at disp_pos */
   unsigned first_elt : 1;      /* if non-zero, examine current char first */
   unsigned new_paragraph : 1;  /* if non-zero, we expect a new paragraph */
   unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */
index 9f3bb0e..08da53b 100644 (file)
@@ -3581,33 +3581,31 @@ format; see the description of ADDRESS in `make-network-process'.  */)
   if (s < 0)
     return Qnil;
 
- again:
-
-  buf = xpalloc (buf, &buf_size, sizeof *ifreq, INT_MAX, 1);
-  ifconf.ifc_buf = buf;
-  ifconf.ifc_len = buf_size;
-  if (ioctl (s, SIOCGIFCONF, &ifconf))
+  do
     {
-      close (s);
-      xfree (buf);
-      return Qnil;
+      buf = xpalloc (buf, &buf_size, 1, INT_MAX, 1);
+      ifconf.ifc_buf = buf;
+      ifconf.ifc_len = buf_size;
+      if (ioctl (s, SIOCGIFCONF, &ifconf))
+       {
+         close (s);
+         xfree (buf);
+         return Qnil;
+       }
     }
-
-  if (ifconf.ifc_len == buf_size)
-    goto again;
+  while (ifconf.ifc_len == buf_size);
 
   close (s);
 
   res = Qnil;
-  for (ifreq = ifconf.ifc_req;
-       (char *) ifreq < (char *) (ifconf.ifc_req) + ifconf.ifc_len;
-       )
+  ifreq = ifconf.ifc_req;
+  while ((char *) ifreq < (char *) ifconf.ifc_req + ifconf.ifc_len)
     {
       struct ifreq *ifq = ifreq;
 #ifdef HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN
-#define SIZEOF_IFREQ(sif)                                               \
-      ((sif)->ifr_addr.sa_len < sizeof(struct sockaddr) ?               \
-       sizeof((*sif)) : sizeof ((sif)->ifr_name) + sif->ifr_addr.sa_len)
+#define SIZEOF_IFREQ(sif)                                              \
+      ((sif)->ifr_addr.sa_len < sizeof (struct sockaddr)               \
+       ? sizeof (*(sif)) : sizeof ((sif)->ifr_name) + (sif)->ifr_addr.sa_len)
 
       int len = SIZEOF_IFREQ (ifq);
 #else
@@ -3615,7 +3613,7 @@ format; see the description of ADDRESS in `make-network-process'.  */)
 #endif
       char namebuf[sizeof (ifq->ifr_name) + 1];
       i += len;
-      ifreq = (struct ifreq*) ((char*) ifreq + len);
+      ifreq = (struct ifreq *) ((char *) ifreq + len);
 
       if (ifq->ifr_addr.sa_family != AF_INET)
        continue;