Port to stricter C99 platforms.
[bpt/emacs.git] / src / fringe.c
index 1d05244..9c77e65 100644 (file)
@@ -20,6 +20,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <config.h>
 #include <stdio.h>
 
+#include <byteswap.h>
+
 #include "lisp.h"
 #include "frame.h"
 #include "window.h"
@@ -29,8 +31,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "blockinput.h"
 #include "termhooks.h"
 
-#ifdef HAVE_WINDOW_SYSTEM
-
 /* Fringe bitmaps are represented in three different ways:
 
    Logical bitmaps are used internally to denote things like
@@ -666,7 +666,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
                     and OTOH leaving out that one pixel leaves behind
                     traces of the cursor, if it was in column zero
                     before drawing non-empty margin area.  */
-                 && NILP (w->left_margin_cols))
+                 && w->left_margin_cols == 0)
                 ? 1 : 0);
          p.bx = x - wd;
          p.nx = wd;
@@ -1521,7 +1521,7 @@ init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p)
                                   | (swap_nibble[(b>>12) & 0xf]));
              b >>= (16 - fb->width);
 #ifdef WORDS_BIGENDIAN
-             b = ((b >> 8) | (b << 8));
+             b = bswap_16 (b);
 #endif
              *bits++ = b;
            }
@@ -1690,6 +1690,8 @@ If BITMAP already exists, the existing definition is replaced.  */)
 DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_face,
        1, 2, 0,
        doc: /* Set face for fringe bitmap BITMAP to FACE.
+FACE is merged with the `fringe' face, so normally FACE should specify
+only the foreground color.
 If FACE is nil, reset face to default fringe face.  */)
   (Lisp_Object bitmap, Lisp_Object face)
 {
@@ -1863,5 +1865,3 @@ w32_reset_fringes (void)
 }
 
 #endif /* HAVE_NTGUI */
-
-#endif /* HAVE_WINDOW_SYSTEM */