1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-14 03:39:53 +03:00
aports/community/calcurse/0002-gcc14-32-bit.patch
mio fdb8a92ce8 community/calcurse: fix build with gcc 14 on 32-bit arches
Fix -Wincompatible-pointer-types error with gcc 14 on 32-bit arches.

```
day.c: In function 'day_paste_item':
day.c:870:25: error: passing argument 3 of 'overflow_add' from incompatible pointer type [-Wincompatible-pointer-types]
  870 |                         &until)
      |                         ^~~~~~
      |                         |
      |                         time_t * {aka long long int *}
In file included from day.c:43:
calcurse.h:1275:31: note: expected 'long int *' but argument is of type 'time_t *' {aka 'long long int *'}
 1275 | long overflow_add(long, long, long *);
      |                               ^~~~~~
```
2024-11-20 06:49:11 +00:00

35 lines
992 B
Diff

Use time_t in overflow_add() time value.
--- calcurse-4.8.1-orig/src/calcurse.h
+++ calcurse-4.8.1/src/calcurse.h
@@ -1272,7 +1272,7 @@
int starts_with(const char *, const char *);
int starts_with_ci(const char *, const char *);
int hash_matches(const char *, const char *);
-long overflow_add(long, long, long *);
+long overflow_add(long, long, time_t *);
long overflow_mul(long, long, long *);
time_t next_wday(time_t, int);
int wday_per_year(int, int);
--- calcurse-4.8.1-orig/src/utils.c
+++ calcurse-4.8.1/src/utils.c
@@ -1260,8 +1260,8 @@
dur += in;
if (start) {
/* wanted: end = start + dur * MININSEC */
- time_t end;
- long p, s;
+ time_t end, s;
+ long p;
if (overflow_mul(dur, MININSEC, &p))
return 0;
if (overflow_add(start, p, &s))
@@ -2043,7 +2043,7 @@
/*
* Overflow check for addition with positive second term.
*/
-long overflow_add(long x, long y, long *z)
+long overflow_add(long x, long y, time_t *z)
{
if (!YEAR1902_2037)
goto exit;