1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 15:00:45 -08:00

Minor putc tweaks

* src/emacs-module.c (module_abort):
* src/xdisp.c (vmessage):
Prefer fputc to putc, since speed isn’t crucial here.
* src/region-cache.c (pp_cache) [ENABLE_CHECKING]: Simplify.
This commit is contained in:
Paul Eggert 2019-06-20 00:01:06 -07:00
parent fdbbbf94a5
commit 5f32ac13c8
3 changed files with 8 additions and 14 deletions

View file

@ -1304,7 +1304,7 @@ module_abort (const char *format, ...)
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
putc ('\n', stderr);
fputc ('\n', stderr);
fflush (NULL);
emacs_abort ();
}

View file

@ -759,7 +759,6 @@ void pp_cache (struct region_cache *) EXTERNALLY_VISIBLE;
void
pp_cache (struct region_cache *c)
{
ptrdiff_t i;
ptrdiff_t beg_u = c->buffer_beg + c->beg_unchanged;
ptrdiff_t end_u = c->buffer_end - c->end_unchanged;
@ -768,19 +767,14 @@ pp_cache (struct region_cache *c)
c->buffer_beg, c->buffer_end,
beg_u, end_u);
for (i = 0; i < c->cache_len; i++)
for (ptrdiff_t i = 0; i < c->cache_len; i++)
{
ptrdiff_t pos = BOUNDARY_POS (c, i);
putc (((pos < beg_u) ? 'v'
: (pos == beg_u) ? '-'
: ' '),
stderr);
putc (((pos > end_u) ? '^'
: (pos == end_u) ? '-'
: ' '),
stderr);
fprintf (stderr, "%"pD"d : %d\n", pos, BOUNDARY_VALUE (c, i));
fprintf (stderr, "%c%c%"pD"d : %d\n",
pos < beg_u ? 'v' : pos == beg_u ? '-' : ' ',
pos > end_u ? '^' : pos == end_u ? '-' : ' ',
pos, BOUNDARY_VALUE (c, i));
}
}

View file

@ -10845,11 +10845,11 @@ vmessage (const char *m, va_list ap)
if (m)
{
if (noninteractive_need_newline)
putc ('\n', stderr);
fputc ('\n', stderr);
noninteractive_need_newline = false;
vfprintf (stderr, m, ap);
if (!cursor_in_echo_area)
fprintf (stderr, "\n");
fputc ('\n', stderr);
fflush (stderr);
}
}