diff options
| author | Paul Eggert | 2024-01-28 00:15:38 -0800 |
|---|---|---|
| committer | Paul Eggert | 2024-01-28 00:26:44 -0800 |
| commit | ad2c81082a62f9f781e4f5771fc223520d91cefd (patch) | |
| tree | 7abd8b081eb665e84cb127e0c5396fa7df453bb4 /src/textconv.c | |
| parent | a3d7092114db09fee392ccc8187fde03376f2089 (diff) | |
| download | emacs-ad2c81082a62f9f781e4f5771fc223520d91cefd.tar.gz emacs-ad2c81082a62f9f781e4f5771fc223520d91cefd.zip | |
Prefer C23 ckd_* to Gnulib *_WRAPV and *_OK macros
* src/alloc.c (android_make_lisp_symbol) [HAVE_ANDROID && !__clang__]:
* src/android.c (android_blit_copy, android_blit_xor)
(android_get_image):
* src/androidmenu.c (android_menu_show):
* src/androidselect.c (Fandroid_get_clipboard_data)
(android_notifications_notify_1):
* src/androidterm.c (android_decode_utf16)
(android_text_to_string):
* src/haiku_select.cc (be_display_notification):
* src/sfnt.c (sfnt_read_cmap_format_8, sfnt_read_cmap_format_12)
(sfnt_read_cmap_format_14, sfnt_read_cmap_table_1)
(sfnt_expand_compound_glyph_context, sfnt_poly_edges_exact)
(sfnt_read_meta_table, sfnt_read_ttc_header)
(sfnt_read_cvt_table, sfnt_read_fpgm_table)
(sfnt_read_prep_table, sfnt_make_interpreter)
(sfnt_interpret_simple_glyph, sfnt_interpret_compound_glyph_2)
(sfnt_interpret_compound_glyph, sfnt_read_default_uvs_table)
(sfnt_read_nondefault_uvs_table, sfnt_create_uvs_context)
(sfnt_read_fvar_table, sfnt_read_gvar_table)
(sfnt_read_avar_table, sfnt_read_cvar_table):
* src/sfntfont-android.c (GET_SCANLINE_BUFFER):
* src/textconv.c (really_commit_text, really_set_composing_text)
(really_replace_text, get_surrounding_text):
Prefer C2x stdckdint.h macros to intprops.h macros.
Diffstat (limited to 'src/textconv.c')
| -rw-r--r-- | src/textconv.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/textconv.c b/src/textconv.c index 2a7b0ed330d..0d35ec19c55 100644 --- a/src/textconv.c +++ b/src/textconv.c | |||
| @@ -649,8 +649,7 @@ really_commit_text (struct frame *f, EMACS_INT position, | |||
| 649 | start of the text that was inserted. */ | 649 | start of the text that was inserted. */ |
| 650 | wanted = start; | 650 | wanted = start; |
| 651 | 651 | ||
| 652 | if (INT_ADD_WRAPV (wanted, position, &wanted) | 652 | if (ckd_add (&wanted, wanted, position) || wanted < BEGV) |
| 653 | || wanted < BEGV) | ||
| 654 | wanted = BEGV; | 653 | wanted = BEGV; |
| 655 | 654 | ||
| 656 | if (wanted > ZV) | 655 | if (wanted > ZV) |
| @@ -664,8 +663,7 @@ really_commit_text (struct frame *f, EMACS_INT position, | |||
| 664 | TEXT. */ | 663 | TEXT. */ |
| 665 | wanted = PT; | 664 | wanted = PT; |
| 666 | 665 | ||
| 667 | if (INT_ADD_WRAPV (wanted, position - 1, &wanted) | 666 | if (ckd_add (&wanted, wanted, position - 1) || wanted > ZV) |
| 668 | || wanted > ZV) | ||
| 669 | wanted = ZV; | 667 | wanted = ZV; |
| 670 | 668 | ||
| 671 | if (wanted < BEGV) | 669 | if (wanted < BEGV) |
| @@ -712,8 +710,7 @@ really_commit_text (struct frame *f, EMACS_INT position, | |||
| 712 | 710 | ||
| 713 | if (position <= 0) | 711 | if (position <= 0) |
| 714 | { | 712 | { |
| 715 | if (INT_ADD_WRAPV (wanted, position, &wanted) | 713 | if (ckd_add (&wanted, wanted, position) || wanted < BEGV) |
| 716 | || wanted < BEGV) | ||
| 717 | wanted = BEGV; | 714 | wanted = BEGV; |
| 718 | 715 | ||
| 719 | if (wanted > ZV) | 716 | if (wanted > ZV) |
| @@ -725,8 +722,7 @@ really_commit_text (struct frame *f, EMACS_INT position, | |||
| 725 | { | 722 | { |
| 726 | wanted = PT; | 723 | wanted = PT; |
| 727 | 724 | ||
| 728 | if (INT_ADD_WRAPV (wanted, position - 1, &wanted) | 725 | if (ckd_add (&wanted, wanted, position - 1) || wanted > ZV) |
| 729 | || wanted > ZV) | ||
| 730 | wanted = ZV; | 726 | wanted = ZV; |
| 731 | 727 | ||
| 732 | if (wanted < BEGV) | 728 | if (wanted < BEGV) |
| @@ -870,8 +866,7 @@ really_set_composing_text (struct frame *f, ptrdiff_t position, | |||
| 870 | { | 866 | { |
| 871 | wanted = start; | 867 | wanted = start; |
| 872 | 868 | ||
| 873 | if (INT_SUBTRACT_WRAPV (wanted, position, &wanted) | 869 | if (ckd_sub (&wanted, wanted, position) || wanted < BEGV) |
| 874 | || wanted < BEGV) | ||
| 875 | wanted = BEGV; | 870 | wanted = BEGV; |
| 876 | 871 | ||
| 877 | if (wanted > ZV) | 872 | if (wanted > ZV) |
| @@ -885,8 +880,7 @@ really_set_composing_text (struct frame *f, ptrdiff_t position, | |||
| 885 | /* end should be PT after the edit. */ | 880 | /* end should be PT after the edit. */ |
| 886 | eassert (end == PT); | 881 | eassert (end == PT); |
| 887 | 882 | ||
| 888 | if (INT_ADD_WRAPV (wanted, position - 1, &wanted) | 883 | if (ckd_add (&wanted, wanted, position - 1) || wanted > ZV) |
| 889 | || wanted > ZV) | ||
| 890 | wanted = ZV; | 884 | wanted = ZV; |
| 891 | 885 | ||
| 892 | if (wanted < BEGV) | 886 | if (wanted < BEGV) |
| @@ -1256,8 +1250,7 @@ really_replace_text (struct frame *f, ptrdiff_t start, ptrdiff_t end, | |||
| 1256 | 1250 | ||
| 1257 | if (position <= 0) | 1251 | if (position <= 0) |
| 1258 | { | 1252 | { |
| 1259 | if (INT_ADD_WRAPV (wanted, position, &wanted) | 1253 | if (ckd_add (&wanted, wanted, position) || wanted < BEGV) |
| 1260 | || wanted < BEGV) | ||
| 1261 | wanted = BEGV; | 1254 | wanted = BEGV; |
| 1262 | 1255 | ||
| 1263 | if (wanted > ZV) | 1256 | if (wanted > ZV) |
| @@ -1269,8 +1262,7 @@ really_replace_text (struct frame *f, ptrdiff_t start, ptrdiff_t end, | |||
| 1269 | { | 1262 | { |
| 1270 | wanted = PT; | 1263 | wanted = PT; |
| 1271 | 1264 | ||
| 1272 | if (INT_ADD_WRAPV (wanted, position - 1, &wanted) | 1265 | if (ckd_add (&wanted, wanted, position - 1) || wanted > ZV) |
| 1273 | || wanted > ZV) | ||
| 1274 | wanted = ZV; | 1266 | wanted = ZV; |
| 1275 | 1267 | ||
| 1276 | if (wanted < BEGV) | 1268 | if (wanted < BEGV) |
| @@ -2020,8 +2012,8 @@ get_surrounding_text (struct frame *f, ptrdiff_t left, | |||
| 2020 | 2012 | ||
| 2021 | /* And subtract left and right. */ | 2013 | /* And subtract left and right. */ |
| 2022 | 2014 | ||
| 2023 | if (INT_SUBTRACT_WRAPV (start, left, &start) | 2015 | if (ckd_sub (&start, start, left) |
| 2024 | || INT_ADD_WRAPV (end, right, &end)) | 2016 | || ckd_add (&end, end, right)) |
| 2025 | goto finish; | 2017 | goto finish; |
| 2026 | 2018 | ||
| 2027 | start = max (start, BEGV); | 2019 | start = max (start, BEGV); |