GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
int width = w->total_cols;
double d = max (0, margin);
d = min (width / 2 - 1, d);
- return (int) ((double) total_glyphs / width * d);
+ /* Since MARGIN is positive, we cannot possibly have less than
+ one glyph for the marginal area. */
+ return max (1, (int) ((double) total_glyphs / width * d));
}
return 0;
}
clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
{
eassert (start <= end);
- eassert (start >= 0 && start < matrix->nrows);
+ eassert (start >= 0 && (start < matrix->nrows
+ /* matrix->nrows can be 0 for the initial frame. */
+ || (matrix->nrows == 0)));
eassert (end >= 0 && end <= matrix->nrows);
for (; start < end; ++start)
SECONDS may be a floating-point value, meaning that you can wait for a
fraction of a second. Optional second arg MILLISECONDS specifies an
additional wait period, in milliseconds; this is for backwards compatibility.
-(Not all operating systems support waiting for a fraction of a second.) */)
+\(Not all operating systems support waiting for a fraction of a second.) */)
(Lisp_Object seconds, Lisp_Object milliseconds)
{
double duration = extract_float (seconds);
#endif
/* If no window system has been specified, try to use the terminal. */
- if (! isatty (0))
+ if (! isatty (STDIN_FILENO))
fatal ("standard input is not a tty");
#ifdef WINDOWSNT