summaryrefslogtreecommitdiff
path: root/pkg/the_silver_searcher/patch/0002-Use-inline-function-for-min-instead-of-statement-exp.patch
blob: 69b08f11760418111775f39702c120ebbf76114c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From dc1be161f9155e92367714b38f6a45d05d4f90cd Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 15 Jun 2019 20:58:46 -0700
Subject: [PATCH] Use inline function for min instead of statement expression
Upstream: https://github.com/ggreer/the_silver_searcher/pull/1324

---
 src/zfile.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/zfile.c b/src/zfile.c
index e4b7566..29fbb07 100644
--- a/src/zfile.c
+++ b/src/zfile.c
@@ -33,10 +33,11 @@ typedef _off64_t off64_t;
 
 #if HAVE_FOPENCOOKIE
 
-#define min(a, b) ({				\
-	__typeof (a) _a = (a);			\
-	__typeof (b) _b = (b);			\
-	_a < _b ? _a : _b; })
+static inline size_t
+min(size_t a, size_t b)
+{
+	return a < b ? a : b;
+}
 
 static cookie_read_function_t zfile_read;
 static cookie_seek_function_t zfile_seek;
-- 
2.20.1