Commit 223752d7 authored by Paul Eggert's avatar Paul Eggert
Browse files

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.
parent 3c439e0a
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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment