]> git.eshelyaron.com Git - emacs.git/commitdiff
emacs_read and emacs_write now use void *, not char *.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Oct 2013 08:05:00 +0000 (01:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Oct 2013 08:05:00 +0000 (01:05 -0700)
* alloc.c (valid_pointer_p) [!WINDOWSNT]: Remove now-unnecessary cast.
* sysdep.c (emacs_read, emacs_write, emacs_write_sig):
Buffer arg is now void *, not char *.  This matches plain
'read' and 'write' better, and avoids a constraint violation
on Solaris 9 with Oracle Studio.

src/ChangeLog
src/alloc.c
src/lisp.h
src/sysdep.c

index 4be64c13993c7734f971208bc92266f78027ef3d..7483748919d94922b28172fd4841fcb477af84c0 100644 (file)
@@ -1,3 +1,12 @@
+2013-10-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       emacs_read and emacs_write now use void *, not char *.
+       * alloc.c (valid_pointer_p) [!WINDOWSNT]: Remove now-unnecessary cast.
+       * sysdep.c (emacs_read, emacs_write, emacs_write_sig):
+       Buffer arg is now void *, not char *.  This matches plain
+       'read' and 'write' better, and avoids a constraint violation
+       on Solaris 9 with Oracle Studio.
+
 2013-10-07  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * alloc.c (Fmake_string): For ASCII char initializer, prefer
index 56a9763db153b3f9878f99383edbd7804d91e143..0e6a01944ab01e910efa3562753d8e9c46aacdb8 100644 (file)
@@ -4824,7 +4824,7 @@ valid_pointer_p (void *p)
 
   if (emacs_pipe (fd) == 0)
     {
-      bool valid = emacs_write (fd[1], (char *) p, 16) == 16;
+      bool valid = emacs_write (fd[1], p, 16) == 16;
       emacs_close (fd[1]);
       emacs_close (fd[0]);
       return valid;
index 2f0279ef542d58b22b1ebdf3785009054565a33e..c7f13e21e55b8de36916319e05f03bc4976143d3 100644 (file)
@@ -4085,9 +4085,9 @@ extern _Noreturn void emacs_abort (void) NO_INLINE;
 extern int emacs_open (const char *, int, int);
 extern int emacs_pipe (int[2]);
 extern int emacs_close (int);
-extern ptrdiff_t emacs_read (int, char *, ptrdiff_t);
-extern ptrdiff_t emacs_write (int, const char *, ptrdiff_t);
-extern ptrdiff_t emacs_write_sig (int, char const *, ptrdiff_t);
+extern ptrdiff_t emacs_read (int, void *, ptrdiff_t);
+extern ptrdiff_t emacs_write (int, void const *, ptrdiff_t);
+extern ptrdiff_t emacs_write_sig (int, void const *, ptrdiff_t);
 extern void emacs_perror (char const *);
 
 extern void unlock_all_files (void);
index 848598132496b86195ef3b348e2a48d3a19faaf4..f78a8fbb2efb6c4ac109581d2576d91df72a40a2 100644 (file)
@@ -2257,9 +2257,9 @@ emacs_close (int fd)
    Return the number of bytes read, which might be less than NBYTE.
    On error, set errno and return -1.  */
 ptrdiff_t
-emacs_read (int fildes, char *buf, ptrdiff_t nbyte)
+emacs_read (int fildes, void *buf, ptrdiff_t nbyte)
 {
-  register ssize_t rtnval;
+  ssize_t rtnval;
 
   /* There is no need to check against MAX_RW_COUNT, since no caller ever
      passes a size that large to emacs_read.  */
@@ -2310,14 +2310,14 @@ emacs_full_write (int fildes, char const *buf, ptrdiff_t nbyte,
    interrupted or if a partial write occurs.  Return the number of
    bytes written, setting errno if this is less than NBYTE.  */
 ptrdiff_t
-emacs_write (int fildes, char const *buf, ptrdiff_t nbyte)
+emacs_write (int fildes, void const *buf, ptrdiff_t nbyte)
 {
   return emacs_full_write (fildes, buf, nbyte, 0);
 }
 
 /* Like emacs_write, but also process pending signals if interrupted.  */
 ptrdiff_t
-emacs_write_sig (int fildes, char const *buf, ptrdiff_t nbyte)
+emacs_write_sig (int fildes, void const *buf, ptrdiff_t nbyte)
 {
   return emacs_full_write (fildes, buf, nbyte, 1);
 }