emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110185: image.c, indent.c: Use bool


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110185: image.c, indent.c: Use bool for booleans.
Date: Mon, 24 Sep 2012 14:38:23 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110185
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2012-09-24 14:38:23 -0700
message:
  image.c, indent.c: Use bool for booleans.
  
  * dispextern.h (struct image_type): Members valid_p, load, init
  now return bool, not int.  All uses changed.
  * image.c: Omit unnecessary static decls.
  (x_create_bitmap_mask, x_build_heuristic_mask):
  Return void, not int, since callers don't care about the return value.
  (x_create_bitmap_mask, define_image_type, valid_image_p)
  (struct image_keyword, parse_image_spec, image_spec_value)
  (check_image_size, image_background)
  (image_background_transparent, x_clear_image_1)
  (postprocess_image, lookup_image, x_check_image_size)
  (x_create_x_image_and_pixmap, xbm_image_p)
  (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
  (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
  (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
  (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
  (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
  (png_image_p, init_png_functions, png_load_body, png_load)
  (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
  (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
  (init_gif_functions, gif_load, imagemagick_image_p)
  (imagemagick_load_image, imagemagick_load, svg_image_p)
  (init_svg_functions, svg_load, svg_load_image, gs_image_p)
  (gs_load):
  * nsimage.m (ns_load_image):
  * nsterm.m (ns_defined_color):
  * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
  * xfns.c (x_defined_color):
  * xterm.c (x_alloc_lighter_color_for_widget)
  (x_alloc_nearest_color_1, x_alloc_nearest_color)
  (x_alloc_lighter_color):
  * indent.c (disptab_matches_widthtab, current_column)
  (scan_for_column, string_display_width, indented_beyond_p)
  (compute_motion, vmotion, Fvertical_motion):
  Use bool for booleans.
modified:
  src/ChangeLog
  src/dispextern.h
  src/image.c
  src/indent.c
  src/indent.h
  src/lisp.h
  src/nsimage.m
  src/nsterm.h
  src/nsterm.m
  src/xfaces.c
  src/xfns.c
  src/xterm.c
  src/xterm.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-24 12:23:25 +0000
+++ b/src/ChangeLog     2012-09-24 21:38:23 +0000
@@ -1,3 +1,41 @@
+2012-09-24  Paul Eggert  <address@hidden>
+
+       image.c, indent.c: Use bool for booleans.
+       * dispextern.h (struct image_type): Members valid_p, load, init
+       now return bool, not int.  All uses changed.
+       * image.c: Omit unnecessary static decls.
+       (x_create_bitmap_mask, x_build_heuristic_mask):
+       Return void, not int, since callers don't care about the return value.
+       (x_create_bitmap_mask, define_image_type, valid_image_p)
+       (struct image_keyword, parse_image_spec, image_spec_value)
+       (check_image_size, image_background)
+       (image_background_transparent, x_clear_image_1)
+       (postprocess_image, lookup_image, x_check_image_size)
+       (x_create_x_image_and_pixmap, xbm_image_p)
+       (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
+       (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
+       (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
+       (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
+       (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
+       (png_image_p, init_png_functions, png_load_body, png_load)
+       (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
+       (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
+       (init_gif_functions, gif_load, imagemagick_image_p)
+       (imagemagick_load_image, imagemagick_load, svg_image_p)
+       (init_svg_functions, svg_load, svg_load_image, gs_image_p)
+       (gs_load):
+       * nsimage.m (ns_load_image):
+       * nsterm.m (ns_defined_color):
+       * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
+       * xfns.c (x_defined_color):
+       * xterm.c (x_alloc_lighter_color_for_widget)
+       (x_alloc_nearest_color_1, x_alloc_nearest_color)
+       (x_alloc_lighter_color):
+       * indent.c (disptab_matches_widthtab, current_column)
+       (scan_for_column, string_display_width, indented_beyond_p)
+       (compute_motion, vmotion, Fvertical_motion):
+       Use bool for booleans.
+
 2012-09-24  Chong Yidong  <address@hidden>
 
        * chartab.c (Fset_char_table_default): Obsolete function removed.

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2012-09-23 09:16:57 +0000
+++ b/src/dispextern.h  2012-09-24 21:38:23 +0000
@@ -2757,19 +2757,19 @@
   Lisp_Object *type;
 
   /* Check that SPEC is a valid image specification for the given
-     image type.  Value is non-zero if SPEC is valid.  */
-  int (* valid_p) (Lisp_Object spec);
+     image type.  Value is true if SPEC is valid.  */
+  bool (* valid_p) (Lisp_Object spec);
 
   /* Load IMG which is used on frame F from information contained in
-     IMG->spec.  Value is non-zero if successful.  */
-  int (* load) (struct frame *f, struct image *img);
+     IMG->spec.  Value is true if successful.  */
+  bool (* load) (struct frame *f, struct image *img);
 
   /* Free resources of image IMG which is used on frame F.  */
   void (* free) (struct frame *f, struct image *img);
 
   /* Initialization function (used for dynamic loading of image
      libraries on Windows), or NULL if none.  */
-  int (* init) (void);
+  bool (* init) (void);
 
   /* Next in list of all supported image types.  */
   struct image_type *next;
@@ -3169,7 +3169,7 @@
 extern void x_destroy_bitmap (struct frame *, ptrdiff_t);
 #endif
 extern void x_destroy_all_bitmaps (Display_Info *);
-extern int x_create_bitmap_mask (struct frame *, ptrdiff_t);
+extern void x_create_bitmap_mask (struct frame *, ptrdiff_t);
 extern Lisp_Object x_find_image_file (Lisp_Object);
 
 void x_kill_gs_process (Pixmap, struct frame *);
@@ -3177,7 +3177,7 @@
 void free_image_cache (struct frame *);
 void clear_image_caches (Lisp_Object);
 void mark_image_cache (struct image_cache *);
-int valid_image_p (Lisp_Object);
+bool valid_image_p (Lisp_Object);
 void prepare_image_for_display (struct frame *, struct image *);
 ptrdiff_t lookup_image (struct frame *, Lisp_Object);
 

=== modified file 'src/image.c'
--- a/src/image.c       2012-09-23 09:25:21 +0000
+++ b/src/image.c       2012-09-24 21:38:23 +0000
@@ -429,6 +429,9 @@
   dpyinfo->bitmaps_last = 0;
 }
 
+static bool x_create_x_image_and_pixmap (struct frame *, int, int, int,
+                                        XImagePtr *, Pixmap *);
+static void x_destroy_x_image (XImagePtr ximg);
 
 #ifdef HAVE_X_WINDOWS
 
@@ -440,23 +443,17 @@
                                         unsigned long width,
                                         unsigned long height);
 
-static int x_create_x_image_and_pixmap (struct frame *f, int width, int height,
-                                        int depth, XImagePtr *ximg,
-                                        Pixmap *pixmap);
-
-static void x_destroy_x_image (XImagePtr ximg);
-
 
 /* Create a mask of a bitmap. Note is this not a perfect mask.
    It's nicer with some borders in this context */
 
-int
+void
 x_create_bitmap_mask (struct frame *f, ptrdiff_t id)
 {
   Pixmap pixmap, mask;
   XImagePtr ximg, mask_img;
   unsigned long width, height;
-  int result;
+  bool result;
   unsigned long bg;
   unsigned long x, y, xp, xm, yp, ym;
   GC gc;
@@ -464,7 +461,7 @@
   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
 
   if (!(id > 0))
-    return -1;
+    return;
 
   pixmap = x_bitmap_pixmap (f, id);
   width = x_bitmap_width (f, id);
@@ -477,7 +474,7 @@
   if (!ximg)
     {
       unblock_input ();
-      return -1;
+      return;
     }
 
   result = x_create_x_image_and_pixmap (f, width, height, 1, &mask_img, &mask);
@@ -486,7 +483,7 @@
   if (!result)
     {
       XDestroyImage (ximg);
-      return -1;
+      return;
     }
 
   bg = four_corners_best (ximg, NULL, width, height);
@@ -525,8 +522,6 @@
 
   XDestroyImage (ximg);
   x_destroy_x_image (mask_img);
-
-  return 0;
 }
 
 #endif /* HAVE_X_WINDOWS */
@@ -559,15 +554,13 @@
 static Lisp_Object Qcount, Qextension_data, Qdelay;
 static Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic;
 
-/* Function prototypes.  */
+/* Forward function prototypes.  */
 
-static struct image_type *define_image_type (struct image_type *);
 static struct image_type *lookup_image_type (Lisp_Object);
-static void image_error (const char *format, Lisp_Object, Lisp_Object);
 static void x_laplace (struct frame *, struct image *);
 static void x_emboss (struct frame *, struct image *);
-static int x_build_heuristic_mask (struct frame *, struct image *,
-                                   Lisp_Object);
+static void x_build_heuristic_mask (struct frame *, struct image *,
+                                   Lisp_Object);
 #ifdef HAVE_NTGUI
 #define CACHE_IMAGE_TYPE(type, status) \
   do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while 
(0)
@@ -586,7 +579,7 @@
 {
   struct image_type *p = NULL;
   Lisp_Object target_type = *type->type;
-  int type_valid = 1;
+  bool type_valid = 1;
 
   block_input ();
 
@@ -625,17 +618,17 @@
 }
 
 
-/* Value is non-zero if OBJECT is a valid Lisp image specification.  A
+/* Value is true if OBJECT is a valid Lisp image specification.  A
    valid image specification is a list whose car is the symbol
    `image', and whose rest is a property list.  The property list must
    contain a value for key `:type'.  That value must be the name of a
    supported image type.  The rest of the property list depends on the
    image type.  */
 
-int
+bool
 valid_image_p (Lisp_Object object)
 {
-  int valid_p = 0;
+  bool valid_p = 0;
 
   if (IMAGEP (object))
     {
@@ -705,8 +698,8 @@
   /* The type of value allowed.  */
   enum image_value_type type;
 
-  /* Non-zero means key must be present.  */
-  int mandatory_p;
+  /* True means key must be present.  */
+  bool mandatory_p;
 
   /* Used to recognize duplicate keywords in a property list.  */
   int count;
@@ -716,18 +709,13 @@
 };
 
 
-static int parse_image_spec (Lisp_Object, struct image_keyword *,
-                             int, Lisp_Object);
-static Lisp_Object image_spec_value (Lisp_Object, Lisp_Object, int *);
-
-
 /* Parse image spec SPEC according to KEYWORDS.  A valid image spec
    has the format (image KEYWORD VALUE ...).  One of the keyword/
    value pairs must be `:type TYPE'.  KEYWORDS is a vector of
    image_keywords structures of size NKEYWORDS describing other
-   allowed keyword/value pairs.  Value is non-zero if SPEC is valid.  */
+   allowed keyword/value pairs.  Value is true if SPEC is valid.  */
 
-static int
+static bool
 parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
                  int nkeywords, Lisp_Object type)
 {
@@ -859,11 +847,11 @@
 
 
 /* Return the value of KEY in image specification SPEC.  Value is nil
-   if KEY is not present in SPEC.  if FOUND is not null, set *FOUND
-   to 1 if KEY was found in SPEC, set it to 0 otherwise.  */
+   if KEY is not present in SPEC.  Set *FOUND depending on whether KEY
+   was found in SPEC.  */
 
 static Lisp_Object
-image_spec_value (Lisp_Object spec, Lisp_Object key, int *found)
+image_spec_value (Lisp_Object spec, Lisp_Object key, bool *found)
 {
   Lisp_Object tail;
 
@@ -967,8 +955,6 @@
                 Image type independent image structures
  ***********************************************************************/
 
-static void free_image (struct frame *f, struct image *img);
-
 #define MAX_IMAGE_SIZE 10.0
 /* Allocate and return a new image structure for image specification
    SPEC.  SPEC has a hash value of HASH.  */
@@ -1018,10 +1004,9 @@
     }
 }
 
-/* Return 1 if the given widths and heights are valid for display;
-   otherwise, return 0. */
+/* Return true if the given widths and heights are valid for display.  */
 
-static int
+static bool
 check_image_size (struct frame *f, int width, int height)
 {
   int w, h;
@@ -1060,7 +1045,7 @@
   /* If IMG doesn't have a pixmap yet, load it now, using the image
      type dependent loader function.  */
   if (img->pixmap == NO_PIXMAP && !img->load_failed_p)
-    img->load_failed_p = img->type->load (f, img) == 0;
+    img->load_failed_p = ! img->type->load (f, img);
 
 }
 
@@ -1193,7 +1178,7 @@
   if (! img->background_valid)
     /* IMG doesn't have a background yet, try to guess a reasonable value.  */
     {
-      int free_ximg = !ximg;
+      bool free_ximg = !ximg;
 #ifdef HAVE_NTGUI
       HGDIOBJ prev;
 #endif /* HAVE_NTGUI */
@@ -1234,7 +1219,7 @@
     {
       if (img->mask)
        {
-         int free_mask = !mask;
+         bool free_mask = !mask;
 #ifdef HAVE_NTGUI
          HGDIOBJ prev;
 #endif /* HAVE_NTGUI */
@@ -1272,23 +1257,13 @@
                  Helper functions for X image types
  ***********************************************************************/
 
-static void x_clear_image_1 (struct frame *, struct image *, int,
-                             int, int);
-static void x_clear_image (struct frame *f, struct image *img);
-static unsigned long x_alloc_image_color (struct frame *f,
-                                          struct image *img,
-                                          Lisp_Object color_name,
-                                          unsigned long dflt);
-
-
-/* Clear X resources of image IMG on frame F.  PIXMAP_P non-zero means
-   free the pixmap if any.  MASK_P non-zero means clear the mask
-   pixmap if any.  COLORS_P non-zero means free colors allocated for
-   the image, if any.  */
+/* Clear X resources of image IMG on frame F.  PIXMAP_P means free the
+   pixmap if any.  MASK_P means clear the mask pixmap if any.
+   COLORS_P means free colors allocated for the image, if any.  */
 
 static void
-x_clear_image_1 (struct frame *f, struct image *img, int pixmap_p, int mask_p,
-                int colors_p)
+x_clear_image_1 (struct frame *f, struct image *img, bool pixmap_p,
+                bool mask_p, bool colors_p)
 {
   if (pixmap_p && img->pixmap)
     {
@@ -1368,7 +1343,6 @@
  ***********************************************************************/
 
 static void cache_image (struct frame *f, struct image *img);
-static void postprocess_image (struct frame *, struct image *);
 
 /* Return a new, initialized image cache that is allocated from the
    heap.  Call free_image_cache to free an image cache.  */
@@ -1641,7 +1615,7 @@
        x_build_heuristic_mask (f, img, mask);
       else
        {
-         int found_p;
+         bool found_p;
 
          mask = image_spec_value (spec, QCmask, &found_p);
 
@@ -1714,7 +1688,7 @@
       block_input ();
       img = make_image (spec, hash);
       cache_image (f, img);
-      img->load_failed_p = img->type->load (f, img) == 0;
+      img->load_failed_p = ! img->type->load (f, img);
       img->frame_foreground = FRAME_FOREGROUND_PIXEL (f);
       img->frame_background = FRAME_BACKGROUND_PIXEL (f);
 
@@ -1873,16 +1847,11 @@
 
 #endif /* HAVE_NTGUI */
 
-static int x_create_x_image_and_pixmap (struct frame *, int, int, int,
-                                        XImagePtr *, Pixmap *);
-static void x_destroy_x_image (XImagePtr);
-static void x_put_x_image (struct frame *, XImagePtr, Pixmap, int, int);
-
-/* Return nonzero if XIMG's size WIDTH x HEIGHT doesn't break the
+/* Return true if XIMG's size WIDTH x HEIGHT doesn't break the
    windowing system.
    WIDTH and HEIGHT must both be positive.
    If XIMG is null, assume it is a bitmap.  */
-static int
+static bool
 x_check_image_size (XImagePtr ximg, int width, int height)
 {
 #ifdef HAVE_X_WINDOWS
@@ -1921,12 +1890,12 @@
    frame F.  Set *XIMG and *PIXMAP to the XImage and Pixmap created.
    Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels allocated
    via xmalloc.  Print error messages via image_error if an error
-   occurs.  Value is non-zero if successful.
+   occurs.  Value is true if successful.
 
    On W32, a DEPTH of zero signifies a 24 bit image, otherwise DEPTH
    should indicate the bit depth of the image.  */
 
-static int
+static bool
 x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
                             XImagePtr *ximg, Pixmap *pixmap)
 {
@@ -2198,15 +2167,9 @@
                              XBM images
  ***********************************************************************/
 
-static int xbm_scan (unsigned char **, unsigned char *, char *, int *);
-static int xbm_load (struct frame *f, struct image *img);
-static int xbm_load_image (struct frame *f, struct image *img,
-                           unsigned char *, unsigned char *);
-static int xbm_image_p (Lisp_Object object);
-static int xbm_read_bitmap_data (struct frame *f,
-                                 unsigned char *, unsigned char *,
-                                 int *, int *, char **, int);
-static int xbm_file_p (Lisp_Object);
+static bool xbm_load (struct frame *f, struct image *img);
+static bool xbm_image_p (Lisp_Object object);
+static bool xbm_file_p (Lisp_Object);
 
 
 /* Indices of image specification fields in xbm_format, below.  */
@@ -2270,10 +2233,10 @@
 };
 
 
-/* Return non-zero if OBJECT is a valid XBM-type image specification.
+/* Return true if OBJECT is a valid XBM-type image specification.
    A valid specification is a list starting with the symbol `image'
    The rest of the list is a property list which must contain an
-   entry `:type xbm..
+   entry `:type xbm'.
 
    If the specification specifies a file to load, it must contain
    an entry `:file FILENAME' where FILENAME is a string.
@@ -2299,7 +2262,7 @@
    foreground and background of the frame on which the image is
    displayed is used.  */
 
-static int
+static bool
 xbm_image_p (Lisp_Object object)
 {
   struct image_keyword kw[XBM_LAST];
@@ -2557,7 +2520,7 @@
 static void
 Create_Pixmap_From_Bitmap_Data (struct frame *f, struct image *img, char *data,
                                RGB_PIXEL_COLOR fg, RGB_PIXEL_COLOR bg,
-                               int non_default_colors)
+                               bool non_default_colors)
 {
 #ifdef HAVE_NTGUI
   img->pixmap
@@ -2589,20 +2552,20 @@
    X versions.  CONTENTS is a pointer to a buffer to parse; END is the
    buffer's end.  Set *WIDTH and *HEIGHT to the width and height of
    the image.  Return in *DATA the bitmap data allocated with xmalloc.
-   Value is non-zero if successful.  DATA null means just test if
-   CONTENTS looks like an in-memory XBM file.  If INHIBIT_IMAGE_ERROR
-   is non-zero, inhibit the call to image_error when the image size is
-   invalid (the bitmap remains unread).  */
+   Value is true if successful.  DATA null means just test if
+   CONTENTS looks like an in-memory XBM file.  If INHIBIT_IMAGE_ERROR,
+   inhibit the call to image_error when the image size is invalid (the
+   bitmap remains unread).  */
 
-static int
+static bool
 xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char 
*end,
                      int *width, int *height, char **data,
-                     int inhibit_image_error)
+                     bool inhibit_image_error)
 {
   unsigned char *s = contents;
   char buffer[BUFSIZ];
-  int padding_p = 0;
-  int v10 = 0;
+  bool padding_p = 0;
+  bool v10 = 0;
   int bytes_per_line, i, nbytes;
   char *p;
   int value;
@@ -2749,16 +2712,16 @@
 
 
 /* Load XBM image IMG which will be displayed on frame F from buffer
-   CONTENTS.  END is the end of the buffer.  Value is non-zero if
+   CONTENTS.  END is the end of the buffer.  Value is true if
    successful.  */
 
-static int
+static bool
 xbm_load_image (struct frame *f, struct image *img, unsigned char *contents,
                unsigned char *end)
 {
-  int rc;
+  bool rc;
   char *data;
-  int success_p = 0;
+  bool success_p = 0;
 
   rc = xbm_read_bitmap_data (f, contents, end, &img->width, &img->height,
                             &data, 0);
@@ -2766,7 +2729,7 @@
     {
       unsigned long foreground = FRAME_FOREGROUND_PIXEL (f);
       unsigned long background = FRAME_BACKGROUND_PIXEL (f);
-      int non_default_colors = 0;
+      bool non_default_colors = 0;
       Lisp_Object value;
 
       eassert (img->width > 0 && img->height > 0);
@@ -2807,9 +2770,9 @@
 }
 
 
-/* Value is non-zero if DATA looks like an in-memory XBM file.  */
+/* Value is true if DATA looks like an in-memory XBM file.  */
 
-static int
+static bool
 xbm_file_p (Lisp_Object data)
 {
   int w, h;
@@ -2821,12 +2784,12 @@
 
 
 /* Fill image IMG which is used on frame F with pixmap data.  Value is
-   non-zero if successful.  */
+   true if successful.  */
 
-static int
+static bool
 xbm_load (struct frame *f, struct image *img)
 {
-  int success_p = 0;
+  bool success_p = 0;
   Lisp_Object file_name;
 
   eassert (xbm_image_p (img->spec));
@@ -2862,10 +2825,10 @@
       Lisp_Object data;
       unsigned long foreground = FRAME_FOREGROUND_PIXEL (f);
       unsigned long background = FRAME_BACKGROUND_PIXEL (f);
-      int non_default_colors = 0;
+      bool non_default_colors = 0;
       char *bits;
-      int parsed_p;
-      int in_memory_file_p = 0;
+      bool parsed_p;
+      bool in_memory_file_p = 0;
 
       /* See if data looks like an in-memory XBM file.  */
       data = image_spec_value (img->spec, QCdata, NULL);
@@ -2874,7 +2837,6 @@
       /* Parse the image specification.  */
       memcpy (fmt, xbm_format, sizeof fmt);
       parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm);
-      (void) parsed_p;
       eassert (parsed_p);
 
       /* Get specified width, and height.  */
@@ -2979,9 +2941,8 @@
 
 #if defined (HAVE_XPM) || defined (HAVE_NS)
 
-static int xpm_image_p (Lisp_Object object);
-static int xpm_load (struct frame *f, struct image *img);
-static int xpm_valid_color_symbols_p (Lisp_Object);
+static bool xpm_image_p (Lisp_Object object);
+static bool xpm_load (struct frame *f, struct image *img);
 
 #endif /* HAVE_XPM || HAVE_NS */
 
@@ -3048,7 +3009,7 @@
 };
 
 #ifdef HAVE_NTGUI
-static int init_xpm_functions (void);
+static bool init_xpm_functions (void);
 #else
 #define init_xpm_functions NULL
 #endif
@@ -3079,10 +3040,6 @@
 
 #ifdef ALLOC_XPM_COLORS
 
-static void xpm_init_color_cache (struct frame *, XpmAttributes *);
-static void xpm_free_color_cache (void);
-static int xpm_lookup_color (struct frame *, char *, XColor *);
-static int xpm_color_bucket (char *);
 static struct xpm_cached_color *xpm_cache_color (struct frame *, char *,
                                                  XColor *, int);
 
@@ -3189,10 +3146,10 @@
 
 /* Look up color COLOR_NAME for frame F in the color cache.  If found,
    return the cached definition in *COLOR.  Otherwise, make a new
-   entry in the cache and allocate the color.  Value is zero if color
+   entry in the cache and allocate the color.  Value is false if color
    allocation failed.  */
 
-static int
+static bool
 xpm_lookup_color (struct frame *f, char *color_name, XColor *color)
 {
   struct xpm_cached_color *p;
@@ -3261,7 +3218,7 @@
                                    xpm_XImage **, XpmAttributes *));
 DEF_IMGLIB_FN (void, XImageFree, (xpm_XImage *));
 
-static int
+static bool
 init_xpm_functions (void)
 {
   HMODULE library;
@@ -3279,11 +3236,11 @@
 #endif /* HAVE_NTGUI */
 
 
-/* Value is non-zero if COLOR_SYMBOLS is a valid color symbols list
+/* Value is true if COLOR_SYMBOLS is a valid color symbols list
    for XPM images.  Such a list must consist of conses whose car and
    cdr are strings.  */
 
-static int
+static bool
 xpm_valid_color_symbols_p (Lisp_Object color_symbols)
 {
   while (CONSP (color_symbols))
@@ -3300,9 +3257,9 @@
 }
 
 
-/* Value is non-zero if OBJECT is a valid XPM image specification.  */
+/* Value is true if OBJECT is a valid XPM image specification.  */
 
-static int
+static bool
 xpm_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[XPM_LAST];
@@ -3359,11 +3316,11 @@
 #endif /* defined (HAVE_XPM) && defined (HAVE_X_WINDOWS) */
 
 /* Load image IMG which will be displayed on frame F.  Value is
-   non-zero if successful.  */
+   true if successful.  */
 
 #ifdef HAVE_XPM
 
-static int
+static bool
 xpm_load (struct frame *f, struct image *img)
 {
   int rc;
@@ -3817,7 +3774,7 @@
   return -1;
 }
 
-static int
+static bool
 xpm_load_image (struct frame *f,
                 struct image *img,
                 const unsigned char *contents,
@@ -3832,7 +3789,8 @@
   void (*put_color_table) (Lisp_Object, const unsigned char *, int, 
Lisp_Object);
   Lisp_Object (*get_color_table) (Lisp_Object, const unsigned char *, int);
   Lisp_Object frame, color_symbols, color_table;
-  int best_key, have_mask = 0;
+  int best_key;
+  bool have_mask = 0;
   XImagePtr ximg = NULL, mask_img = NULL;
 
 #define match() \
@@ -4052,11 +4010,11 @@
 #undef expect_ident
 }
 
-static int
+static bool
 xpm_load (struct frame *f,
           struct image *img)
 {
-  int success_p = 0;
+  bool success_p = 0;
   Lisp_Object file_name;
 
   /* If IMG->spec specifies a file name, create a non-file spec from it.  */
@@ -4227,7 +4185,7 @@
 #ifdef HAVE_X_WINDOWS
       XColor color;
       Colormap cmap;
-      int rc;
+      bool rc;
 #else
       COLORREF color;
 #endif
@@ -4295,7 +4253,7 @@
     {
       XColor color;
       Colormap cmap;
-      int rc;
+      bool rc;
 
       if (ct_colors_allocated_max <= ct_colors_allocated)
        return FRAME_FOREGROUND_PIXEL (f);
@@ -4389,14 +4347,6 @@
                              Algorithms
  ***********************************************************************/
 
-static XColor *x_to_xcolors (struct frame *, struct image *, int);
-static void x_from_xcolors (struct frame *, struct image *, XColor *);
-static void x_detect_edges (struct frame *, struct image *, int[9], int);
-
-#ifdef HAVE_NTGUI
-static void XPutPixel (XImagePtr , int, int, COLORREF);
-#endif /* HAVE_NTGUI */
-
 /* Edge detection matrices for different edge-detection
    strategies.  */
 
@@ -4422,12 +4372,12 @@
 
 /* On frame F, return an array of XColor structures describing image
    IMG->pixmap.  Each XColor structure has its pixel color set.  RGB_P
-   non-zero means also fill the red/green/blue members of the XColor
+   means also fill the red/green/blue members of the XColor
    structures.  Value is a pointer to the array of XColors structures,
    allocated with xmalloc; it must be freed by the caller.  */
 
 static XColor *
-x_to_xcolors (struct frame *f, struct image *img, int rgb_p)
+x_to_xcolors (struct frame *f, struct image *img, bool rgb_p)
 {
   int x, y;
   XColor *colors, *p;
@@ -4803,9 +4753,9 @@
    determine the background color of IMG.  If it is a list '(R G B)',
    with R, G, and B being integers >= 0, take that as the color of the
    background.  Otherwise, determine the background color of IMG
-   heuristically.  Value is non-zero if successful. */
+   heuristically.  */
 
-static int
+static void
 x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
 {
   XImagePtr_or_DC ximg;
@@ -4817,7 +4767,8 @@
   char *mask_img;
   int row_width;
 #endif /* HAVE_NTGUI */
-  int x, y, rc, use_img_background;
+  int x, y;
+  bool rc, use_img_background;
   unsigned long bg = 0;
 
   if (img->mask)
@@ -4833,7 +4784,7 @@
   rc = x_create_x_image_and_pixmap (f, img->width, img->height, 1,
                                    &mask_img, &img->mask);
   if (!rc)
-    return 0;
+    return;
 #endif /* !HAVE_NS */
 
   /* Get the X image of IMG->pixmap.  */
@@ -4923,8 +4874,6 @@
 #endif /* HAVE_NTGUI */
 
   Destroy_Image (ximg, prev);
-
-  return 1;
 }
 
 
@@ -4932,9 +4881,8 @@
                       PBM (mono, gray, color)
  ***********************************************************************/
 
-static int pbm_image_p (Lisp_Object object);
-static int pbm_load (struct frame *f, struct image *img);
-static int pbm_scan_number (unsigned char **, unsigned char *);
+static bool pbm_image_p (Lisp_Object object);
+static bool pbm_load (struct frame *f, struct image *img);
 
 /* The symbol `pbm' identifying images of this type.  */
 
@@ -4989,9 +4937,9 @@
 };
 
 
-/* Return non-zero if OBJECT is a valid PBM image specification.  */
+/* Return true if OBJECT is a valid PBM image specification.  */
 
-static int
+static bool
 pbm_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[PBM_LAST];
@@ -5084,10 +5032,11 @@
 
 /* Load PBM image IMG for use on frame F.  */
 
-static int
+static bool
 pbm_load (struct frame *f, struct image *img)
 {
-  int raw_p, x, y;
+  bool raw_p;
+  int x, y;
   int width, height, max_color_idx = 0;
   XImagePtr ximg;
   Lisp_Object file, specified_file;
@@ -5350,8 +5299,8 @@
 
 /* Function prototypes.  */
 
-static int png_image_p (Lisp_Object object);
-static int png_load (struct frame *f, struct image *img);
+static bool png_image_p (Lisp_Object object);
+static bool png_load (struct frame *f, struct image *img);
 
 /* The symbol `png' identifying images of this type.  */
 
@@ -5392,7 +5341,7 @@
 };
 
 #ifdef HAVE_NTGUI
-static int init_png_functions (void);
+static bool init_png_functions (void);
 #else
 #define init_png_functions NULL
 #endif
@@ -5409,9 +5358,9 @@
   NULL
 };
 
-/* Return non-zero if OBJECT is a valid PNG image specification.  */
+/* Return true if OBJECT is a valid PNG image specification.  */
 
-static int
+static bool
 png_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[PNG_LAST];
@@ -5463,7 +5412,7 @@
 DEF_IMGLIB_FN (jmp_buf *, png_set_longjmp_fn, (png_structp, png_longjmp_ptr, 
size_t));
 #endif /* libpng version >= 1.5 */
 
-static int
+static bool
 init_png_functions (void)
 {
   HMODULE library;
@@ -5614,7 +5563,7 @@
 }
 
 
-/* Load PNG image IMG for use on frame F.  Value is non-zero if
+/* Load PNG image IMG for use on frame F.  Value is true if
    successful.  */
 
 struct png_load_context
@@ -5628,7 +5577,7 @@
   png_byte **rows;
 };
 
-static int
+static bool
 png_load_body (struct frame *f, struct image *img, struct png_load_context *c)
 {
   Lisp_Object file, specified_file;
@@ -5646,7 +5595,7 @@
   int bit_depth, color_type, interlace_type;
   png_byte channels;
   png_uint_32 row_bytes;
-  int transparent_p;
+  bool transparent_p;
   struct png_memory_storage tbr;  /* Data to be read */
 
   /* Find out what file to load.  */
@@ -5979,7 +5928,7 @@
   return 1;
 }
 
-static int
+static bool
 png_load (struct frame *f, struct image *img)
 {
   struct png_load_context c;
@@ -5989,7 +5938,7 @@
 #else /* HAVE_PNG */
 
 #ifdef HAVE_NS
-static int
+static bool
 png_load (struct frame *f, struct image *img)
 {
   return ns_load_image (f, img,
@@ -6009,8 +5958,8 @@
 
 #if defined (HAVE_JPEG) || defined (HAVE_NS)
 
-static int jpeg_image_p (Lisp_Object object);
-static int jpeg_load (struct frame *f, struct image *img);
+static bool jpeg_image_p (Lisp_Object object);
+static bool jpeg_load (struct frame *f, struct image *img);
 
 /* The symbol `jpeg' identifying images of this type.  */
 
@@ -6051,7 +6000,7 @@
 };
 
 #ifdef HAVE_NTGUI
-static int init_jpeg_functions (void);
+static bool init_jpeg_functions (void);
 #else
 #define init_jpeg_functions NULL
 #endif
@@ -6068,9 +6017,9 @@
   NULL
 };
 
-/* Return non-zero if OBJECT is a valid JPEG image specification.  */
+/* Return true if OBJECT is a valid JPEG image specification.  */
 
-static int
+static bool
 jpeg_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[JPEG_LAST];
@@ -6119,7 +6068,7 @@
 DEF_IMGLIB_FN (struct jpeg_error_mgr *, jpeg_std_error, (struct jpeg_error_mgr 
*));
 DEF_IMGLIB_FN (boolean, jpeg_resync_to_restart, (j_decompress_ptr, int));
 
-static int
+static bool
 init_jpeg_functions (void)
 {
   HMODULE library;
@@ -6389,7 +6338,7 @@
 /* Load image IMG for use on frame F.  Patterned after example.c
    from the JPEG lib.  */
 
-static int
+static bool
 jpeg_load_body (struct frame *f, struct image *img,
                struct my_jpeg_error_mgr *mgr)
 {
@@ -6570,7 +6519,7 @@
   return 1;
 }
 
-static int
+static bool
 jpeg_load (struct frame *f, struct image *img)
 {
   struct my_jpeg_error_mgr mgr;
@@ -6580,7 +6529,7 @@
 #else /* HAVE_JPEG */
 
 #ifdef HAVE_NS
-static int
+static bool
 jpeg_load (struct frame *f, struct image *img)
 {
   return ns_load_image (f, img,
@@ -6599,8 +6548,8 @@
 
 #if defined (HAVE_TIFF) || defined (HAVE_NS)
 
-static int tiff_image_p (Lisp_Object object);
-static int tiff_load (struct frame *f, struct image *img);
+static bool tiff_image_p (Lisp_Object object);
+static bool tiff_load (struct frame *f, struct image *img);
 
 /* The symbol `tiff' identifying images of this type.  */
 
@@ -6643,7 +6592,7 @@
 };
 
 #ifdef HAVE_NTGUI
-static int init_tiff_functions (void);
+static bool init_tiff_functions (void);
 #else
 #define init_tiff_functions NULL
 #endif
@@ -6660,9 +6609,9 @@
   NULL
 };
 
-/* Return non-zero if OBJECT is a valid TIFF image specification.  */
+/* Return true if OBJECT is a valid TIFF image specification.  */
 
-static int
+static bool
 tiff_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[TIFF_LAST];
@@ -6696,7 +6645,7 @@
 DEF_IMGLIB_FN (void, TIFFClose, (TIFF *));
 DEF_IMGLIB_FN (int, TIFFSetDirectory, (TIFF *, tdir_t));
 
-static int
+static bool
 init_tiff_functions (void)
 {
   HMODULE library;
@@ -6866,10 +6815,10 @@
 }
 
 
-/* Load TIFF image IMG for use on frame F.  Value is non-zero if
+/* Load TIFF image IMG for use on frame F.  Value is true if
    successful.  */
 
-static int
+static bool
 tiff_load (struct frame *f, struct image *img)
 {
   Lisp_Object file, specified_file;
@@ -7034,7 +6983,7 @@
 #else /* HAVE_TIFF */
 
 #ifdef HAVE_NS
-static int
+static bool
 tiff_load (struct frame *f, struct image *img)
 {
   return ns_load_image (f, img,
@@ -7053,8 +7002,8 @@
 
 #if defined (HAVE_GIF) || defined (HAVE_NS)
 
-static int gif_image_p (Lisp_Object object);
-static int gif_load (struct frame *f, struct image *img);
+static bool gif_image_p (Lisp_Object object);
+static bool gif_load (struct frame *f, struct image *img);
 static void gif_clear_image (struct frame *f, struct image *img);
 
 /* The symbol `gif' identifying images of this type.  */
@@ -7098,7 +7047,7 @@
 };
 
 #ifdef HAVE_NTGUI
-static int init_gif_functions (void);
+static bool init_gif_functions (void);
 #else
 #define init_gif_functions NULL
 #endif
@@ -7124,9 +7073,9 @@
   x_clear_image (f, img);
 }
 
-/* Return non-zero if OBJECT is a valid GIF image specification.  */
+/* Return true if OBJECT is a valid GIF image specification.  */
 
-static int
+static bool
 gif_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[GIF_LAST];
@@ -7169,7 +7118,7 @@
 DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc));
 DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *));
 
-static int
+static bool
 init_gif_functions (void)
 {
   HMODULE library;
@@ -7223,7 +7172,7 @@
 }
 
 
-/* Load GIF image IMG for use on frame F.  Value is non-zero if
+/* Load GIF image IMG for use on frame F.  Value is true if
    successful.  */
 
 static const int interlace_start[] = {0, 4, 2, 1};
@@ -7231,7 +7180,7 @@
 
 #define GIF_LOCAL_DESCRIPTOR_EXTENSION 249
 
-static int
+static bool
 gif_load (struct frame *f, struct image *img)
 {
   Lisp_Object file;
@@ -7529,7 +7478,7 @@
 #else  /* !HAVE_GIF */
 
 #ifdef HAVE_NS
-static int
+static bool
 gif_load (struct frame *f, struct image *img)
 {
   return ns_load_image (f, img,
@@ -7548,8 +7497,8 @@
 
 static Lisp_Object Qimagemagick;
 
-static int imagemagick_image_p (Lisp_Object);
-static int imagemagick_load (struct frame *, struct image *);
+static bool imagemagick_image_p (Lisp_Object);
+static bool imagemagick_load (struct frame *, struct image *);
 static void imagemagick_clear_image (struct frame *, struct image *);
 
 /* Indices of image specification fields in imagemagick_format.  */
@@ -7595,7 +7544,7 @@
   };
 
 #ifdef HAVE_NTGUI
-static int init_imagemagick_functions (void);
+static bool init_imagemagick_functions (void);
 #else
 #define init_imagemagick_functions NULL
 #endif
@@ -7622,11 +7571,11 @@
   x_clear_image (f, img);
 }
 
-/* Return non-zero if OBJECT is a valid IMAGEMAGICK image specification.  Do
+/* Return true if OBJECT is a valid IMAGEMAGICK image specification.  Do
    this by calling parse_image_spec and supplying the keywords that
    identify the IMAGEMAGICK format.   */
 
-static int
+static bool
 imagemagick_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[IMAGEMAGICK_LAST];
@@ -7678,9 +7627,9 @@
    be parsed; SIZE is the number of bytes of data; and FILENAME is
    either the file name or the image data.
 
-   Return non-zero if successful.  */
+   Return true if successful.  */
 
-static int
+static bool
 imagemagick_load_image (struct frame *f, struct image *img,
                        unsigned char *contents, unsigned int size,
                        char *filename)
@@ -8018,14 +7967,14 @@
 }
 
 
-/* Load IMAGEMAGICK image IMG for use on frame F.  Value is non-zero if
+/* Load IMAGEMAGICK image IMG for use on frame F.  Value is true if
    successful. this function will go into the imagemagick_type structure, and
    the prototype thus needs to be compatible with that structure.  */
 
-static int
+static bool
 imagemagick_load (struct frame *f, struct image *img)
 {
-  int success_p = 0;
+  bool success_p = 0;
   Lisp_Object file_name;
 
   /* If IMG->spec specifies a file name, create a non-file spec from it.  */
@@ -8104,11 +8053,11 @@
 
 /* Function prototypes.  */
 
-static int svg_image_p (Lisp_Object object);
-static int svg_load (struct frame *f, struct image *img);
+static bool svg_image_p (Lisp_Object object);
+static bool svg_load (struct frame *f, struct image *img);
 
-static int svg_load_image (struct frame *, struct image *,
-                           unsigned char *, ptrdiff_t);
+static bool svg_load_image (struct frame *, struct image *,
+                           unsigned char *, ptrdiff_t);
 
 /* The symbol `svg' identifying images of this type. */
 
@@ -8149,7 +8098,7 @@
 };
 
 #ifdef HAVE_NTGUI
-static int init_svg_functions (void);
+static bool init_svg_functions (void);
 #else
 #define init_svg_functions NULL
 #endif
@@ -8169,11 +8118,11 @@
 };
 
 
-/* Return non-zero if OBJECT is a valid SVG image specification.  Do
+/* Return true if OBJECT is a valid SVG image specification.  Do
    this by calling parse_image_spec and supplying the keywords that
    identify the SVG format.   */
 
-static int
+static bool
 svg_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[SVG_LAST];
@@ -8212,7 +8161,7 @@
 
 Lisp_Object Qgdk_pixbuf, Qglib, Qgobject;
 
-static int
+static bool
 init_svg_functions (void)
 {
   HMODULE library, gdklib, glib, gobject;
@@ -8268,14 +8217,13 @@
 #define fn_g_error_free                   g_error_free
 #endif /* !HAVE_NTGUI  */
 
-/* Load SVG image IMG for use on frame F.  Value is non-zero if
-   successful. this function will go into the svg_type structure, and
-   the prototype thus needs to be compatible with that structure.  */
+/* Load SVG image IMG for use on frame F.  Value is true if
+   successful.  */
 
-static int
+static bool
 svg_load (struct frame *f, struct image *img)
 {
-  int success_p = 0;
+  bool success_p = 0;
   Lisp_Object file_name;
 
   /* If IMG->spec specifies a file name, create a non-file spec from it.  */
@@ -8328,8 +8276,8 @@
 
    Uses librsvg to do most of the image processing.
 
-   Returns non-zero when successful.  */
-static int
+   Returns true when successful.  */
+static bool
 svg_load_image (struct frame *f,         /* Pointer to emacs frame structure.  
*/
                struct image *img,       /* Pointer to emacs image structure.  
*/
                unsigned char *contents, /* String containing the SVG XML data 
to be parsed.  */
@@ -8496,8 +8444,8 @@
 
 #ifdef HAVE_GHOSTSCRIPT
 
-static int gs_image_p (Lisp_Object object);
-static int gs_load (struct frame *f, struct image *img);
+static bool gs_image_p (Lisp_Object object);
+static bool gs_load (struct frame *f, struct image *img);
 static void gs_clear_image (struct frame *f, struct image *img);
 
 /* Keyword symbols.  */
@@ -8566,10 +8514,10 @@
 }
 
 
-/* Return non-zero if OBJECT is a valid Ghostscript image
+/* Return true if OBJECT is a valid Ghostscript image
    specification.  */
 
-static int
+static bool
 gs_image_p (Lisp_Object object)
 {
   struct image_keyword fmt[GS_LAST];
@@ -8606,10 +8554,10 @@
 }
 
 
-/* Load Ghostscript image IMG for use on frame F.  Value is non-zero
+/* Load Ghostscript image IMG for use on frame F.  Value is true
    if successful.  */
 
-static int
+static bool
 gs_load (struct frame *f, struct image *img)
 {
   uprintmax_t printnum1, printnum2;

=== modified file 'src/indent.c'
--- a/src/indent.c      2012-09-15 07:06:56 +0000
+++ b/src/indent.c      2012-09-24 21:38:23 +0000
@@ -115,7 +115,7 @@
    for characters as WIDTHTAB.  We use this to decide when to
    invalidate the buffer's width_run_cache.  */
 
-int
+bool
 disptab_matches_widthtab (struct Lisp_Char_Table *disptab, struct Lisp_Vector 
*widthtab)
 {
   int i;
@@ -320,14 +320,14 @@
 ptrdiff_t
 current_column (void)
 {
-  register ptrdiff_t col;
-  register unsigned char *ptr, *stop;
-  register int tab_seen;
+  ptrdiff_t col;
+  unsigned char *ptr, *stop;
+  bool tab_seen;
   ptrdiff_t post_tab;
-  register int c;
+  int c;
   int tab_width = SANE_TAB_WIDTH (current_buffer);
-  int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
-  register struct Lisp_Char_Table *dp = buffer_display_table ();
+  bool ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
+  struct Lisp_Char_Table *dp = buffer_display_table ();
 
   if (PT == last_known_column_point
       && MODIFF == last_known_column_modified)
@@ -512,9 +512,9 @@
 scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol)
 {
   int tab_width = SANE_TAB_WIDTH (current_buffer);
-  register int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
-  register struct Lisp_Char_Table *dp = buffer_display_table ();
-  int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
+  bool ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
+  struct Lisp_Char_Table *dp = buffer_display_table ();
+  bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
   struct composition_it cmp_it;
   Lisp_Object window;
   struct window *w;
@@ -722,14 +722,14 @@
 static double
 string_display_width (Lisp_Object string, Lisp_Object beg, Lisp_Object end)
 {
-  register int col;
-  register unsigned char *ptr, *stop;
-  register int tab_seen;
+  int col;
+  unsigned char *ptr, *stop;
+  bool tab_seen;
   int post_tab;
-  register int c;
+  int c;
   int tab_width = SANE_TAB_WIDTH (current_buffer);
-  int ctl_arrow = !NILP (current_buffer->ctl_arrow);
-  register struct Lisp_Char_Table *dp = buffer_display_table ();
+  bool ctl_arrow = !NILP (current_buffer->ctl_arrow);
+  struct Lisp_Char_Table *dp = buffer_display_table ();
   int b, e;
 
   if (NILP (end))
@@ -945,7 +945,7 @@
    Blank lines are treated as if they had the same indentation as the
    preceding line.  */
 
-int
+bool
 indented_beyond_p (ptrdiff_t pos, ptrdiff_t pos_byte, EMACS_INT column)
 {
   ptrdiff_t val;
@@ -1047,11 +1047,11 @@
    can't hit the requested column exactly (because of a tab or other
    multi-column character), overshoot.
 
-   DID_MOTION is 1 if FROMHPOS has already accounted for overlay strings
+   DID_MOTION is true if FROMHPOS has already accounted for overlay strings
    at FROM.  This is the case if FROMVPOS and FROMVPOS came from an
    earlier call to compute_motion.  The other common case is that FROMHPOS
    is zero and FROM is a position that "belongs" at column zero, but might
-   be shifted by overlay strings; in this case DID_MOTION should be 0.
+   be shifted by overlay strings; in this case DID_MOTION should be false.
 
    WIDTH is the number of columns available to display text;
    compute_motion uses this to handle continuation lines and such.
@@ -1104,17 +1104,20 @@
    the scroll bars if they are turned on.  */
 
 struct position *
-compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, int 
did_motion, ptrdiff_t to, EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width, 
ptrdiff_t hscroll, int tab_offset, struct window *win)
+compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
+               bool did_motion, ptrdiff_t to,
+               EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width,
+               ptrdiff_t hscroll, int tab_offset, struct window *win)
 {
-  register EMACS_INT hpos = fromhpos;
-  register EMACS_INT vpos = fromvpos;
+  EMACS_INT hpos = fromhpos;
+  EMACS_INT vpos = fromvpos;
 
-  register ptrdiff_t pos;
+  ptrdiff_t pos;
   ptrdiff_t pos_byte;
-  register int c = 0;
+  int c = 0;
   int tab_width = SANE_TAB_WIDTH (current_buffer);
-  register int ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
-  register struct Lisp_Char_Table *dp = window_display_table (win);
+  bool ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow));
+  struct Lisp_Char_Table *dp = window_display_table (win);
   EMACS_INT selective
     = (INTEGERP (BVAR (current_buffer, selective_display))
        ? XINT (BVAR (current_buffer, selective_display))
@@ -1139,7 +1142,7 @@
   ptrdiff_t next_width_run = from;
   Lisp_Object window;
 
-  int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
+  bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
   /* If previous char scanned was a wide character,
      this is the column where it ended.  Otherwise, this is 0.  */
   EMACS_INT wide_column_end_hpos = 0;
@@ -1308,7 +1311,7 @@
       if (hpos > width)
        {
          EMACS_INT total_width = width + continuation_glyph_width;
-         int truncate = 0;
+         bool truncate = 0;
 
          if (!NILP (Vtruncate_partial_width_windows)
              && (total_width < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))))
@@ -1827,7 +1830,7 @@
                         PTRDIFF_MAX)
        : !NILP (BVAR (current_buffer, selective_display)) ? -1 : 0);
   Lisp_Object window;
-  int did_motion;
+  bool did_motion;
   /* This is the object we use for fetching character properties.  */
   Lisp_Object text_prop_object;
 
@@ -2017,8 +2020,8 @@
     {
       ptrdiff_t it_start, it_overshoot_count = 0;
       int first_x;
-      int overshoot_handled = 0;
-      int disp_string_at_start_p = 0;
+      bool overshoot_handled = 0;
+      bool disp_string_at_start_p = 0;
 
       itdata = bidi_shelve_cache ();
       SET_TEXT_POS (pt, PT, PT_BYTE);

=== modified file 'src/indent.h'
--- a/src/indent.h      2012-02-10 18:58:48 +0000
+++ b/src/indent.h      2012-09-24 21:38:23 +0000
@@ -27,7 +27,7 @@
   };
 
 struct position *compute_motion (ptrdiff_t from, EMACS_INT fromvpos,
-                                 EMACS_INT fromhpos, int did_motion,
+                                 EMACS_INT fromhpos, bool did_motion,
                                  ptrdiff_t to, EMACS_INT tovpos,
                                  EMACS_INT tohpos,
                                  EMACS_INT width, ptrdiff_t hscroll,
@@ -45,8 +45,8 @@
 /* Return true if the display table DISPTAB specifies the same widths
    for characters as WIDTHTAB.  We use this to decide when to
    invalidate the buffer's column_cache.  */
-int disptab_matches_widthtab (struct Lisp_Char_Table *disptab,
-                              struct Lisp_Vector *widthtab);
+bool disptab_matches_widthtab (struct Lisp_Char_Table *disptab,
+                              struct Lisp_Vector *widthtab);
 
 /* Recompute BUF's width table, using the display table DISPTAB.  */
 void recompute_width_table (struct buffer *buf,

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-09-23 22:25:22 +0000
+++ b/src/lisp.h        2012-09-24 21:38:23 +0000
@@ -3257,7 +3257,7 @@
 /* Defined in indent.c.  */
 extern ptrdiff_t current_column (void);
 extern void invalidate_current_column (void);
-extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT);
+extern bool indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT);
 extern void syms_of_indent (void);
 
 /* Defined in frame.c.  */

=== modified file 'src/nsimage.m'
--- a/src/nsimage.m     2012-09-15 07:06:56 +0000
+++ b/src/nsimage.m     2012-09-24 21:38:23 +0000
@@ -78,7 +78,7 @@
   return [EmacsImage allocInitFromFile: file];
 }
 
-int
+bool
 ns_load_image (struct frame *f, struct image *img,
                Lisp_Object spec_file, Lisp_Object spec_data)
 {

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2012-09-11 17:08:02 +0000
+++ b/src/nsterm.h      2012-09-24 21:38:23 +0000
@@ -749,11 +749,11 @@
 extern void ns_set_name_as_filename (struct frame *f);
 extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
 
-extern int
+extern bool
 ns_defined_color (struct frame *f,
                   const char *name,
-                  XColor *color_def, int alloc,
-                  char makeIndex);
+                  XColor *color_def, bool alloc,
+                  bool makeIndex);
 extern void
 ns_query_color (void *col, XColor *color_def, int setPixel);
 
@@ -799,8 +799,8 @@
 extern void *ns_image_from_XBM (unsigned char *bits, int width, int height);
 extern void *ns_image_for_XPM (int width, int height, int depth);
 extern void *ns_image_from_file (Lisp_Object file);
-extern int ns_load_image (struct frame *f, struct image *img,
-                          Lisp_Object spec_file, Lisp_Object spec_data);
+extern bool ns_load_image (struct frame *f, struct image *img,
+                          Lisp_Object spec_file, Lisp_Object spec_data);
 extern int ns_image_width (void *img);
 extern int ns_image_height (void *img);
 extern unsigned long ns_get_pixel (void *img, int x, int y);

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2012-09-23 08:44:20 +0000
+++ b/src/nsterm.m      2012-09-24 21:38:23 +0000
@@ -1575,18 +1575,18 @@
 }
 
 
-int
+bool
 ns_defined_color (struct frame *f,
                   const char *name,
                   XColor *color_def,
-                  int alloc,
-                  char makeIndex)
+                  bool alloc,
+                  bool makeIndex)
 /* --------------------------------------------------------------------------
-         Return 1 if named color found, and set color_def rgb accordingly.
+         Return true if named color found, and set color_def rgb accordingly.
          If makeIndex and alloc are nonzero put the color in the color_table,
          and set color_def pixel to the resulting index.
          If makeIndex is zero, set color_def pixel to ARGB.
-         Return 0 if not found
+         Return false if not found
    -------------------------------------------------------------------------- 
*/
 {
   NSColor *col;

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2012-09-23 08:44:20 +0000
+++ b/src/xfaces.c      2012-09-24 21:38:23 +0000
@@ -991,7 +991,7 @@
    non-zero, then the `standard' definition of the same color is
    returned in it.  */
 
-static int
+static bool
 tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color,
                  XColor *std_color)
 {
@@ -1052,11 +1052,11 @@
 
 /* A version of defined_color for non-X frames.  */
 
-static int
+static bool
 tty_defined_color (struct frame *f, const char *color_name,
-                  XColor *color_def, int alloc)
+                  XColor *color_def, bool alloc)
 {
-  int status = 1;
+  bool status = 1;
 
   /* Defaults.  */
   color_def->pixel = FACE_TTY_DEFAULT_COLOR;
@@ -1084,13 +1084,13 @@
 
 /* Decide if color named COLOR_NAME is valid for the display
    associated with the frame F; if so, return the rgb values in
-   COLOR_DEF.  If ALLOC is nonzero, allocate a new colormap cell.
+   COLOR_DEF.  If ALLOC, allocate a new colormap cell.
 
    This does the right thing for any type of frame.  */
 
-static int
+static bool
 defined_color (struct frame *f, const char *color_name, XColor *color_def,
-              int alloc)
+              bool alloc)
 {
   if (!FRAME_WINDOW_P (f))
     return tty_defined_color (f, color_name, color_def, alloc);

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2012-09-23 19:36:31 +0000
+++ b/src/xfns.c        2012-09-24 21:38:23 +0000
@@ -575,15 +575,15 @@
 
 
 /* Decide if color named COLOR_NAME is valid for use on frame F.  If
-   so, return the RGB values in COLOR.  If ALLOC_P is non-zero,
-   allocate the color.  Value is zero if COLOR_NAME is invalid, or
+   so, return the RGB values in COLOR.  If ALLOC_P,
+   allocate the color.  Value is false if COLOR_NAME is invalid, or
    no color could be allocated.  */
 
-int
+bool
 x_defined_color (struct frame *f, const char *color_name,
-                XColor *color, int alloc_p)
+                XColor *color, bool alloc_p)
 {
-  int success_p = 0;
+  bool success_p = 0;
   Display *dpy = FRAME_X_DISPLAY (f);
   Colormap cmap = FRAME_X_COLORMAP (f);
 
@@ -592,7 +592,7 @@
   success_p = xg_check_special_colors (f, color_name, color);
 #endif
   if (!success_p)
-    success_p = XParseColor (dpy, cmap, color_name, color);
+    success_p = XParseColor (dpy, cmap, color_name, color) != 0;
   if (success_p && alloc_p)
     success_p = x_alloc_nearest_color (f, cmap, color);
   unblock_input ();

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2012-09-23 19:36:31 +0000
+++ b/src/xterm.c       2012-09-24 21:38:23 +0000
@@ -287,7 +287,7 @@
 
 /* Used in x_flush.  */
 
-static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
+static bool x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
 static void x_set_window_size_1 (struct frame *, int, int, int);
 static void x_raise_frame (struct frame *);
 static void x_lower_frame (struct frame *);
@@ -899,8 +899,8 @@
 static void x_set_cursor_gc (struct glyph_string *);
 static void x_set_mode_line_face_gc (struct glyph_string *);
 static void x_set_mouse_face_gc (struct glyph_string *);
-static int x_alloc_lighter_color (struct frame *, Display *, Colormap,
-                                  unsigned long *, double, int);
+static bool x_alloc_lighter_color (struct frame *, Display *, Colormap,
+                                  unsigned long *, double, int);
 static void x_setup_relief_color (struct frame *, struct relief *,
                                   double, int, unsigned long);
 static void x_setup_relief_colors (struct glyph_string *);
@@ -1469,9 +1469,9 @@
    If this produces the same color as PIXEL, try a color where all RGB
    values have DELTA added.  Return the allocated color in *PIXEL.
    DISPLAY is the X display, CMAP is the colormap to operate on.
-   Value is non-zero if successful.  */
+   Value is true if successful.  */
 
-int
+bool
 x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap 
cmap,
                                  unsigned long *pixel, double factor, int 
delta)
 {
@@ -1696,15 +1696,15 @@
 
 /* Allocate the color COLOR->pixel on DISPLAY, colormap CMAP.  If an
    exact match can't be allocated, try the nearest color available.
-   Value is non-zero if successful.  Set *COLOR to the color
+   Value is true if successful.  Set *COLOR to the color
    allocated.  */
 
-static int
+static bool
 x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
 {
-  int rc;
+  bool rc;
 
-  rc = XAllocColor (dpy, cmap, color);
+  rc = XAllocColor (dpy, cmap, color) != 0;
   if (rc == 0)
     {
       /* If we got to this point, the colormap is full, so we're going
@@ -1735,7 +1735,7 @@
       color->red   = cells[nearest].red;
       color->green = cells[nearest].green;
       color->blue  = cells[nearest].blue;
-      rc = XAllocColor (dpy, cmap, color);
+      rc = XAllocColor (dpy, cmap, color) != 0;
     }
   else
     {
@@ -1768,10 +1768,10 @@
 
 /* Allocate the color COLOR->pixel on frame F, colormap CMAP.  If an
    exact match can't be allocated, try the nearest color available.
-   Value is non-zero if successful.  Set *COLOR to the color
+   Value is true if successful.  Set *COLOR to the color
    allocated.  */
 
-int
+bool
 x_alloc_nearest_color (struct frame *f, Colormap cmap, XColor *color)
 {
   gamma_correct (f, color);
@@ -1821,12 +1821,12 @@
    DISPLAY is the X display, CMAP is the colormap to operate on.
    Value is non-zero if successful.  */
 
-static int
+static bool
 x_alloc_lighter_color (struct frame *f, Display *display, Colormap cmap, long 
unsigned int *pixel, double factor, int delta)
 {
   XColor color, new;
   long bright;
-  int success_p;
+  bool success_p;
 
   /* Get RGB color values.  */
   color.pixel = *pixel;

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2012-09-01 06:38:52 +0000
+++ b/src/xterm.h       2012-09-24 21:38:23 +0000
@@ -962,11 +962,11 @@
 extern void x_activate_timeout_atimer (void);
 #endif
 #ifdef USE_LUCID
-extern int x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
-                                             unsigned long *,
-                                             double, int);
+extern bool x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
+                                             unsigned long *,
+                                             double, int);
 #endif
-extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
+extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
 extern void x_query_color (struct frame *f, XColor *);
 extern void x_clear_area (Display *, Window, int, int, int, int, int);
 #if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
@@ -1034,7 +1034,7 @@
 extern void xic_set_xfontset (struct frame *, const char *);
 extern int x_pixel_width (struct frame *);
 extern int x_pixel_height (struct frame *);
-extern int x_defined_color (struct frame *, const char *, XColor *, int);
+extern bool x_defined_color (struct frame *, const char *, XColor *, bool);
 #ifdef HAVE_X_I18N
 extern void free_frame_xic (struct frame *);
 # if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT


reply via email to

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