File: 1070-64bit-time.patch

package info (click to toggle)
gpstrans 0.41-13
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 916 kB
  • sloc: ansic: 6,200; makefile: 158; xml: 17
file content (40 lines) | stat: -rw-r--r-- 1,738 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
39
40
Description: Use time_t for ctime argument.
 This ensure the code handle 64 bit time on 32 bit architectures,
 fixing a build failure:
    sendgpsinfo.c: In function 'doWaypoint':
    sendgpsinfo.c:646:46: error: passing argument 1 of 'ctime' from incompatible pointer type [-Wincompatible-pointer-types]
      646 |       if(pkt.has.seconds) printf("%s", ctime(&pkt.seconds));
          |                                              ^~~~~~~~~~~~
          |                                              |
          |                                              long int *
    In file included from /usr/include/features.h:502,
                     from /usr/include/arm-linux-gnueabihf/bits/libc-header-start.h:33,
                     from /usr/include/stdio.h:28,
                     from ../include/defs.h:1,
                     from sendgpsinfo.c:33:
    /usr/include/time.h:187:14: note: expected 'const time_t *' {aka 'const long long int *'} but argument is of type 'long int *'
      187 | extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64);
          |              ^~~~~~~~~~~~~~
Author: Petter Reinholdtsen <pere@debian.org>
Bug-Debian: https://bugs.debian.org/1078085
Forwarded: no
Last-Update: 2024-08-07
---
--- gpstrans-0.41.orig/src/gps/sendgpsinfo.c
+++ gpstrans-0.41/src/gps/sendgpsinfo.c
@@ -497,13 +497,13 @@ doWaypoint (short type)
   {
     char type;
     char *comment, *name;    
-    long seconds;
+    time_t seconds;
     double latitude, longitude;
     double altitude;
     struct {
       /* latitude and longitude are always present */
       unsigned altitude:1;
-      unsigned seconds:1;
+      time_t seconds:1;
       unsigned name:1;
       unsigned comment:1;
     } has;