diff options
author | Christopher Faylor <me@cgf.cx> | 2002-07-06 01:58:49 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-07-06 01:58:49 +0400 |
commit | 91a2f87b9d9be3aa4eadebb9d6761d0923d1f30f (patch) | |
tree | 4de0142298b4c3ee0c13ac57be328938b6043d91 /winsup | |
parent | d5591d9df67a1425a8c05f22cbde430c4a93627f (diff) |
* ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment.
(_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/ntdll.h | 4 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 70 |
3 files changed, 43 insertions, 36 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 849e5a623..cdcedffbc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2002-07-05 Christopher Faylor <cgf@redhat.com> + + * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment. + (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto. + 2002-07-05 Corinna Vinschen <corinna@vinschen.de> * fhandler.h (UNCONNECTED): New define. diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index f10d27dcf..00a0ac717 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@ -50,7 +50,7 @@ typedef struct _SYSTEM_BASIC_INFORMATION UCHAR NumberProcessors; } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION; -typedef struct _SYSTEM_PROCESSOR_TIMES +typedef struct __attribute__ ((aligned (8))) _SYSTEM_PROCESSOR_TIMES { LARGE_INTEGER IdleTime; LARGE_INTEGER KernelTime; @@ -244,7 +244,7 @@ typedef struct _SYSTEM_PERFORMANCE_INFORMATION ULONG SystemCalls; } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION; -typedef struct _SYSTEM_TIME_OF_DAY_INFORMATION +typedef struct __attribute__ ((aligned(8))) _SYSTEM_TIME_OF_DAY_INFORMATION { LARGE_INTEGER BootTime; LARGE_INTEGER CurrentTime; diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index ed76f941e..c09b4591f 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2822,8 +2822,43 @@ suffix_scan::has (const char *in_path, const suffix_info *in_suffixes) int suffix_scan::next () { - if (suffixes) + for (;;) { + if (!suffixes) + switch (nextstate) + { + case SCAN_BEG: + suffixes = suffixes_start; + if (!suffixes) + { + nextstate = SCAN_LNK; + return 1; + } + if (!*suffixes->name) + suffixes++; + nextstate = SCAN_EXTRALNK; + /* fall through to suffix checking below */ + break; + case SCAN_HASLNK: + nextstate = SCAN_EXTRALNK; /* Skip SCAN_BEG */ + return 1; + case SCAN_LNK: + case SCAN_EXTRALNK: + strcpy (eopath, ".lnk"); + nextstate = SCAN_DONE; + return 1; + case SCAN_JUSTCHECK: + nextstate = SCAN_APPENDLNK; + return 1; + case SCAN_APPENDLNK: + strcat (eopath, ".lnk"); + nextstate = SCAN_DONE; + return 1; + default: + *eopath = '\0'; + return 0; + } + while (suffixes && suffixes->name) if (!suffixes->addon) suffixes++; @@ -2837,39 +2872,6 @@ suffix_scan::next () } suffixes = NULL; } - - switch (nextstate) - { - case SCAN_BEG: - suffixes = suffixes_start; - if (!suffixes) - nextstate = SCAN_LNK; - else - { - if (!*suffixes->name) - suffixes++; - nextstate = SCAN_EXTRALNK; - } - return 1; - case SCAN_HASLNK: - nextstate = SCAN_EXTRALNK; /* Skip SCAN_BEG */ - return 1; - case SCAN_LNK: - case SCAN_EXTRALNK: - strcpy (eopath, ".lnk"); - nextstate = SCAN_DONE; - return 1; - case SCAN_JUSTCHECK: - nextstate = SCAN_APPENDLNK; - return 1; - case SCAN_APPENDLNK: - strcat (eopath, ".lnk"); - nextstate = SCAN_DONE; - return 1; - default: - *eopath = '\0'; - return 0; - } } /* Check if PATH is a symlink. PATH must be a valid Win32 path name. |