Changeset 21737 for branches/gcc-kmk/src
- Timestamp:
- Oct 24, 2011, 9:23:36 PM (14 years ago)
- Location:
- branches/gcc-kmk/src/kernel32
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gcc-kmk/src/kernel32/atom.cpp
r10251 r21737 21 21 #include <misc.h> 22 22 23 #ifdef __GNUC__ 24 #include <alloca.h> 25 #endif 26 23 27 #define DBG_LOCALLOG DBG_atom 24 28 #include "dbglocal.h" -
branches/gcc-kmk/src/kernel32/conprop2.cpp
r5308 r21737 268 268 szKey, 269 269 0, 270 "",270 NULL, 271 271 0, 272 272 KEY_ALL_ACCESS, -
branches/gcc-kmk/src/kernel32/cpu.cpp
r21343 r21737 28 28 29 29 static BYTE PF[64] = {0,}; 30 static nrCPUs= 1;30 static int nrCPUs = 1; 31 31 static SYSTEM_INFO cachedsi = {0}; 32 32 … … 53 53 * Note that there is a hierarchy for every processor installed, so this 54 54 * supports multiprocessor systems. This is done like Win95 does it, I think. 55 * 55 * 56 56 * It also creates a cached flag array for IsProcessorFeaturePresent(). 57 57 * … … 104 104 } 105 105 106 if(SupportsCPUID()) 106 if(SupportsCPUID()) 107 107 { 108 for(int i=0;i<cachedsi.dwNumberOfProcessors;i++) 108 for(int i=0;i<cachedsi.dwNumberOfProcessors;i++) 109 109 { 110 110 // Create a new processor subkey … … 153 153 154 154 Sleep(32); //sleep for about 32 ms 155 155 156 156 GetTSC((LONG *)&tsc2.LowPart, &tsc2.HighPart); 157 157 QueryPerformanceCounter(&time2); … … 167 167 tmp1 = (double)tsc1.LowPart + (double)tsc1.HighPart*4.0*1024.0*1024.0; 168 168 clockticks = tmp - tmp1; 169 if(millisec > 0) 169 if(millisec > 0) 170 170 {//make sure we have something valid here 171 171 tmp = 1000 / millisec; … … 199 199 if (features & CPUID_FPU_PRESENT) { 200 200 if (i == 0) { 201 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 201 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 202 202 dprintf(("Unable to register FPU information\n")); 203 203 } … … 208 208 } 209 209 } 210 210 211 211 } //for each cpu 212 212 } -
branches/gcc-kmk/src/kernel32/directory.cpp
r21720 r21737 30 30 #include <os2win.h> 31 31 #include <stdlib.h> 32 #include <string.h> 33 #ifdef __GNUC__ 34 #include <alloca.h> 35 #endif 32 36 #include <unicode.h> 33 37 #include <heapstring.h> … … 35 39 #include "initterm.h" 36 40 #include <win/file.h> 37 #include <string.h>38 41 #include "oslibdos.h" 39 42 #include "profile.h" … … 204 207 (len != 1) ) 205 208 { 206 LPSTR lpTemp = (LPSTR) _alloca(len);209 LPSTR lpTemp = (LPSTR)alloca(len); 207 210 lstrcpynA(lpTemp, 208 211 lpstrDirectory, … … 269 272 (lpstrDirectory[len - 1] == '/') ) 270 273 { 271 LPSTR lpTemp = (LPSTR) _alloca(len);274 LPSTR lpTemp = (LPSTR)alloca(len); 272 275 lstrcpynA(lpTemp, 273 276 lpstrDirectory, … … 533 536 (lpstrDirectory[len - 1] == '/') ) 534 537 { 535 LPSTR lpTemp = (LPSTR) _alloca(len);538 LPSTR lpTemp = (LPSTR)alloca(len); 536 539 lstrcpynA(lpTemp, 537 540 lpstrDirectory, -
branches/gcc-kmk/src/kernel32/dosdevice.cpp
r21355 r21737 9 9 * Copyright 1993 Erik Bos 10 10 * Copyright 1996 Alexandre Julliard 11 * 11 * 12 12 * Project Odin Software License can be found in LICENSE.TXT 13 13 * … … 24 24 #include <os2win.h> 25 25 #include <stdio.h> 26 #include <string.h> 26 27 #include <winnls.h> 27 28 #include "unicode.h" 28 29 #include "handlemanager.h" 29 30 #include "handlenames.h" 30 #include <string.h>31 31 32 32 … … 150 150 } 151 151 *ptr = 0; 152 152 153 153 SetLastError(ERROR_SUCCESS); 154 154 return sizeof(devices)+len; … … 176 176 if(devname[1] == ':' && devname[2] == 0) { 177 177 int ret = GetDriveTypeA(devname); 178 if(ret != DRIVE_UNKNOWN) 178 if(ret != DRIVE_UNKNOWN) 179 179 { 180 180 if(bufsize < 16) { -
branches/gcc-kmk/src/kernel32/ordinals.cpp
r6646 r21737 13 13 *****************************************************************************/ 14 14 #include <os2win.h> 15 #include <string.h> 15 16 #include <winnls.h> 16 17 #include "unicode.h" 17 18 #include "handlemanager.h" 18 #include <string.h>19 19 20 20 #include "stubs.h" -
branches/gcc-kmk/src/kernel32/osliblvm.cpp
r21720 r21737 356 356 return volinfo; 357 357 } 358 for(int i=0;i<volctrl->Count;i++) { 358 int i; 359 for(i=0;i<volctrl->Count;i++) { 359 360 volinfo = Get_Volume_Information(volctrl->Volume_Control_Data[i].Volume_Handle, lasterror); 360 361 if(*lasterror != LVM_ENGINE_NO_ERROR) { … … 394 395 return volinfo; 395 396 } 396 for(int i=0;i<volctrl->Count;i++) { 397 int i; 398 for(i=0;i<volctrl->Count;i++) { 397 399 volinfo = Get_Volume_Information(volctrl->Volume_Control_Data[i].Volume_Handle, lasterror); 398 400 if(*lasterror != LVM_ENGINE_NO_ERROR) { … … 499 501 return FALSE; 500 502 } 501 for(int i=0;i<diskinfo.Count;i++) { 503 int i; 504 for(i=0;i<diskinfo.Count;i++) { 502 505 if(diskinfo.Drive_Control_Data[i].Drive_Handle == partctrl.Partition_Array[0].Drive_Handle) { 503 506 //win32 base = 0, os2 base = 1 -
branches/gcc-kmk/src/kernel32/stubs.cpp
r21324 r21737 15 15 *****************************************************************************/ 16 16 #include <os2win.h> 17 #include <string.h> 17 18 #include <winnls.h> 18 19 #include "unicode.h" 19 20 #include "handlemanager.h" 20 #include <string.h>21 21 22 22 #include "stubs.h" -
branches/gcc-kmk/src/kernel32/windlllx.cpp
r21716 r21737 24 24 #include <string.h> 25 25 #include <stdlib.h> 26 #ifndef __GNUC__ 26 27 #include <iostream.h> 27 28 #include <fstream.h> 29 #endif 28 30 #include <misc.h> 29 31 #include <win32type.h> -
branches/gcc-kmk/src/kernel32/windllpeldr.cpp
r21716 r21737 21 21 #include <string.h> 22 22 #include <stdlib.h> 23 #ifndef __GNUC__ 23 24 #include <iostream.h> 24 25 #include <fstream.h> 26 #endif 25 27 #include <misc.h> 26 28 #include <win32type.h> -
branches/gcc-kmk/src/kernel32/winexelx.cpp
r21716 r21737 19 19 #include <string.h> 20 20 #include <stdlib.h> 21 #ifndef __GNUC__ 21 22 #include <iostream.h> 22 23 #include <fstream.h> 24 #endif 23 25 #include <misc.h> 24 26 #include <win32type.h> -
branches/gcc-kmk/src/kernel32/winexepeldr.cpp
r21716 r21737 19 19 #include <string.h> 20 20 #include <stdlib.h> 21 #ifndef __GNUC__ 21 22 #include <iostream.h> 22 23 #include <fstream.h> 24 #endif 23 25 #include <misc.h> 24 26 #include <win32type.h> … … 53 55 //Called by ring 3 pe loader to create win32 executable 54 56 //PE.EXE command line options: 55 // /OPT:[x1=y,x2=z,..] 57 // /OPT:[x1=y,x2=z,..] 56 58 // x = CURDIR -> set current directory to y 57 59 // (not other options available at this time) 58 60 //****************************************************************************** 59 61 DWORD WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine, 60 char *peoptions, 62 char *peoptions, 61 63 ULONG reservedMem, ULONG ulPEOffset, 62 64 BOOL fConsoleApp, BOOL fVioConsole, … … 118 120 free(szFullCmdLine); 119 121 120 //Init console before loading executable as dlls might want to print 122 //Init console before loading executable as dlls might want to print 121 123 //something on the console while being loaded 122 if(WinExe->isConsoleApp()) 124 if(WinExe->isConsoleApp()) 123 125 { 124 126 dprintf(("Console application!\n")); … … 142 144 } 143 145 OS2UnsetExceptionHandler(&exceptFrame); 144 146 145 147 #ifdef PROFILE 146 148 // Note: after this point, we might start collecting performance … … 150 152 ProfilerEnable(TRUE); 151 153 #endif /* PROFILE */ 152 153 154 155 154 156 WinExe->start(); 155 157 -
branches/gcc-kmk/src/kernel32/winimgres.cpp
r21716 r21737 37 37 #define MAX_RES 17 38 38 typedef struct { 39 c har *typename;40 int 39 const char *typenam; 40 int namelen; 41 41 } STD_RESTYPE; 42 42 … … 131 131 typelen = strlen(lpszType); 132 132 133 for(int i=0;i<MAX_RES;i++) { 133 int i; 134 for(i=0;i<MAX_RES;i++) { 134 135 if(ResType[i].namelen && 135 136 ResType[i].namelen == typelen && 136 stricmp(lpszType, ResType[i].typenam e) == 0)137 stricmp(lpszType, ResType[i].typenam) == 0) 137 138 break; 138 139 } … … 186 187 typelen = strlen(astring1); 187 188 188 for(int i=0;i<MAX_RES;i++) { 189 int i; 190 for(i=0;i<MAX_RES;i++) { 189 191 if(ResType[i].namelen && 190 192 ResType[i].namelen == typelen && 191 stricmp(astring1, ResType[i].typenam e) == 0)193 stricmp(astring1, ResType[i].typenam) == 0) 192 194 break; 193 195 } … … 603 605 pstring = (PIMAGE_RESOURCE_DIR_STRING_U)((ULONG)pResRootDir + nameOffset); 604 606 int len = lstrlenWtoA( pstring->NameString, pstring->Length ); 605 char *typenam e= (char *)malloc( len + 1 );606 lstrcpynWtoA(typenam e, pstring->NameString, len + 1 );607 typenam e[len] = 0;608 609 fRet = lpEnumFunc(hmod, typenam e, lParam);610 free(typenam e);607 char *typenam = (char *)malloc( len + 1 ); 608 lstrcpynWtoA(typenam, pstring->NameString, len + 1 ); 609 typenam[len] = 0; 610 611 fRet = lpEnumFunc(hmod, typenam, lParam); 612 free(typenam); 611 613 } 612 614 else {
Note:
See TracChangeset
for help on using the changeset viewer.