[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r113592: * fringe.c (draw_window_fringes, update_win
From: |
Dmitry Antipov |
Subject: |
[Emacs-diffs] trunk r113592: * fringe.c (draw_window_fringes, update_window_fringes) |
Date: |
Tue, 30 Jul 2013 05:57:13 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 113592
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-07-30 09:56:18 +0400
message:
* fringe.c (draw_window_fringes, update_window_fringes)
(compute_fringe_widths):
* w32term.c (x_draw_glyph_string):
* window.c (candidate_window_p, Frecenter):
* xfaces.c (realize_basic_faces, realize_default_face)
(Fbitmap_space_p, Finternal_set_lisp_face_attribute)
(x_update_menu_appearance, face_attr_equal_p, lface_equal_p):
* xfns.c (x_set_cursor_color, xic_free_xfontset):
* xmenu.c (Fx_menu_bar_open_internal):
* xselect.c (x_reply_selection_request, Fx_get_atom_name):
* xsettings.c (xft_settings_event):
* xterm.c (x_draw_glyph_string, x_had_errors_p):
Use bool for booleans. Adjust style and comments where
appropriate.
* dispextern.h (draw_window_fringes, update_window_fringes)
(compute_fringe_widths):
* xterm.h (x_had_errors_p): Adjust prototype.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/dispextern.h
dispextern.h-20091113204419-o5vbwnq5f7feedwu-218
src/fringe.c fringe.c-20091113204419-o5vbwnq5f7feedwu-2965
src/w32term.c w32term.c-20091113204419-o5vbwnq5f7feedwu-950
src/window.c window.c-20091113204419-o5vbwnq5f7feedwu-231
src/xfaces.c xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
src/xfns.c xfns.c-20091113204419-o5vbwnq5f7feedwu-274
src/xmenu.c xmenu.c-20091113204419-o5vbwnq5f7feedwu-161
src/xselect.c xselect.c-20091113204419-o5vbwnq5f7feedwu-543
src/xsettings.c xsettings.c-20091117210551-bqxn4u9uesl3d17a-4
src/xterm.c xterm.c-20091113204419-o5vbwnq5f7feedwu-244
src/xterm.h xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-07-30 04:35:44 +0000
+++ b/src/ChangeLog 2013-07-30 05:56:18 +0000
@@ -1,5 +1,25 @@
2013-07-30 Dmitry Antipov <address@hidden>
+ * fringe.c (draw_window_fringes, update_window_fringes)
+ (compute_fringe_widths):
+ * w32term.c (x_draw_glyph_string):
+ * window.c (candidate_window_p, Frecenter):
+ * xfaces.c (realize_basic_faces, realize_default_face)
+ (Fbitmap_space_p, Finternal_set_lisp_face_attribute)
+ (x_update_menu_appearance, face_attr_equal_p, lface_equal_p):
+ * xfns.c (x_set_cursor_color, xic_free_xfontset):
+ * xmenu.c (Fx_menu_bar_open_internal):
+ * xselect.c (x_reply_selection_request, Fx_get_atom_name):
+ * xsettings.c (xft_settings_event):
+ * xterm.c (x_draw_glyph_string, x_had_errors_p):
+ Use bool for booleans. Adjust style and comments where
+ appropriate.
+ * dispextern.h (draw_window_fringes, update_window_fringes)
+ (compute_fringe_widths):
+ * xterm.h (x_had_errors_p): Adjust prototype.
+
+2013-07-30 Dmitry Antipov <address@hidden>
+
* frame.c (Fmodify_frame_parameters): Always check 2nd arg with
CHECK_LIST. Rewrite the loop to avoid useless local variable.
=== modified file 'src/dispextern.h'
--- a/src/dispextern.h 2013-07-11 02:17:47 +0000
+++ b/src/dispextern.h 2013-07-30 05:56:18 +0000
@@ -3235,9 +3235,9 @@
int lookup_fringe_bitmap (Lisp_Object);
void draw_fringe_bitmap (struct window *, struct glyph_row *, int);
void draw_row_fringe_bitmaps (struct window *, struct glyph_row *);
-int draw_window_fringes (struct window *, int);
-int update_window_fringes (struct window *, int);
-void compute_fringe_widths (struct frame *, int);
+bool draw_window_fringes (struct window *, bool);
+bool update_window_fringes (struct window *, bool);
+void compute_fringe_widths (struct frame *, bool);
#ifdef HAVE_NTGUI
void w32_init_fringe (struct redisplay_interface *);
=== modified file 'src/fringe.c'
--- a/src/fringe.c 2013-03-28 14:04:49 +0000
+++ b/src/fringe.c 2013-07-30 05:56:18 +0000
@@ -890,31 +890,32 @@
/* Draw the fringes of window W. Only fringes for rows marked for
update in redraw_fringe_bitmaps_p are drawn.
- Return >0 if left or right fringe was redrawn in any way.
-
- If NO_FRINGE is non-zero, also return >0 if either fringe has zero width.
-
- A return value >0 indicates that the vertical line between windows
- needs update (as it may be drawn in the fringe).
+ Return nonzero if left or right fringe was redrawn in any way.
+
+ If NO_FRINGE_P is non-zero, also return nonzero if either fringe
+ has zero width.
+
+ A return nonzero value indicates that the vertical line between
+ windows needs update (as it may be drawn in the fringe).
*/
-int
-draw_window_fringes (struct window *w, int no_fringe)
+bool
+draw_window_fringes (struct window *w, bool no_fringe_p)
{
struct glyph_row *row;
int yb = window_text_bottom_y (w);
int nrows = w->current_matrix->nrows;
int y, rn;
- int updated = 0;
+ bool updated_p = 0;
if (w->pseudo_window_p)
- return 0;
+ return updated_p;
/* Must draw line if no fringe */
- if (no_fringe
+ if (no_fringe_p
&& (WINDOW_LEFT_FRINGE_WIDTH (w) == 0
|| WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
- updated++;
+ updated_p = 1;
for (y = w->vscroll, rn = 0, row = w->current_matrix->rows;
y < yb && rn < nrows;
@@ -924,10 +925,10 @@
continue;
draw_row_fringe_bitmaps (w, row);
row->redraw_fringe_bitmaps_p = 0;
- updated++;
+ updated_p = 1;
}
- return updated;
+ return updated_p;
}
@@ -936,14 +937,14 @@
If KEEP_CURRENT_P is 0, update current_matrix too. */
-int
-update_window_fringes (struct window *w, int keep_current_p)
+bool
+update_window_fringes (struct window *w, bool keep_current_p)
{
struct glyph_row *row, *cur = 0;
int yb = window_text_bottom_y (w);
int rn, nrows = w->current_matrix->nrows;
int y;
- int redraw_p = 0;
+ bool redraw_p = 0;
Lisp_Object boundary_top = Qnil, boundary_bot = Qnil;
Lisp_Object arrow_top = Qnil, arrow_bot = Qnil;
Lisp_Object empty_pos;
@@ -1169,7 +1170,7 @@
int left, right;
unsigned left_face_id, right_face_id;
int left_offset, right_offset;
- int periodic_p;
+ bool periodic_p;
row = w->desired_matrix->rows + rn;
cur = w->current_matrix->rows + rn;
@@ -1285,7 +1286,7 @@
|| periodic_p != cur->fringe_bitmap_periodic_p
|| cur->redraw_fringe_bitmaps_p)
{
- redraw_p = row->redraw_fringe_bitmaps_p = 1;
+ redraw_p = 1, row->redraw_fringe_bitmaps_p = 1;
if (!keep_current_p)
{
cur->redraw_fringe_bitmaps_p = 1;
@@ -1304,7 +1305,7 @@
if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap)
{
- redraw_p = row->redraw_fringe_bitmaps_p = 1;
+ redraw_p = 1, row->redraw_fringe_bitmaps_p = 1;
if (!keep_current_p)
{
cur->redraw_fringe_bitmaps_p = 1;
@@ -1339,7 +1340,7 @@
*/
void
-compute_fringe_widths (struct frame *f, int redraw)
+compute_fringe_widths (struct frame *f, bool redraw_p)
{
int o_left = FRAME_LEFT_FRINGE_WIDTH (f);
int o_right = FRAME_RIGHT_FRINGE_WIDTH (f);
@@ -1410,7 +1411,7 @@
FRAME_FRINGE_COLS (f) = 0;
}
- if (redraw && FRAME_VISIBLE_P (f))
+ if (redraw_p && FRAME_VISIBLE_P (f))
if (o_left != FRAME_LEFT_FRINGE_WIDTH (f) ||
o_right != FRAME_RIGHT_FRINGE_WIDTH (f) ||
o_cols != FRAME_FRINGE_COLS (f))
=== modified file 'src/w32term.c'
--- a/src/w32term.c 2013-07-27 13:08:03 +0000
+++ b/src/w32term.c 2013-07-30 05:56:18 +0000
@@ -2360,7 +2360,7 @@
static void
x_draw_glyph_string (struct glyph_string *s)
{
- int relief_drawn_p = 0;
+ bool relief_drawn_p = 0;
/* If S draws into the background of its successor, draw the
background of the successor first so that S can draw into it.
@@ -4629,7 +4629,7 @@
{
/* If we decide we want to generate an event to be seen
by the rest of Emacs, we put it here. */
- int tool_bar_p = 0;
+ bool tool_bar_p = 0;
int button;
int up;
=== modified file 'src/window.c'
--- a/src/window.c 2013-07-16 21:35:45 +0000
+++ b/src/window.c 2013-07-30 05:56:18 +0000
@@ -72,8 +72,6 @@
static int freeze_window_start (struct window *, void *);
static Lisp_Object window_list (void);
static int add_window_to_list (struct window *, void *);
-static int candidate_window_p (Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object);
static Lisp_Object next_window (Lisp_Object, Lisp_Object,
Lisp_Object, int);
static void decode_next_window_args (Lisp_Object *, Lisp_Object *,
@@ -2213,12 +2211,13 @@
a window means search the frame that window belongs to,
a frame means consider windows on that frame, only. */
-static int
-candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object
minibuf, Lisp_Object all_frames)
+static bool
+candidate_window_p (Lisp_Object window, Lisp_Object owindow,
+ Lisp_Object minibuf, Lisp_Object all_frames)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
- int candidate_p = 1;
+ bool candidate_p = 1;
if (!BUFFERP (w->contents))
candidate_p = 0;
@@ -5172,7 +5171,7 @@
struct window *w = XWINDOW (selected_window);
struct buffer *buf = XBUFFER (w->contents);
struct buffer *obuf = current_buffer;
- int center_p = 0;
+ bool center_p = 0;
ptrdiff_t charpos, bytepos;
EMACS_INT iarg IF_LINT (= 0);
int this_scroll_margin;
=== modified file 'src/xfaces.c'
--- a/src/xfaces.c 2013-07-19 18:09:23 +0000
+++ b/src/xfaces.c 2013-07-30 05:56:18 +0000
@@ -448,8 +448,8 @@
struct face *);
static struct face *realize_x_face (struct face_cache *, Lisp_Object *);
static struct face *realize_tty_face (struct face_cache *, Lisp_Object *);
-static int realize_basic_faces (struct frame *);
-static int realize_default_face (struct frame *);
+static bool realize_basic_faces (struct frame *);
+static bool realize_default_face (struct frame *);
static void realize_named_face (struct frame *, Lisp_Object, int);
static struct face_cache *make_face_cache (struct frame *);
static void clear_face_gcs (struct face_cache *);
@@ -819,7 +819,7 @@
\(WIDTH + 7)/8 bytes. */)
(Lisp_Object object)
{
- int pixmap_p = 0;
+ bool pixmap_p = 0;
if (STRINGP (object))
/* If OBJECT is a string, it's a file name. */
@@ -2854,7 +2854,7 @@
}
else if (EQ (attr, QCunderline))
{
- int valid_p = 0;
+ bool valid_p = 0;
if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value))
valid_p = 1;
@@ -2941,7 +2941,7 @@
}
else if (EQ (attr, QCbox))
{
- int valid_p;
+ bool valid_p;
/* Allow t meaning a simple box of width 1 in foreground color
of the face. */
@@ -3510,7 +3510,7 @@
Lisp_Object lface = lface_from_face_name (f, Qmenu, 1);
struct face *face = FACE_FROM_ID (f, MENU_FACE_ID);
const char *myname = SSDATA (Vx_resource_name);
- int changed_p = 0;
+ bool changed_p = 0;
#ifdef USE_MOTIF
const char *popup_path = "popup_menu";
#else
@@ -3858,7 +3858,7 @@
all attributes are `equal'. Tries to be fast because this function
is called quite often. */
-static int
+static bool
face_attr_equal_p (Lisp_Object v1, Lisp_Object v2)
{
/* Type can differ, e.g. when one attribute is unspecified, i.e. nil,
@@ -3891,10 +3891,11 @@
all attributes are `equal'. Tries to be fast because this function
is called quite often. */
-static int
+static bool
lface_equal_p (Lisp_Object *v1, Lisp_Object *v2)
{
- int i, equal_p = 1;
+ int i;
+ bool equal_p = 1;
for (i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i)
equal_p = face_attr_equal_p (v1[i], v2[i]);
@@ -5201,10 +5202,10 @@
of F don't contain enough information needed to realize the default
face. */
-static int
+static bool
realize_basic_faces (struct frame *f)
{
- int success_p = 0;
+ bool success_p = 0;
ptrdiff_t count = SPECPDL_INDEX ();
/* Block input here so that we won't be surprised by an X expose
@@ -5249,7 +5250,7 @@
specified, make it fully-specified. Attributes of the default face
that are not explicitly specified are taken from frame parameters. */
-static int
+static bool
realize_default_face (struct frame *f)
{
struct face_cache *c = FRAME_FACE_CACHE (f);
=== modified file 'src/xfns.c'
--- a/src/xfns.c 2013-07-16 21:35:45 +0000
+++ b/src/xfns.c 2013-07-30 05:56:18 +0000
@@ -942,7 +942,7 @@
x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
unsigned long fore_pixel, pixel;
- int fore_pixel_allocated_p = 0, pixel_allocated_p = 0;
+ bool fore_pixel_allocated_p = 0, pixel_allocated_p = 0;
struct x_output *x = f->output_data.x;
if (!NILP (Vx_cursor_fore_pixel))
@@ -2066,7 +2066,7 @@
xic_free_xfontset (struct frame *f)
{
Lisp_Object rest, frame;
- int shared_p = 0;
+ bool shared_p = 0;
if (!FRAME_XIC_FONTSET (f))
return;
=== modified file 'src/xmenu.c'
--- a/src/xmenu.c 2013-07-19 01:24:35 +0000
+++ b/src/xmenu.c 2013-07-30 05:56:18 +0000
@@ -493,7 +493,7 @@
if (menubar)
{
Window child;
- int error_p = 0;
+ bool error_p = 0;
x_catch_errors (FRAME_X_DISPLAY (f));
memset (&ev, 0, sizeof ev);
=== modified file 'src/xselect.c'
--- a/src/xselect.c 2013-07-16 21:35:45 +0000
+++ b/src/xselect.c 2013-07-30 05:56:18 +0000
@@ -654,7 +654,7 @@
if (cs->wait_object)
{
int format_bytes = cs->format / 8;
- int had_errors = x_had_errors_p (display);
+ bool had_errors_p = x_had_errors_p (display);
unblock_input ();
bytes_remaining = cs->size;
@@ -662,7 +662,7 @@
/* Wait for the requestor to ack by deleting the property.
This can run Lisp code (process handlers) or signal. */
- if (! had_errors)
+ if (! had_errors_p)
{
TRACE1 ("Waiting for ACK (deletion of %s)",
XGetAtomName (display, cs->property));
@@ -694,10 +694,10 @@
cs->data += i * ((cs->format == 32) ? sizeof (long)
: format_bytes);
XFlush (display);
- had_errors = x_had_errors_p (display);
+ had_errors_p = x_had_errors_p (display);
unblock_input ();
- if (had_errors) break;
+ if (had_errors_p) break;
/* Wait for the requestor to ack this chunk by deleting
the property. This can run Lisp code or signal. */
@@ -2427,17 +2427,17 @@
Lisp_Object ret = Qnil;
Display *dpy = FRAME_X_DISPLAY (f);
Atom atom;
- int had_errors;
+ bool had_errors_p;
CONS_TO_INTEGER (value, Atom, atom);
block_input ();
x_catch_errors (dpy);
name = atom ? XGetAtomName (dpy, atom) : empty;
- had_errors = x_had_errors_p (dpy);
+ had_errors_p = x_had_errors_p (dpy);
x_uncatch_errors ();
- if (!had_errors)
+ if (!had_errors_p)
ret = build_string (name);
if (atom && name) XFree (name);
=== modified file 'src/xsettings.c'
--- a/src/xsettings.c 2013-07-10 23:23:57 +0000
+++ b/src/xsettings.c 2013-07-30 05:56:18 +0000
@@ -756,8 +756,7 @@
void
xft_settings_event (struct x_display_info *dpyinfo, XEvent *event)
{
- int check_window_p = 0;
- int apply_settings = 0;
+ bool check_window_p = 0, apply_settings_p = 0;
switch (event->type)
{
@@ -777,7 +776,7 @@
if (event->xproperty.window == dpyinfo->xsettings_window
&& event->xproperty.state == PropertyNewValue
&& event->xproperty.atom == dpyinfo->Xatom_xsettings_prop)
- apply_settings = 1;
+ apply_settings_p = 1;
break;
}
@@ -787,10 +786,10 @@
dpyinfo->xsettings_window = None;
get_prop_window (dpyinfo);
if (dpyinfo->xsettings_window != None)
- apply_settings = 1;
+ apply_settings_p = 1;
}
- if (apply_settings)
+ if (apply_settings_p)
read_and_apply_settings (dpyinfo, True);
}
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2013-07-26 07:38:18 +0000
+++ b/src/xterm.c 2013-07-30 05:56:18 +0000
@@ -2691,7 +2691,7 @@
static void
x_draw_glyph_string (struct glyph_string *s)
{
- int relief_drawn_p = 0;
+ bool relief_drawn_p = 0;
/* If S draws into the background of its successors, draw the
background of the successors first so that S can draw into it.
@@ -6854,7 +6854,7 @@
{
/* If we decide we want to generate an event to be seen
by the rest of Emacs, we put it here. */
- int tool_bar_p = 0;
+ bool tool_bar_p = 0;
memset (&compose_status, 0, sizeof (compose_status));
last_mouse_glyph_frame = 0;
@@ -7663,7 +7663,7 @@
/* Nonzero if we had any X protocol errors
since we did x_catch_errors on DPY. */
-int
+bool
x_had_errors_p (Display *dpy)
{
/* Make sure to catch any errors incurred so far. */
=== modified file 'src/xterm.h'
--- a/src/xterm.h 2013-07-05 16:58:01 +0000
+++ b/src/xterm.h 2013-07-30 05:56:18 +0000
@@ -947,7 +947,7 @@
extern void x_catch_errors (Display *);
extern void x_check_errors (Display *, const char *)
ATTRIBUTE_FORMAT_PRINTF (2, 0);
-extern int x_had_errors_p (Display *);
+extern bool x_had_errors_p (Display *);
extern void x_uncatch_errors (void);
extern void x_clear_errors (Display *);
extern void x_set_window_size (struct frame *, int, int, int);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r113592: * fringe.c (draw_window_fringes, update_window_fringes),
Dmitry Antipov <=