static void
bidi_set_sos_type (struct bidi_it *bidi_it, int level_before, int level_after)
{
- int higher_level = (level_before > level_after ? level_before : level_after);
+ int higher_level = max (level_before, level_after);
/* FIXME: should the default sos direction be user selectable? */
bidi_it->sos = ((higher_level & 1) != 0 ? R2L : L2R); /* X10 */
if (pos == stop_charset)
buf = handle_charset_annotation (pos, end_pos, coding,
buf, &stop_charset);
- stop = (stop_composition < stop_charset
- ? stop_composition : stop_charset);
+ stop = min (stop_composition, stop_charset);
}
if (! multibytep)
mem2 *= 4096;
/* Surely, the available memory is at least what we have physically
available, right? */
- if (mem1 >= mem2)
- freemem = mem1;
- else
- freemem = mem2;
+ freemem = max (mem1, mem2);
*freeram = freemem;
*totalswap =
((long)info.max_pages_in_paging_file == -1L)
new[to++] = argv[best + i + 1];
}
- incoming_used += 1 + (options[best] > 0 ? options[best] : 0);
+ incoming_used += 1 + max (options[best], 0);
/* Clear out this option in ARGV. */
argv[best] = 0;
while (!CHAR_HEAD_P (*p) && p < string + length)
p++;
- return (combining_bytes < p - string ? combining_bytes : p - string);
+ return min (combining_bytes, p - string);
}
/* See if the bytes after POS/POS_BYTE combine with bytes
bufp++, pos_byte++;
while (!CHAR_HEAD_P (*bufp)) bufp++, pos_byte++;
- return (bytes <= pos_byte - opos_byte ? bytes : pos_byte - opos_byte);
+ return min (bytes, pos_byte - opos_byte);
}
#endif
/* Relocate point as if it were a marker. */
if (from < PT)
- adjust_point ((from + inschars - (PT < to ? PT : to)),
- (from_byte + outgoing_insbytes
- - (PT_BYTE < to_byte ? PT_BYTE : to_byte)));
+ adjust_point ((from + inschars - min (PT, to)),
+ (from_byte + outgoing_insbytes - min (PT_BYTE, to_byte)));
check_markers ();
/* Relocate point as if it were a marker. */
if (from < PT)
- adjust_point (from - (PT < to ? PT : to),
- from_byte - (PT_BYTE < to_byte ? PT_BYTE : to_byte));
+ adjust_point (from - min (PT, to),
+ from_byte - min (PT_BYTE, to_byte));
offset_intervals (current_buffer, from, - nchars_del);
/* If the run is short, extend it to min(minrun, nremaining). */
if (n < minrun)
{
- const ptrdiff_t force = nremaining <= minrun ?
- nremaining : minrun;
+ const ptrdiff_t force = min (nremaining, minrun);
binarysort (&ms, lo, lo + force, lo + n);
n = force;
}
errno = 0;
while (count > 0)
{
- unsigned this_chunk = count < chunk ? count : chunk;
+ unsigned this_chunk = min (count, chunk);
int n = _write (fd, p, this_chunk);
if (n > 0)
/* Get the `face' or `mouse_face' text property at POS, and
determine the next position at which the property changes. */
prop = Fget_text_property (position, propname, w->contents);
- XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
+ XSETFASTINT (limit1, min (limit, endpos));
end = Fnext_single_property_change (position, propname, w->contents, limit1);
if (FIXNUMP (end))
endpos = XFIXNUM (end);
/* Get the `face' or `mouse_face' text property at POS, and
determine the next position at which the property changes. */
prop = Fget_text_property (position, propname, w->contents);
- XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
+ XSETFASTINT (limit1, min (limit, endpos));
end = Fnext_single_property_change (position, propname, w->contents, limit1);
if (FIXNUMP (end))
endpos = XFIXNUM (end);