diff options
| author | NIIBE Yutaka <[email protected]> | 2026-05-14 04:49:20 +0200 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2026-05-14 04:49:20 +0200 |
| commit | 11eaae97fa79bfcbced89a8fbf76092eb35dfa4f (patch) | |
| tree | 427091668e6d9a53b1b3212ce275e316db8e53c5 | |
| parent | Make GPGME_DECRYPT_SESSION_HASH also work for gnupg 2.2.55 (diff) | |
| download | gpgme-11eaae97fa79bfcbced89a8fbf76092eb35dfa4f.tar.gz gpgme-11eaae97fa79bfcbced89a8fbf76092eb35dfa4f.zip | |
w32: Add cast for assuan_fd_t.
* src/assuan-support.c (my_pipe, my_close, my_read, my_write, my_spawn)
(my_socketpair, my_connect): Cast assuan_fd_t between int.
* src/engine-assuan.c (start): Likewise.
* src/engine-g13.c (start): Likewise.
* src/engine-gpgsm.c (gpgsm_new, prepare): Likewise.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
| -rw-r--r-- | src/assuan-support.c | 22 | ||||
| -rw-r--r-- | src/engine-assuan.c | 2 | ||||
| -rw-r--r-- | src/engine-g13.c | 2 | ||||
| -rw-r--r-- | src/engine-gpgsm.c | 6 |
4 files changed, 17 insertions, 15 deletions
diff --git a/src/assuan-support.c b/src/assuan-support.c index 86e9b562..a0f60287 100644 --- a/src/assuan-support.c +++ b/src/assuan-support.c @@ -110,8 +110,8 @@ my_pipe (assuan_context_t ctx, assuan_fd_t fds[2], int inherit_idx) res = _gpgme_io_pipe (gfds, inherit_idx); /* For now... */ - fds[0] = (assuan_fd_t) gfds[0]; - fds[1] = (assuan_fd_t) gfds[1]; + fds[0] = (assuan_fd_t)(intptr_t) gfds[0]; + fds[1] = (assuan_fd_t)(intptr_t) gfds[1]; return res; } @@ -123,7 +123,7 @@ static int my_close (assuan_context_t ctx, assuan_fd_t fd) { (void)ctx; - return _gpgme_io_close ((int) fd); + return _gpgme_io_close ((int)(intptr_t) fd); } @@ -131,7 +131,7 @@ static ssize_t my_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size) { (void)ctx; - return _gpgme_io_read ((int) fd, buffer, size); + return _gpgme_io_read ((int)(intptr_t) fd, buffer, size); } @@ -139,7 +139,7 @@ static ssize_t my_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer, size_t size) { (void)ctx; - return _gpgme_io_write ((int) fd, buffer, size); + return _gpgme_io_write ((int)(intptr_t) fd, buffer, size); } @@ -220,20 +220,20 @@ my_spawn (assuan_context_t ctx, assuan_pid_t *r_pid, const char *name, { while (fd_child_list[i] != ASSUAN_INVALID_FD) { - fd_items[i].fd = (int) fd_child_list[i]; + fd_items[i].fd = (int)(intptr_t) fd_child_list[i]; fd_items[i].dup_to = -1; i++; } } if (fd_in != ASSUAN_INVALID_FD) { - fd_items[i].fd = (int) fd_in; + fd_items[i].fd = (int)(intptr_t) fd_in; fd_items[i].dup_to = 0; i++; } if (fd_out != ASSUAN_INVALID_FD) { - fd_items[i].fd = (int) fd_out; + fd_items[i].fd = (int)(intptr_t) fd_out; fd_items[i].dup_to = 1; i++; } @@ -361,8 +361,10 @@ my_socketpair (assuan_context_t ctx, int namespace, int style, static assuan_fd_t my_socket (assuan_context_t ctx, int namespace, int style, int protocol) { + int r = _gpgme_io_socket (namespace, style, protocol); + (void)ctx; - return (assuan_fd_t)_gpgme_io_socket (namespace, style, protocol); + return (assuan_fd_t)(intptr_t)r; } @@ -371,7 +373,7 @@ my_connect (assuan_context_t ctx, assuan_fd_t sock, struct sockaddr *addr, socklen_t length) { (void)ctx; - return _gpgme_io_connect ((int)sock, addr, length); + return _gpgme_io_connect ((int)(intptr_t)sock, addr, length); } #else static int diff --git a/src/engine-assuan.c b/src/engine-assuan.c index 654d41c8..599a967b 100644 --- a/src/engine-assuan.c +++ b/src/engine-assuan.c @@ -716,7 +716,7 @@ start (engine_llass_t llass, const char *command) return gpg_error (GPG_ERR_GENERAL); /* FIXME */ /* For now... */ for (i = 0; i < nfds; i++) - fdlist[i] = (int) afdlist[i]; + fdlist[i] = (int)(intptr_t) afdlist[i]; /* We "duplicate" the file descriptor, so we can close it here (we can't close fdlist[0], as that is closed by libassuan, and diff --git a/src/engine-g13.c b/src/engine-g13.c index c37800e6..5196d64d 100644 --- a/src/engine-g13.c +++ b/src/engine-g13.c @@ -672,7 +672,7 @@ start (engine_g13_t g13, const char *command) return gpg_error (GPG_ERR_GENERAL); /* FIXME */ /* For now... */ for (i = 0; i < nfds; i++) - fdlist[i] = (int) afdlist[i]; + fdlist[i] = (int)(intptr_t)afdlist[i]; /* We "duplicate" the file descriptor, so we can close it here (we can't close fdlist[0], as that is closed by libassuan, and diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index 302c1a8e..94edab6b 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -435,14 +435,14 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir, /* For now... */ for (i = 0; i < nchild_fds; i++) - achild_fds[i] = (assuan_fd_t) child_fds[i]; + achild_fds[i] = (assuan_fd_t)(intptr_t) child_fds[i]; err = assuan_pipe_connect (gpgsm->assuan_ctx, pgmname, argv, achild_fds, NULL, NULL, connect_flags); /* FIXME: Check whether our Windows code still updates the list.*/ for (i = 0; i < nchild_fds; i++) - child_fds[i] = (int) achild_fds[i]; + child_fds[i] = (int)(intptr_t) achild_fds[i]; } @@ -1251,7 +1251,7 @@ prepare (engine_gpgsm_t gpgsm) return gpg_error (GPG_ERR_GENERAL); /* FIXME */ /* For now... */ for (i = 0; i < nfds; i++) - fdlist[i] = (int) afdlist[i]; + fdlist[i] = (int)(intptr_t) afdlist[i]; /* We "duplicate" the file descriptor, so we can close it here (we can't close fdlist[0], as that is closed by libassuan, and |
