comparison src/os_win32.c @ 16109:82cbb08ae0f9 v8.1.1059

patch 8.1.1059: MS-Windows: PlatformId() is called unnecessarily commit https://github.com/vim/vim/commit/90d0cf69aab7c1d6f5212d47ca1a5fe1a213bbc8 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 27 21:49:14 2019 +0100 patch 8.1.1059: MS-Windows: PlatformId() is called unnecessarily Problem: MS-Windows: PlatformId() is called unnecessarily. Solution: Remove calls to PlatformId(). (Ken Takata, closes https://github.com/vim/vim/issues/4170)
author Bram Moolenaar <Bram@vim.org>
date Wed, 27 Mar 2019 22:00:07 +0100
parents 884b683d12e9
children 602f1888a230
comparison
equal deleted inserted replaced
16108:a0407a92cab9 16109:82cbb08ae0f9
6794 long_u 6794 long_u
6795 mch_total_mem(int special UNUSED) 6795 mch_total_mem(int special UNUSED)
6796 { 6796 {
6797 MEMORYSTATUSEX ms; 6797 MEMORYSTATUSEX ms;
6798 6798
6799 PlatformId();
6800 /* Need to use GlobalMemoryStatusEx() when there is more memory than 6799 /* Need to use GlobalMemoryStatusEx() when there is more memory than
6801 * what fits in 32 bits. But it's not always available. */ 6800 * what fits in 32 bits. But it's not always available. */
6802 ms.dwLength = sizeof(MEMORYSTATUSEX); 6801 ms.dwLength = sizeof(MEMORYSTATUSEX);
6803 GlobalMemoryStatusEx(&ms); 6802 GlobalMemoryStatusEx(&ms);
6804 if (ms.ullAvailVirtual < ms.ullTotalPhys) 6803 if (ms.ullAvailVirtual < ms.ullTotalPhys)
6980 * Get the default shell for the current hardware platform 6979 * Get the default shell for the current hardware platform
6981 */ 6980 */
6982 char * 6981 char *
6983 default_shell(void) 6982 default_shell(void)
6984 { 6983 {
6985 PlatformId();
6986
6987 return "cmd.exe"; 6984 return "cmd.exe";
6988 } 6985 }
6989 6986
6990 /* 6987 /*
6991 * mch_access() extends access() to do more detailed check on network drives. 6988 * mch_access() extends access() to do more detailed check on network drives.
7325 */ 7322 */
7326 int 7323 int
7327 mch_copy_file_attribute(char_u *from, char_u *to) 7324 mch_copy_file_attribute(char_u *from, char_u *to)
7328 { 7325 {
7329 /* File streams only work on Windows NT and later. */ 7326 /* File streams only work on Windows NT and later. */
7330 PlatformId();
7331 copy_infostreams(from, to); 7327 copy_infostreams(from, to);
7332 return 0; 7328 return 0;
7333 } 7329 }
7334 7330
7335 #if defined(MYRESETSTKOFLW) || defined(PROTO) 7331 #if defined(MYRESETSTKOFLW) || defined(PROTO)
7355 BYTE *pLowestPossiblePage; 7351 BYTE *pLowestPossiblePage;
7356 MEMORY_BASIC_INFORMATION mbi; 7352 MEMORY_BASIC_INFORMATION mbi;
7357 SYSTEM_INFO si; 7353 SYSTEM_INFO si;
7358 DWORD nPageSize; 7354 DWORD nPageSize;
7359 DWORD dummy; 7355 DWORD dummy;
7360
7361 PlatformId();
7362 7356
7363 /* We need to know the system page size. */ 7357 /* We need to know the system page size. */
7364 GetSystemInfo(&si); 7358 GetSystemInfo(&si);
7365 nPageSize = si.dwPageSize; 7359 nPageSize = si.dwPageSize;
7366 7360