diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-12-03 16:35:52 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-12-03 16:35:52 +0000 |
commit | 145b4dc249adfa4cebd265b9e402dd5f98c4afc3 (patch) | |
tree | 80ce5dbf591007670bbbb03c8e0dee672342c0fe /winsup | |
parent | d2fa946e51347ace19fa1c5a78ebb4fa6e2a2cba (diff) | |
download | newlib-145b4dc249adfa4cebd265b9e402dd5f98c4afc3.zip newlib-145b4dc249adfa4cebd265b9e402dd5f98c4afc3.tar.gz newlib-145b4dc249adfa4cebd265b9e402dd5f98c4afc3.tar.bz2 |
Substitute 0x7fffffff and 0xffffffff by INT32_MAX and UINT32_MAX
throughout, except in assembler code.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/devices.h | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.h | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_floppy.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/mmap.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/net.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/perthread.h | 2 | ||||
-rw-r--r-- | winsup/cygwin/pinfo.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/wincap.cc | 12 |
11 files changed, 21 insertions, 16 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3f329ed..a0adf10 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2003-12-03 Corinna Vinschen <corinna@vinschen.de> + Substitute 0x7fffffff and 0xffffffff by INT32_MAX and UINT32_MAX + throughout, except in assembler code. + +2003-12-03 Corinna Vinschen <corinna@vinschen.de> + * fhandler_disk_file.cc (fhandler_disk_file::lock): Use UINT32_MAX instead of 0xffffffff. Accomodate Win 9x bug in evaluating length of area to lock when given length is 0. diff --git a/winsup/cygwin/devices.h b/winsup/cygwin/devices.h index 137fcd8..c01e230 100644 --- a/winsup/cygwin/devices.h +++ b/winsup/cygwin/devices.h @@ -131,7 +131,7 @@ struct device const char *native; _mode_t mode; bool dev_on_fs; - static const device *lookup (const char *, unsigned int = 0xffffffff); + static const device *lookup (const char *, unsigned int = UINT32_MAX); void parse (const char *); void parse (_major_t major, _minor_t minor); void parse (_dev_t dev); diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 7a3b677..997e807 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -856,7 +856,7 @@ fhandler_base::lseek (_off64_t offset, int whence) DWORD win32_whence = whence == SEEK_SET ? FILE_BEGIN : (whence == SEEK_CUR ? FILE_CURRENT : FILE_END); - LONG off_low = ((__uint64_t) offset) & 0xffffffffLL; + LONG off_low = ((__uint64_t) offset) & UINT32_MAX; LONG *poff_high, off_high; if (!wincap.has_64bit_file_access ()) poff_high = NULL; diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 22b2eb0..a553f75 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -232,7 +232,7 @@ class fhandler_base void set_append_p () { FHSETF (APPEND); } void set_fs_flags (DWORD flags) { fs_flags = flags; } - bool get_fs_flags (DWORD flagval = 0xffffffffUL) + bool get_fs_flags (DWORD flagval = UINT32_MAX) { return (fs_flags & (flagval)); } bool get_query_open () { return FHISSETF (QUERYOPEN); } diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index 1b8cccf..e849a53 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -172,7 +172,7 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence) return ret; devbufstart = devbufend = 0; - low = sector_aligned_offset & 0xffffffff; + low = sector_aligned_offset & UINT32_MAX; high = sector_aligned_offset >> 32; if (SetFilePointer (get_handle (), low, &high, FILE_BEGIN) == INVALID_SET_FILE_POINTER && GetLastError ()) diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index a553345..035b99f 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -920,7 +920,7 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access, return INVALID_HANDLE_VALUE; } - DWORD high = off >> 32, low = off & 0xffffffff; + DWORD high = off >> 32, low = off & UINT32_MAX; void *base = NULL; /* If a non-zero address is given, try mapping using the given address first. If it fails and flags is not MAP_FIXED, try again with NULL address. */ diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index f93c9ef..ac62fec 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -506,9 +506,9 @@ dup_ent (void *old, void *src0, struct_type type) { /* Windows 95 idiocy. Structure is misaligned on Windows 95. Kludge around this by trying a different pointer alignment. */ - if (!IsBadStringPtr (src->s_proto, 0x7fffffff)) + if (!IsBadStringPtr (src->s_proto, INT32_MAX)) s_proto = src->s_proto; - else if (!IsBadStringPtr (((pservent *) src)->s_proto, 0x7fffffff)) + else if (!IsBadStringPtr (((pservent *) src)->s_proto, INT32_MAX)) s_proto = ((pservent *) src)->s_proto; sz += (protolen = strlen_round (s_proto)); } diff --git a/winsup/cygwin/perthread.h b/winsup/cygwin/perthread.h index 0c3b49b..a7095dc 100644 --- a/winsup/cygwin/perthread.h +++ b/winsup/cygwin/perthread.h @@ -15,7 +15,7 @@ details. */ struct _reent; extern struct _reent reent_data; -#define PER_THREAD_FORK_CLEAR ((void *)0xffffffff) +#define PER_THREAD_FORK_CLEAR ((void *)UINT32_MAX) class per_thread { DWORD tls; diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 1bd9bd4..a0419c8 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -317,7 +317,7 @@ _pinfo::commune_recv () const char *argv[__argc_safe + 1]; for (int i = 0; i < __argc_safe; i++) { - if (IsBadStringPtr (__argv[i], 0x7fffffff)) + if (IsBadStringPtr (__argv[i], INT32_MAX)) argv[i] = ""; else argv[i] = __argv[i]; diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 71c325e..6a09340 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -808,7 +808,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw) BOOL special_pgrp = FALSE; char sa_buf[1024]; LUID auth_luid = SYSTEM_LUID; - LARGE_INTEGER exp = { QuadPart:0x7fffffffffffffffLL }; + LARGE_INTEGER exp = { QuadPart:INT64_MAX }; TOKEN_USER user; PTOKEN_GROUPS new_tok_gsids = NULL; diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index a56f0a1..379b634 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -270,7 +270,7 @@ static NO_COPY wincaps wincap_me = { }; static NO_COPY wincaps wincap_nt3 = { - lock_file_highword:0xffffffff, + lock_file_highword:UINT32_MAX, chunksize:0, shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, is_winnt:true, @@ -313,7 +313,7 @@ static NO_COPY wincaps wincap_nt3 = { }; static NO_COPY wincaps wincap_nt4 = { - lock_file_highword:0xffffffff, + lock_file_highword:UINT32_MAX, chunksize:0, shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, is_winnt:true, @@ -356,7 +356,7 @@ static NO_COPY wincaps wincap_nt4 = { }; static NO_COPY wincaps wincap_nt4sp4 = { - lock_file_highword:0xffffffff, + lock_file_highword:UINT32_MAX, chunksize:0, shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, is_winnt:true, @@ -399,7 +399,7 @@ static NO_COPY wincaps wincap_nt4sp4 = { }; static NO_COPY wincaps wincap_2000 = { - lock_file_highword:0xffffffff, + lock_file_highword:UINT32_MAX, chunksize:0, shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, is_winnt:true, @@ -442,7 +442,7 @@ static NO_COPY wincaps wincap_2000 = { }; static NO_COPY wincaps wincap_xp = { - lock_file_highword:0xffffffff, + lock_file_highword:UINT32_MAX, chunksize:0, shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, is_winnt:true, @@ -485,7 +485,7 @@ static NO_COPY wincaps wincap_xp = { }; static NO_COPY wincaps wincap_2003 = { - lock_file_highword:0xffffffff, + lock_file_highword:UINT32_MAX, chunksize:0, shared:FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, is_winnt:true, |