logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-Use-inline-function-for-min-instead-of-statement-exp.patch (840B)


  1. From dc1be161f9155e92367714b38f6a45d05d4f90cd Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 15 Jun 2019 20:58:46 -0700
  4. Subject: [PATCH] Use inline function for min instead of statement expression
  5. Upstream: https://github.com/ggreer/the_silver_searcher/pull/1324
  6. ---
  7. src/zfile.c | 9 +++++----
  8. 1 file changed, 5 insertions(+), 4 deletions(-)
  9. diff --git a/src/zfile.c b/src/zfile.c
  10. index e4b7566..29fbb07 100644
  11. --- a/src/zfile.c
  12. +++ b/src/zfile.c
  13. @@ -33,10 +33,11 @@ typedef _off64_t off64_t;
  14. #if HAVE_FOPENCOOKIE
  15. -#define min(a, b) ({ \
  16. - __typeof (a) _a = (a); \
  17. - __typeof (b) _b = (b); \
  18. - _a < _b ? _a : _b; })
  19. +static inline size_t
  20. +min(size_t a, size_t b)
  21. +{
  22. + return a < b ? a : b;
  23. +}
  24. static cookie_read_function_t zfile_read;
  25. static cookie_seek_function_t zfile_seek;
  26. --
  27. 2.20.1