emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103878: use ssize_t and size_t for r


From: Jim Meyering
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103878: use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
Date: Sun, 10 Apr 2011 16:00:13 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 103878
committer: Jim Meyering <address@hidden>
branch nick: trunk
timestamp: Sun 2011-04-10 16:00:13 +0200
message:
  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.
modified:
  src/ChangeLog
  src/gnutls.c
  src/gnutls.h
  src/process.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-04-09 20:28:01 +0000
+++ b/src/ChangeLog     2011-04-10 14:00:13 +0000
@@ -1,3 +1,13 @@
+2011-04-10  Jim Meyering  <address@hidden>
+
+       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.
+
 2011-04-09  Chong Yidong  <address@hidden>
 
        * image.c (Fimagemagick_types): Doc fix, and comment cleanup.

=== modified file 'src/gnutls.c'
--- a/src/gnutls.c      2011-01-25 04:08:28 +0000
+++ b/src/gnutls.c      2011-04-10 14:00:13 +0000
@@ -70,11 +70,12 @@
     }
 }
 
-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 @@
   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)

=== modified file 'src/gnutls.h'
--- a/src/gnutls.h      2011-01-25 04:08:28 +0000
+++ b/src/gnutls.h      2011-04-10 14:00:13 +0000
@@ -50,15 +50,15 @@
 
 #define GNUTLS_LOG2(level, max, string, extra) if (level <= max) { 
gnutls_log_function2 (level, "(Emacs) " string, extra); }
 
-int
-emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf,
-                    unsigned int nbyte);
-int
+ssize_t
+emacs_gnutls_write (int fildes, struct Lisp_Process *proc, const char *buf,
+                    size_t nbyte);
+ssize_t
 emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf,
-                   unsigned int nbyte);
+                   size_t nbyte);
 
 extern void syms_of_gnutls (void);
 
-#endif 
+#endif
 
 #endif

=== modified file 'src/process.c'
--- a/src/process.c     2011-04-08 18:53:26 +0000
+++ b/src/process.c     2011-04-10 14:00:13 +0000
@@ -4898,7 +4898,7 @@
 static int
 read_process_output (Lisp_Object proc, register int channel)
 {
-  register int nbytes;
+  register ssize_t nbytes;
   char *chars;
   register Lisp_Object outstream;
   register struct Lisp_Process *p = XPROCESS (proc);
@@ -5243,7 +5243,7 @@
 {
   /* Use volatile to protect variables from being clobbered by longjmp.  */
   struct Lisp_Process *p = XPROCESS (proc);
-  EMACS_INT rv;
+  ssize_t rv;
   struct coding_system *coding;
   struct gcpro gcpro1;
   void (*volatile old_sigpipe) (int);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]