Index: winsup/cygwin/fhandler.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler.h,v retrieving revision 1.377 diff -p -u -r1.377 fhandler.h --- winsup/cygwin/fhandler.h 4 Aug 2009 04:31:08 -0000 1.377 +++ winsup/cygwin/fhandler.h 10 Aug 2009 02:31:53 -0000 @@ -289,6 +289,18 @@ class fhandler_base DWORD nNumberOfLinks, DWORD dwFileAttributes) __attribute__ ((regparm (3))); + int __stdcall fstat_helper (struct __stat64 *buf, + LARGE_INTEGER ftChangeTime, + LARGE_INTEGER ftLastAccessTime, + LARGE_INTEGER ftLastWriteTime, + LARGE_INTEGER ftCreationTime, + DWORD dwVolumeSerialNumber, + ULONGLONG nFileSize, + LONGLONG nAllocSize, + ULONGLONG nFileIndex, + DWORD nNumberOfLinks, + DWORD dwFileAttributes) + __attribute__ ((regparm (3))); int __stdcall fstat_by_nfs_ea (struct __stat64 *buf) __attribute__ ((regparm (2))); int __stdcall fstat_by_handle (struct __stat64 *buf) __attribute__ ((regparm (2))); int __stdcall fstat_by_name (struct __stat64 *buf) __attribute__ ((regparm (2))); Index: winsup/cygwin/fhandler_disk_file.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler_disk_file.cc,v retrieving revision 1.304 diff -p -u -r1.304 fhandler_disk_file.cc --- winsup/cygwin/fhandler_disk_file.cc 4 Aug 2009 04:20:36 -0000 1.304 +++ winsup/cygwin/fhandler_disk_file.cc 10 Aug 2009 02:31:54 -0000 @@ -368,11 +368,11 @@ fhandler_base::fstat_by_handle (struct _ pc.file_attributes (fbi.FileAttributes); return fstat_helper (buf, fbi.ChangeTime.QuadPart - ? *(FILETIME *) (void *) &fbi.ChangeTime - : *(FILETIME *) (void *) &fbi.LastWriteTime, - *(FILETIME *) (void *) &fbi.LastAccessTime, - *(FILETIME *) (void *) &fbi.LastWriteTime, - *(FILETIME *) (void *) &fbi.CreationTime, + ? fbi.ChangeTime + : fbi.LastWriteTime, + fbi.LastAccessTime, + fbi.LastWriteTime, + fbi.CreationTime, get_dev (), fsi.EndOfFile.QuadPart, fsi.AllocationSize.QuadPart, @@ -436,11 +436,11 @@ fhandler_base::fstat_by_name (struct __s pc.file_attributes (fdi_buf.fdi.FileAttributes); return fstat_helper (buf, fdi_buf.fdi.ChangeTime.QuadPart ? - *(FILETIME *) (void *) &fdi_buf.fdi.ChangeTime : - *(FILETIME *) (void *) &fdi_buf.fdi.LastWriteTime, - *(FILETIME *) (void *) &fdi_buf.fdi.LastAccessTime, - *(FILETIME *) (void *) &fdi_buf.fdi.LastWriteTime, - *(FILETIME *) (void *) &fdi_buf.fdi.CreationTime, + fdi_buf.fdi.ChangeTime : + fdi_buf.fdi.LastWriteTime, + fdi_buf.fdi.LastAccessTime, + fdi_buf.fdi.LastWriteTime, + fdi_buf.fdi.CreationTime, pc.fs_serial_number (), fdi_buf.fdi.EndOfFile.QuadPart, fdi_buf.fdi.AllocationSize.QuadPart, @@ -453,10 +453,10 @@ too_bad: /* Arbitrary value: 2006-12-01 */ RtlSecondsSince1970ToTime (1164931200L, &ft); return fstat_helper (buf, - *(FILETIME *) (void *) &ft, - *(FILETIME *) (void *) &ft, - *(FILETIME *) (void *) &ft, - *(FILETIME *) (void *) &ft, + ft, + ft, + ft, + ft, 0, 0ULL, -1LL, @@ -680,6 +680,28 @@ fhandler_base::fstat_helper (struct __st } int __stdcall +fhandler_base::fstat_helper (struct __stat64 *buf, + LARGE_INTEGER ftChangeTime, + LARGE_INTEGER ftLastAccessTime, + LARGE_INTEGER ftLastWriteTime, + LARGE_INTEGER ftCreationTime, + DWORD dwVolumeSerialNumber, + ULONGLONG nFileSize, + LONGLONG nAllocSize, + ULONGLONG nFileIndex, + DWORD nNumberOfLinks, + DWORD dwFileAttributes) +{ + return fstat_helper (buf, + ((FILETIME) {ftChangeTime.u.LowPart, ftChangeTime.u.HighPart}), + ((FILETIME) {ftLastAccessTime.u.LowPart, ftLastAccessTime.u.HighPart}), + ((FILETIME) {ftLastWriteTime.u.LowPart, ftLastWriteTime.u.HighPart}), + ((FILETIME) {ftCreationTime.u.LowPart, ftCreationTime.u.HighPart}), + dwVolumeSerialNumber, nFileSize, nAllocSize, + nFileIndex, nNumberOfLinks, dwFileAttributes); +} + +int __stdcall fhandler_disk_file::fstat (struct __stat64 *buf) { return fstat_fs (buf); Index: winsup/cygwin/fhandler_floppy.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler_floppy.cc,v retrieving revision 1.55 diff -p -u -r1.55 fhandler_floppy.cc --- winsup/cygwin/fhandler_floppy.cc 24 Jul 2009 20:54:33 -0000 1.55 +++ winsup/cygwin/fhandler_floppy.cc 10 Aug 2009 02:31:54 -0000 @@ -56,7 +56,8 @@ fhandler_dev_floppy::get_drive_info (str __seterrno (); else { - di = &((DISK_GEOMETRY_EX *) dbuf)->Geometry; + DISK_GEOMETRY_EX *dgx = (DISK_GEOMETRY_EX *) dbuf; + di = &dgx->Geometry; if (!DeviceIoControl (get_handle (), IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, pbuf, 256, &bytes_read, NULL)) Index: winsup/cygwin/fhandler_proc.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler_proc.cc,v retrieving revision 1.87 diff -p -u -r1.87 fhandler_proc.cc --- winsup/cygwin/fhandler_proc.cc 9 Jun 2009 09:45:29 -0000 1.87 +++ winsup/cygwin/fhandler_proc.cc 10 Aug 2009 02:31:54 -0000 @@ -637,7 +637,9 @@ format_proc_cpuinfo (void *, char *&dest read_value ("Identifier", REG_SZ); bufptr += __small_sprintf (bufptr, "identifier : %s\n", szBuffer); read_value ("~Mhz", REG_DWORD); - bufptr += __small_sprintf (bufptr, "cpu MHz : %u\n", *(DWORD *) szBuffer); + union { char szbuff[sizeof (DWORD)]; DWORD dw; } u; + memcpy (u.szbuff, szBuffer, sizeof (DWORD)); + bufptr += __small_sprintf (bufptr, "cpu MHz : %u\n", u.dw); print ("flags :"); if (IsProcessorFeaturePresent (PF_3DNOW_INSTRUCTIONS_AVAILABLE)) @@ -675,7 +677,9 @@ format_proc_cpuinfo (void *, char *&dest bufptr += __small_sprintf (bufptr, "vendor_id\t: %s\n", (char *)vendor_id); read_value ("~Mhz", REG_DWORD); - unsigned cpu_mhz = *(DWORD *)szBuffer; + union { char szbuff[sizeof (DWORD)]; DWORD dw; } u; + memcpy (u.szbuff, szBuffer, sizeof (DWORD)); + unsigned cpu_mhz = u.dw; if (maxf >= 1) { unsigned features2, features1, extra_info, cpuid_sig; Index: winsup/cygwin/fhandler_tty.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler_tty.cc,v retrieving revision 1.190 diff -p -u -r1.190 fhandler_tty.cc --- winsup/cygwin/fhandler_tty.cc 24 Jul 2009 20:54:33 -0000 1.190 +++ winsup/cygwin/fhandler_tty.cc 10 Aug 2009 02:31:54 -0000 @@ -225,6 +225,7 @@ process_input (void *) == line_edit_signalled) tty_master->console->eat_readahead (-1); } + return 0; } bool @@ -438,6 +439,7 @@ process_ioctl (void *) : (void *) &ttyp->arg); SetEvent (tty_master->ioctl_done_event); } + return 0; } /**********************************************************************/ Index: winsup/cygwin/fork.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fork.cc,v retrieving revision 1.207 diff -p -u -r1.207 fork.cc --- winsup/cygwin/fork.cc 24 Jul 2009 20:54:33 -0000 1.207 +++ winsup/cygwin/fork.cc 10 Aug 2009 02:31:54 -0000 @@ -32,6 +32,8 @@ details. */ /* FIXME: Once things stabilize, bump up to a few minutes. */ #define FORK_WAIT_TIMEOUT (300 * 1000) /* 300 seconds */ +static int cygfork(void); + class frok { bool load_dlls; @@ -41,7 +43,7 @@ class frok int this_errno; int __stdcall parent (volatile char * volatile here); int __stdcall child (volatile char * volatile here); - friend int fork (); + friend int cygfork (void); }; class lock_signals @@ -557,8 +559,8 @@ cleanup: return -1; } -extern "C" int -fork () +static int +cygfork (void) { frok grouped; @@ -629,6 +631,13 @@ fork () syscall_printf ("%d = fork()", res); return res; } + +extern "C" int +fork () +{ + return cygfork (); +} + #ifdef DEBUGGING void fork_init () cvs diff: winsup/cygwin/how-cxx-abi.txt is a new entry, no comparison available Index: winsup/cygwin/passwd.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/passwd.cc,v retrieving revision 1.84 diff -p -u -r1.84 passwd.cc --- winsup/cygwin/passwd.cc 26 Jan 2009 13:20:46 -0000 1.84 +++ winsup/cygwin/passwd.cc 10 Aug 2009 02:31:54 -0000 @@ -98,11 +98,14 @@ internal_getpwsid (cygpsid &sid) { endptr = strchr (sid_string + 2, 0) - 1; for (int i = 0; i < pr.curr_lines; i++) - if ((pw = passwd_buf + i)->pw_dir > pw->pw_gecos + 8) - for (ptr1 = endptr, ptr2 = pw->pw_dir - 2; - *ptr1 == *ptr2; ptr2--) + { + pw = passwd_buf + i; + if (pw->pw_dir > pw->pw_gecos + 8) + for (ptr1 = endptr, ptr2 = pw->pw_dir - 2; + *ptr1 == *ptr2; ptr2--) if (!*--ptr1) return pw; + } } return NULL; } Index: winsup/cygwin/syscalls.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/syscalls.cc,v retrieving revision 1.527 diff -p -u -r1.527 syscalls.cc --- winsup/cygwin/syscalls.cc 24 Jul 2009 20:54:33 -0000 1.527 +++ winsup/cygwin/syscalls.cc 10 Aug 2009 02:31:54 -0000 @@ -3479,8 +3479,12 @@ long gethostid (void) status = UuidCreate (&Uuid); if (status == RPC_S_OK) { - data[4] = *(unsigned *)&Uuid.Data4[2]; - data[5] = *(unsigned short *)&Uuid.Data4[6]; + unsigned d4; + unsigned short d5; + memcpy (&d4, &Uuid.Data4[2], sizeof (unsigned)); + memcpy (&d5, &Uuid.Data4[6], sizeof (unsigned short)); + data[4] = d4; + data[5] = d5; // Unfortunately Windows will sometimes pick a virtual Ethernet card // e.g. VMWare Virtual Ethernet Adaptor debug_printf ("MAC address of first Ethernet card: %02x:%02x:%02x:%02x:%02x:%02x", Index: winsup/cygwin/include/cygwin/in6.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/in6.h,v retrieving revision 1.6 diff -p -u -r1.6 in6.h --- winsup/cygwin/include/cygwin/in6.h 18 Jan 2007 10:25:40 -0000 1.6 +++ winsup/cygwin/include/cygwin/in6.h 10 Aug 2009 02:31:54 -0000 @@ -16,10 +16,7 @@ details. */ #define INET6_ADDRSTRLEN 46 #define IN6_ARE_ADDR_EQUAL(a, b) \ - (((const uint32_t *)(a))[0] == ((const uint32_t *)(b))[0] \ - && ((const uint32_t *)(a))[1] == ((const uint32_t *)(b))[1] \ - && ((const uint32_t *)(a))[2] == ((const uint32_t *)(b))[2] \ - && ((const uint32_t *)(a))[3] == ((const uint32_t *)(b))[3]) + (!memcmp ((a), (b), 4 * sizeof (uint32_t))) #define IN6_IS_ADDR_UNSPECIFIED(addr) \ (((const uint32_t *)(addr))[0] == 0 \