summaryrefslogtreecommitdiff
path: root/src/gnutls.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-04-10 16:00:13 +0200
committerJim Meyering <meyering@redhat.com>2011-04-10 16:00:13 +0200
commit368f40905f551ebaead782b3bb23140661600ae0 (patch)
tree5e03cbb2800c27c16edbd881af8fd02cea707d44 /src/gnutls.c
parenta32d40405d31edd2ce4349b95277306554fb54a4 (diff)
downloademacs-368f40905f551ebaead782b3bb23140661600ae0.tar.gz
use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
* gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like: return ssize_t not "int", and use size_t as the buffer length. (emacs_gnutls_write): Likewise, and make the buffer pointer "const". * gnutls.h: Update declarations. * process.c (read_process_output): Use ssize_t, to match. (send_process): Likewise.
Diffstat (limited to 'src/gnutls.c')
-rw-r--r--src/gnutls.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gnutls.c b/src/gnutls.c
index 3a461891e2e..d9e4dcec15a 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -70,11 +70,12 @@ emacs_gnutls_handshake (struct Lisp_Process *proc)
}
}
-int
-emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf,
- unsigned int nbyte)
+ssize_t
+emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf,
+ size_t nbyte)
{
- register int rtnval, bytes_written;
+ ssize_t rtnval;
+ size_t bytes_written;
gnutls_session_t state = proc->gnutls_state;
if (proc->gnutls_initstage != GNUTLS_STAGE_READY) {
@@ -109,11 +110,11 @@ emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf,
return (bytes_written);
}
-int
+ssize_t
emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf,
- unsigned int nbyte)
+ size_t nbyte)
{
- register int rtnval;
+ ssize_t rtnval;
gnutls_session_t state = proc->gnutls_state;
if (proc->gnutls_initstage != GNUTLS_STAGE_READY)