aports/community/pilot-link/gcc14.patch

83 lines
2.5 KiB
Diff

--- pilot-link-14338868-origin/libpisock/linuxusb.c
+++ pilot-link-14338868/libpisock/linuxusb.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/socket.h>
#include "pi-debug.h"
#include "pi-source.h"
@@ -48,8 +49,8 @@
static int u_open(pi_socket_t *ps, struct pi_sockaddr *addr, size_t addrlen);
static int u_close(pi_socket_t *ps);
-static int u_write(pi_socket_t *ps, unsigned char *buf, size_t len, int flags);
-static int u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags);
+static ssize_t u_write(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags);
+static ssize_t u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags);
static int u_poll(pi_socket_t *ps, int timeout);
static int u_flush(pi_socket_t *ps, int flags);
@@ -188,8 +189,8 @@
* Returns: Nothing
*
***********************************************************************/
-static int
-u_write(pi_socket_t *ps, unsigned char *buf, size_t len, int flags)
+static ssize_t
+u_write(pi_socket_t *ps, const unsigned char *buf, size_t len, int flags)
{
int total,
nwrote;
@@ -281,7 +282,7 @@
* Returns: number of bytes read or negative otherwise
*
***********************************************************************/
-static int
+static ssize_t
u_read(pi_socket_t *ps, pi_buffer_t *buf, size_t len, int flags)
{
ssize_t rbuf = 0,
--- pilot-link-14338868-origin/libpisync/util.c
+++ pilot-link-14338868/libpisync/util.c
@@ -120,7 +120,7 @@
obl = bytes * 4 + 1;
*ptext = ob = malloc(obl);
- if (iconv(cd, &text, &ibl, &ob, &obl) == (size_t)-1)
+ if (iconv(cd, (char ** restrict)&text, &ibl, &ob, &obl) == (size_t)-1)
return -1;
*ob = '\0';
@@ -211,7 +211,7 @@
obl = bytes * 4 + 1;
*text = ob = malloc(obl);
- if (iconv(cd, &ptext, &ibl, &ob, &obl) == (size_t)-1)
+ if (iconv(cd, (char ** restrict)&ptext, &ibl, &ob, &obl) == (size_t)-1)
return -1;
*ob = '\0';
--- pilot-link-14338868-origin/src/pilot-read-todos.c
+++ pilot-link-14338868/src/pilot-read-todos.c
@@ -217,7 +217,7 @@
}
else {
if (pi_file_read_record
- (pif, i, (void *) &ptr, &len, &attr, &category,
+ (pif, i, (void *) &ptr, (size_t *)&len, &attr, &category,
0))
break;
--- pilot-link-14338868-origin/tests/packers.c
+++ pilot-link-14338868/tests/packers.c
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
+#include "pi-debug.h"
#include "pi-source.h"
#include "pi-socket.h"
#include "pi-memo.h"