diff options
author | Christopher Faylor <me@cgf.cx> | 2003-09-07 06:22:58 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-09-07 06:22:58 +0400 |
commit | 6cce721b15c6ac75e7d6ae86a4354aa02bcf14d8 (patch) | |
tree | a7538e4b61839375dabaee0d9647d30befe04ac6 | |
parent | 46645f9c6efc9009d7bada23d7ae5f03e6ed8bd3 (diff) |
Remove left coercion throughout.
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_mem.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_random.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_virtual.cc | 8 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_windows.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/pipe.cc | 2 |
8 files changed, 19 insertions, 15 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7caf4a697..b8eb9245b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2003-09-06 Christopher Faylor <cgf@redhat.com> + + Remove left coercion throughout. + 2003-09-04 Pierre Humblet <pierre.humblet@ieee.org> * hires.h (hires_ms::~hires_ms): Delete declaration. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 453eda4ae..1310a5ca0 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -258,7 +258,7 @@ fhandler_base::set_flags (int flags, int supplied_bin) void fhandler_base::raw_read (void *ptr, size_t& ulen) { -#define bytes_read ((ssize_t) ulen) +#define bytes_read ulen HANDLE h = NULL; /* grumble */ int prio = 0; /* ditto */ @@ -304,13 +304,13 @@ fhandler_base::raw_read (void *ptr, size_t& ulen) if (openflags & O_DIROPEN) { set_errno (EISDIR); - bytes_read = -1; + bytes_read = (size_t) -1; break; } default: syscall_printf ("ReadFile %s failed, %E", unix_path_name); __seterrno_from_win_error (errcode); - bytes_read = -1; + bytes_read = (size_t) -1; break; } } diff --git a/winsup/cygwin/fhandler_mem.cc b/winsup/cygwin/fhandler_mem.cc index c57ff491d..8cbbf0666 100644 --- a/winsup/cygwin/fhandler_mem.cc +++ b/winsup/cygwin/fhandler_mem.cc @@ -187,7 +187,7 @@ fhandler_dev_mem::read (void *ptr, size_t& ulen) if (!(get_access () & GENERIC_READ)) { set_errno (EINVAL); - (ssize_t) ulen = -1; + ulen = (size_t) -1; return; } @@ -212,7 +212,7 @@ fhandler_dev_mem::read (void *ptr, size_t& ulen) PAGE_READONLY)) != STATUS_SUCCESS) { __seterrno_from_win_error (RtlNtStatusToDosError (ret)); - (ssize_t) ulen = -1; + ulen = (size_t) -1; return; } @@ -221,7 +221,7 @@ fhandler_dev_mem::read (void *ptr, size_t& ulen) if (!NT_SUCCESS (ret = NtUnmapViewOfSection (INVALID_HANDLE_VALUE, viewmem))) { __seterrno_from_win_error (RtlNtStatusToDosError (ret)); - (ssize_t) ulen = -1; + ulen = (size_t) -1; return; } diff --git a/winsup/cygwin/fhandler_random.cc b/winsup/cygwin/fhandler_random.cc index e7c694f5a..19fa5e1e3 100644 --- a/winsup/cygwin/fhandler_random.cc +++ b/winsup/cygwin/fhandler_random.cc @@ -118,7 +118,7 @@ fhandler_dev_random::read (void *ptr, size_t& len) if (!ptr) { set_errno (EINVAL); - (ssize_t) len = -1; + len = (size_t) -1; return; } @@ -135,7 +135,7 @@ fhandler_dev_random::read (void *ptr, size_t& len) } __seterrno (); - (ssize_t) len = -1; + len = (size_t) -1; } _off64_t diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index a3694ae9d..c273a68e0 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -737,7 +737,7 @@ fhandler_tty_slave::read (void *ptr, size_t& len) if (totalread > 0) break; set_sig_errno (EINTR); - (ssize_t) len = -1; + len = (size_t) -1; return; } diff --git a/winsup/cygwin/fhandler_virtual.cc b/winsup/cygwin/fhandler_virtual.cc index b5ecb54a5..2c149566d 100644 --- a/winsup/cygwin/fhandler_virtual.cc +++ b/winsup/cygwin/fhandler_virtual.cc @@ -179,18 +179,18 @@ fhandler_virtual::read (void *ptr, size_t& len) if (openflags & O_DIROPEN) { set_errno (EISDIR); - (ssize_t) len = -1; + len = (size_t) -1; return; } if (!filebuf) { - (ssize_t) len = 0; + len = (size_t) 0; return; } if ((ssize_t) len > filesize - position) - (ssize_t) len = filesize - position; + len = (size_t) (filesize - position); if ((ssize_t) len < 0) - (ssize_t) len = 0; + len = 0; else memcpy (ptr, filebuf + position, len); position += len; diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc index b9892882f..f200f482a 100644 --- a/winsup/cygwin/fhandler_windows.cc +++ b/winsup/cygwin/fhandler_windows.cc @@ -86,7 +86,7 @@ fhandler_windows::read (void *buf, size_t& len) if (len < sizeof (MSG)) { set_errno (EINVAL); - (ssize_t) len = -1; + len = (size_t) -1; return; } diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 45bb984a9..b1e100974 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -76,7 +76,7 @@ fhandler_pipe::read (void *in_ptr, size_t& in_len) ResetEvent (read_state); cygthread *th = new cygthread (read_pipe, &pi, "read_pipe"); if (th->detach (read_state) && !in_len) - (ssize_t) in_len = -1; /* received a signal */ + in_len = (size_t) -1; /* received a signal */ } (void) ReleaseMutex (guard); return; |