int c;
unsigned char hide_char = 0;
struct emacs_tty etty;
- bool etty_valid;
+ bool etty_valid IF_LINT (= false);
/* Check, whether we need to suppress echoing. */
if (CHARACTERP (Vread_hide_char))
/* Manipulate tty. */
if (hide_char)
{
- etty_valid = emacs_get_tty (fileno (stdin), &etty) == 0;
+ etty_valid = emacs_get_tty (STDIN_FILENO, &etty) == 0;
if (etty_valid)
- set_binary_mode (fileno (stdin), O_BINARY);
- suppress_echo_on_tty (fileno (stdin));
+ set_binary_mode (STDIN_FILENO, O_BINARY);
+ suppress_echo_on_tty (STDIN_FILENO);
}
fwrite (SDATA (prompt), 1, SBYTES (prompt), stdout);
fprintf (stdout, "\n");
if (etty_valid)
{
- emacs_set_tty (fileno (stdin), &etty, 0);
- set_binary_mode (fileno (stdin), O_TEXT);
+ emacs_set_tty (STDIN_FILENO, &etty, 0);
+ set_binary_mode (STDIN_FILENO, O_TEXT);
}
}
}
/* Return a buffer to be used as the minibuffer at depth `depth'.
- depth = 0 is the lowest allowed argument, and that is the value
- used for nonrecursive minibuffer invocations. */
+ depth = 0 is the lowest allowed argument, and that is the value
+ used for nonrecursive minibuffer invocations. */
Lisp_Object
get_minibuffer (EMACS_INT depth)
{
- Lisp_Object tail, num, buf;
- char name[sizeof " *Minibuf-*" + INT_STRLEN_BOUND (EMACS_INT)];
-
- XSETFASTINT (num, depth);
- tail = Fnthcdr (num, Vminibuffer_list);
+ Lisp_Object tail = Fnthcdr (make_number (depth), Vminibuffer_list);
if (NILP (tail))
{
tail = list1 (Qnil);
Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
}
- buf = Fcar (tail);
+ Lisp_Object buf = Fcar (tail);
if (NILP (buf) || !BUFFER_LIVE_P (XBUFFER (buf)))
{
- buf = Fget_buffer_create
- (make_formatted_string (name, " *Minibuf-%"pI"d*", depth));
+ static char const name_fmt[] = " *Minibuf-%"pI"d*";
+ char name[sizeof name_fmt + INT_STRLEN_BOUND (EMACS_INT)];
+ AUTO_STRING_WITH_LEN (lname, name, sprintf (name, name_fmt, depth));
+ buf = Fget_buffer_create (lname);
/* Although the buffer's name starts with a space, undo should be
enabled in it. */