]> git.eshelyaron.com Git - emacs.git/commitdiff
textconv.c: Fix warnings with-wide-int
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Feb 2024 21:07:24 +0000 (16:07 -0500)
committerEshel Yaron <me@eshelyaron.com>
Sun, 4 Feb 2024 11:05:35 +0000 (12:05 +0100)
* src/textconv.c (set_composing_region, textconv_set_point_and_mark):
Use `min/max`.

(cherry picked from commit d41cdceb133e30c71a95fe893d70645472b326e3)

src/textconv.c

index 0d35ec19c55a059368f33600bd94c2a84c0bf99c..0941848dd09d78fc28b1dd7018c45fcaf0db3528 100644 (file)
@@ -1705,11 +1705,8 @@ set_composing_region (struct frame *f, ptrdiff_t start,
 {
   struct text_conversion_action *action, **last;
 
-  if (start > MOST_POSITIVE_FIXNUM)
-    start = MOST_POSITIVE_FIXNUM;
-
-  if (end > MOST_POSITIVE_FIXNUM)
-    end = MOST_POSITIVE_FIXNUM;
+  start = min (start, MOST_POSITIVE_FIXNUM);
+  end = min (end, MOST_POSITIVE_FIXNUM);
 
   action = xmalloc (sizeof *action);
   action->operation = TEXTCONV_SET_COMPOSING_REGION;
@@ -1734,8 +1731,7 @@ textconv_set_point_and_mark (struct frame *f, ptrdiff_t point,
 {
   struct text_conversion_action *action, **last;
 
-  if (point > MOST_POSITIVE_FIXNUM)
-    point = MOST_POSITIVE_FIXNUM;
+  point = min (point, MOST_POSITIVE_FIXNUM);
 
   action = xmalloc (sizeof *action);
   action->operation = TEXTCONV_SET_POINT_AND_MARK;