bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#35062: [PATCH v3 2/3] constify a bit of xterm.c


From: Eli Zaretskii
Subject: bug#35062: [PATCH v3 2/3] constify a bit of xterm.c
Date: Sat, 13 Apr 2019 11:15:20 +0300

> From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
> Date: Sun,  7 Apr 2019 05:13:30 +0300
> 
> * src/xterm.c (x_cr_draw_image, x_update_begin,
> x_clear_under_internal_border, x_draw_fringe_bitmap,
> x_set_glyph_string_clipping, x_draw_glyph_string_background,
> x_draw_composite_glyph_string_foreground, x_send_scroll_bar_event): make
> code easier to follow by making explicit that some variables are
> immutable. (Bug#35062)
> ---
> v3: mention functions changed in commit messages, mention the bug
> number, and don't mention that it fixes a warning since intention  of
> changes is clear either way.

I'm really struggling with these changes.  My main problem is that I
don't see how using 'const' here improves the readability and clarity
of the code.  IMO, if the variable's name doesn't state its purpose,
adding 'const' won't help much.  And I think compilers nowadays are
smart enough to deduce this by themselves.

We had in the past similar issue with the 'register' qualifier;
nowadays we remove those whenever we change code that uses them.
Isn't it the same with 'const'?

Paul, could you please comment on these proposed changes?

Thanks.





reply via email to

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