git: 62dc27e0ab67 - main - sysutils/fsearch: try to unbreak the port's build on -CURRENT/i386:

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Mon, 31 Jul 2023 06:59:39 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=62dc27e0ab67cf20aacccccc61a57ea8edd86555

commit 62dc27e0ab67cf20aacccccc61a57ea8edd86555
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-07-31 06:58:58 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-07-31 06:58:58 +0000

    sysutils/fsearch: try to unbreak the port's build on -CURRENT/i386:
    
      error: incompatible function pointer types passing 'bool (const
      char *, time_t *, time_t *)' (aka 'bool (const char *, int *,
      int *)') to parameter of type 'FsearchQueryIntegerParserFunc *'
      (aka 'bool (*)(const char *, long long *, long long *)')
    
    i386 is the only architecture with 32-bit `time_t' and I don't think
    adding another `FsearchQueryTimeParserFunc' type just to circumvent
    this [-Wincompatible-function-pointer-types] issue is warranted, or
    even upstreamable, so simply pass those numbers as `int64_t' as this
    does not affect internal time-related calculations.
    
    Reported by:    pkg-fallout
---
 sysutils/fsearch/Makefile                          |  3 ++
 .../fsearch/files/patch-src_fsearch__time__utils.c | 34 ++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/sysutils/fsearch/Makefile b/sysutils/fsearch/Makefile
index 80ea1f12937d..8353baa30a5c 100644
--- a/sysutils/fsearch/Makefile
+++ b/sysutils/fsearch/Makefile
@@ -23,5 +23,8 @@ post-patch:
 	@${PRINTF} '\n%s\n%s;\n' int \
 		'strverscmp(const char *, const char *)' \
 		>> ${WRKSRC}/src/fsearch_string_utils.h
+	@${REINPLACE_CMD} -e 's,time_t,int64_t,g' \
+		${WRKSRC}/src/fsearch_time_utils.h \
+		${WRKSRC}/src/tests/test_time_utils.c
 
 .include <bsd.port.mk>
diff --git a/sysutils/fsearch/files/patch-src_fsearch__time__utils.c b/sysutils/fsearch/files/patch-src_fsearch__time__utils.c
new file mode 100644
index 000000000000..c6def574e2fa
--- /dev/null
+++ b/sysutils/fsearch/files/patch-src_fsearch__time__utils.c
@@ -0,0 +1,34 @@
+--- src/fsearch_time_utils.c.orig	2022-08-22 10:06:20 UTC
++++ src/fsearch_time_utils.c
+@@ -1,11 +1,11 @@
+ #define _GNU_SOURCE
+ 
+-#include "fsearch_time_utils.h"
+-
+ #include <glib.h>
+ #include <stdint.h>
+ #include <time.h>
+ 
++#include "fsearch_time_utils.h"
++
+ typedef enum FsearchDateTimeType {
+     FSEARCH_DATE_TIME_TYPE_SECOND,
+     FSEARCH_DATE_TIME_TYPE_MINUTE,
+@@ -377,7 +377,7 @@ parse_implicit_date_time_constants(const char *str, st
+ }
+ 
+ static bool
+-parse_date_time_constants(const char *str, time_t *time_start_out, time_t *time_end_out) {
++parse_date_time_constants(const char *str, int64_t *time_start_out, int64_t *time_end_out) {
+     struct tm tm_start = {};
+     struct tm tm_end = {};
+ 
+@@ -469,7 +469,7 @@ round_down_tm_to_reference_with_date_time_accuracy(str
+ }
+ 
+ bool
+-fsearch_date_time_parse_interval(const char *str, time_t *time_start_out, time_t *time_end_out) {
++fsearch_date_time_parse_interval(const char *str, int64_t *time_start_out, int64_t *time_end_out) {
+     if (parse_date_time_constants(str, time_start_out, time_end_out)) {
+         return true;
+     }