diff options
| author | Stefan Kangas | 2024-07-24 00:09:49 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2024-07-24 00:11:37 +0200 |
| commit | e25655756315ac398d15b308511a8e9abf20bb0e (patch) | |
| tree | 3e81a7dc0ab9abcfb9364b96f0f10559e61aef66 /src/dispnew.c | |
| parent | 19a18e487b8e2f0c1627b9cc98e601327e884eb2 (diff) | |
| download | emacs-scratch/static_assert.tar.gz emacs-scratch/static_assert.zip | |
Prefer static_assert to verifyscratch/static_assert
Although static_assert is C11-specific, and Emacs remains on C99, it
has been backported to older compilers by Gnulib. Gnulib has already
changed to prefer static_assert, and we can do the same.
* lib-src/asset-directory-tool.c (main_2):
* src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc)
(vectorlike_nbytes, allocate_pseudovector):
* src/android.c (android_globalize_reference, android_set_dashes):
* src/android.h:
* src/androidfont.c (androidfont_draw, androidfont_text_extents):
* src/androidvfs.c:
* src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT)
(bidi_find_bracket_pairs):
* src/buffer.c (init_buffer_once):
* src/casefiddle.c (do_casify_multibyte_string):
* src/dispnew.c (scrolling_window, scrolling):
* src/editfns.c (styled_format):
* src/emacs-module.c (module_extract_big_integer):
* src/fileio.c (Fdo_auto_save):
* src/fns.c (next_almost_prime, hash_string):
* src/fringe.c (init_fringe):
* src/keyboard.h (kbd_buffer_store_event_hold):
* src/keymap.c:
* src/lisp.h (u, memclear, reduce_emacs_uint_to_hash_hash)
(modiff_incr):
* src/lread.c (skip_lazy_string):
* src/pdumper.c (dump_bignum, Fdump_emacs_portable)
(dump_do_dump_relocation, pdumper_load):
* src/process.c (make_process, Fmake_process)
(connect_network_socket):
* src/regex-emacs.c:
* src/sort.c (tim_sort):
* src/sysdep.c (init_random, SSIZE_MAX):
* src/thread.c:
* src/timefns.c (trillion_factor):
* src/unexelf.c:
* src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib
verify. Remove import of verify.h, except when used for other reasons.
Diffstat (limited to 'src/dispnew.c')
| -rw-r--r-- | src/dispnew.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 8bbb818bc19..1a243079e46 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -4667,7 +4667,7 @@ scrolling_window (struct window *w, int tab_line_p) | |||
| 4667 | 13, then next_almost_prime_increment_max would be 14, e.g., | 4667 | 13, then next_almost_prime_increment_max would be 14, e.g., |
| 4668 | because next_almost_prime (113) would be 127. */ | 4668 | because next_almost_prime (113) would be 127. */ |
| 4669 | { | 4669 | { |
| 4670 | verify (NEXT_ALMOST_PRIME_LIMIT == 11); | 4670 | static_assert (NEXT_ALMOST_PRIME_LIMIT == 11); |
| 4671 | enum { next_almost_prime_increment_max = 10 }; | 4671 | enum { next_almost_prime_increment_max = 10 }; |
| 4672 | ptrdiff_t row_table_max = | 4672 | ptrdiff_t row_table_max = |
| 4673 | (min (PTRDIFF_MAX, SIZE_MAX) / (3 * sizeof *row_table) | 4673 | (min (PTRDIFF_MAX, SIZE_MAX) / (3 * sizeof *row_table) |
| @@ -5118,8 +5118,8 @@ scrolling (struct frame *frame) | |||
| 5118 | int free_at_end_vpos = height; | 5118 | int free_at_end_vpos = height; |
| 5119 | struct glyph_matrix *current_matrix = frame->current_matrix; | 5119 | struct glyph_matrix *current_matrix = frame->current_matrix; |
| 5120 | struct glyph_matrix *desired_matrix = frame->desired_matrix; | 5120 | struct glyph_matrix *desired_matrix = frame->desired_matrix; |
| 5121 | verify (sizeof (int) <= sizeof (unsigned)); | 5121 | static_assert (sizeof (int) <= sizeof (unsigned)); |
| 5122 | verify (alignof (unsigned) % alignof (int) == 0); | 5122 | static_assert (alignof (unsigned) % alignof (int) == 0); |
| 5123 | unsigned *old_hash; | 5123 | unsigned *old_hash; |
| 5124 | USE_SAFE_ALLOCA; | 5124 | USE_SAFE_ALLOCA; |
| 5125 | SAFE_NALLOCA (old_hash, 4, height); | 5125 | SAFE_NALLOCA (old_hash, 4, height); |