* Reduce difference to the cmake branch, MSVC fixes.
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 13 May 2011 17:16:08 +0000 (17:16 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 13 May 2011 17:16:08 +0000 (17:16 +0000)
svn path=/trunk/; revision=51702

reactos/base/applications/cmdutils/doskey/doskey.c
reactos/base/applications/sndrec32/sndrec32.cpp
reactos/boot/freeldr/freeldr/freeldr.c
reactos/dll/win32/glu32/libutil/mipmap.c
reactos/dll/win32/riched20/txtsrv.c
reactos/dll/win32/shell32/shelllink.c
reactos/drivers/base/nmidebug/nmidebug.c
reactos/drivers/bus/acpi/osl.c
reactos/drivers/usb/usbehci/pdo.c
reactos/lib/drivers/oskittcp/oskittcp/defaults.c
reactos/lib/drivers/oskittcp/oskittcp/interface.c

index 14237f9..986a3aa 100644 (file)
@@ -10,7 +10,7 @@ WCHAR szStringBuf[MAX_STRING];
 LPWSTR pszExeName = L"cmd.exe";
 
 /* Function pointers */
-typedef DWORD (WINAPI *GetConsoleCommandHistoryW_t) (LPWSTR sCommands, DWORD nBufferLength, LPWSTR sExeName); 
+typedef DWORD (WINAPI *GetConsoleCommandHistoryW_t) (LPWSTR sCommands, DWORD nBufferLength, LPWSTR sExeName);
 typedef DWORD (WINAPI *GetConsoleCommandHistoryLengthW_t) (LPWSTR sExeName);
 typedef BOOL (WINAPI *SetConsoleNumberOfCommandsW_t)(DWORD nNumber, LPWSTR sExeName);
 typedef VOID (WINAPI *ExpungeConsoleCommandHistoryW_t)(LPWSTR sExeName);
@@ -142,7 +142,7 @@ static VOID ReadFromFile(LPWSTR param)
         return;
     }
 
-    while ( fgetws(line, MAX_PATH, fp) != NULL) 
+    while ( fgetws(line, MAX_PATH, fp) != NULL)
     {
         /* Remove newline character */
         WCHAR *end = &line[wcslen(line) - 1];
@@ -191,13 +191,16 @@ static LPWSTR RemoveQuotes(LPWSTR str)
 int
 wmain(VOID)
 {
-       setlocale(LC_ALL, "");
+    WCHAR *pArgStart;
+    WCHAR *pArgEnd;
+    HMODULE hKernel32;
+
+    setlocale(LC_ALL, "");
 
     /* Get the full command line using GetCommandLine(). We can't just use argv,
      * because then a parameter like "gotoroot=cd \" wouldn't be passed completely. */
-    WCHAR *pArgStart;
-    WCHAR *pArgEnd = GetCommandLine();
-       HMODULE hKernel32 = LoadLibraryW(L"kernel32.dll");
+    pArgEnd = GetCommandLine();
+       hKernel32 = LoadLibraryW(L"kernel32.dll");
 
        /* Get function pointers */
        pGetConsoleCommandHistoryW = (GetConsoleCommandHistoryW_t)GetProcAddress( hKernel32,  "GetConsoleCommandHistoryW");
index 3e0f4a7..830e232 100644 (file)
@@ -462,7 +462,7 @@ WndProc_wave( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
 
                 x = ( i * samples ) / WAVEBAR_CX;
 
-                line_h = ( abs(AUD_OUT->nsample( x )) * max_h ) / AUD_OUT->samplevalue_max();
+                line_h = ( AUD_OUT->nsample( x ) * max_h ) / AUD_OUT->samplevalue_max();
 
 
                 if ( line_h )
index 5789916..98af295 100644 (file)
@@ -54,6 +54,17 @@ VOID BootMain(LPSTR CmdLine)
        RunLoader();
 }
 
+#ifdef _MSC_VER
+long _ftol2(double f)
+{
+    return _ftol(f);
+}
+long _ftol2_sse(double f)
+{
+    return _ftol(f);
+}
+#endif
+
 // We need to emulate these, because the original ones don't work in freeldr
 int __cdecl wctomb(char *mbchar, wchar_t wchar)
 {
index b943c7b..e2a07bb 100644 (file)
@@ -6577,7 +6577,7 @@ static void halve1DimagePackedPixel(int components,
  * Contributed by Gerk Huisma <gerk@five-d.demon.nl>.
  */
 
-typedef WINAPI void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
+typedef void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
                                                  GLenum internalFormat,
                                                  GLsizei width, GLsizei height,
                                                  GLsizei depth, GLint border,
index 7ab2af4..8db45e8 100644 (file)
@@ -88,7 +88,10 @@ HRESULT WINAPI CreateTextServices(IUnknown  * pUnkOuter,
    ITextImpl->lpVtbl = &textservices_Vtbl;
    ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
    ITextImpl->editor->exStyleFlags = 0;
-   ITextImpl->editor->rcFormat = (RECT){0,0,0,0};
+   ITextImpl->editor->rcFormat.left = 0;
+   ITextImpl->editor->rcFormat.top = 0;
+   ITextImpl->editor->rcFormat.right = 0;
+   ITextImpl->editor->rcFormat.bottom = 0;
    ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
 
    if (pUnkOuter)
index fb60fab..78c25c4 100644 (file)
@@ -187,9 +187,13 @@ static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWor
 /* strdup on the process heap */
 static LPWSTR __inline HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str)
 {
+    INT len;
+    LPWSTR p; 
+
     assert(str);
-    INT len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
-    LPWSTR p = HeapAlloc( heap, flags, len*sizeof (WCHAR) );
+
+    len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
+    p = HeapAlloc( heap, flags, len*sizeof (WCHAR) );
     if( !p )
         return p;
     MultiByteToWideChar( CP_ACP, 0, str, -1, p, len );
index cfe8755..9b14785 100644 (file)
@@ -21,7 +21,14 @@ NmiClearFlag(VOID)
 {
     ((PCHAR)&KiBugCheckData[4])[0] -= (NmiBegin[3] | NmiBegin[7]);
     ((PCHAR)&KiBugCheckData[4])[3] |= 1;
+#ifdef _MSC_VER
+    __asm
+    {
+        rcr KiBugCheckData[4], 8
+    }
+#else
     __asm__("rcrl %b[shift], %k[retval]" : [retval] "=rm" (KiBugCheckData[4]) : "[retval]" (KiBugCheckData[4]), [shift] "Nc" (8));
+#endif
 }
 
 BOOLEAN
index a5df0c0..4eeb71f 100644 (file)
@@ -67,6 +67,8 @@ AcpiOsRemoveInterruptHandler (
 ACPI_STATUS
 AcpiOsInitialize (void)
 {
+    UINT32 i;
+
     DPRINT("AcpiOsInitialize called\n");
 
 #ifndef NDEBUG
@@ -75,8 +77,6 @@ AcpiOsInitialize (void)
     AcpiDbgLayer = 0xFFFFFFFF;
 #endif
 
-    UINT32 i;
-
     for (i = 0; i < NUM_SEMAPHORES; i++)
     {
         AcpiGbl_Semaphores[i].OsHandle = NULL;
@@ -209,10 +209,11 @@ void *
 AcpiOsAcquireObject (
     ACPI_CACHE_T            *Cache)
 {
+    void* ptr;
        PNPAGED_LOOKASIDE_LIST List = (PNPAGED_LOOKASIDE_LIST)Cache;
+
     DPRINT("AcpiOsAcquireObject from %p\n", Cache);
-    void* ptr = 
-        ExAllocateFromNPagedLookasideList(List);
+    ptr = ExAllocateFromNPagedLookasideList(List);
     ASSERT(ptr);
 
        RtlZeroMemory(ptr,List->L.Size);
@@ -692,8 +693,10 @@ AcpiOsExecute (
 UINT64
 AcpiOsGetTimer (void)
 {
-    DPRINT("AcpiOsGetTimer\n");
     LARGE_INTEGER Timer;
+
+    DPRINT("AcpiOsGetTimer\n");
+    
     KeQueryTickCount(&Timer);
 
     return Timer.QuadPart;
@@ -758,9 +761,10 @@ ACPI_PHYSICAL_ADDRESS
 AcpiOsGetRootPointer (
     void)
 {
-    DPRINT("AcpiOsGetRootPointer\n");
     ACPI_PHYSICAL_ADDRESS pa = 0;
 
+    DPRINT("AcpiOsGetRootPointer\n");
+    
     AcpiFindRootPointer(&pa);
     return pa;
 }
index 0181628..38829fc 100644 (file)
@@ -368,6 +368,8 @@ PdoDispatchPnp(
     PIO_STACK_LOCATION Stack;
     ULONG_PTR Information = Irp->IoStatus.Information;
     NTSTATUS Status = Irp->IoStatus.Status;
+    PDEVICE_CAPABILITIES DeviceCapabilities;
+    ULONG i;
 
     Stack = IoGetCurrentIrpStackLocation(Irp);
     MinorFunction = Stack->MinorFunction;
@@ -513,8 +515,6 @@ PdoDispatchPnp(
         case IRP_MN_QUERY_CAPABILITIES:
         {
             DPRINT("Ehci: PDO Query Capabilities\n");
-            PDEVICE_CAPABILITIES DeviceCapabilities;
-            ULONG i;
 
             DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
 
index 08a5fd6..bfc27f9 100644 (file)
@@ -194,7 +194,11 @@ int bcmp(const void *b1, const void *b2, size_t len)
        return RtlCompareMemory(b1, b2, len);
 }
 
+#ifndef _MSC_VER
+
 int memcmp(const void *b1, const void *b2, size_t len)
 {
        return RtlCompareMemory(b1, b2, len);
 }
+
+#endif
index bda5937..9205757 100644 (file)
@@ -129,9 +129,10 @@ int OskitTCPSocket( void *context,
                    int proto )
 {
     struct socket *so;
+    int error ;
 
     OSKLock();
-    int error = socreate(domain, &so, type, proto);
+    error = socreate(domain, &so, type, proto);
     if( !error ) {
        so->so_connection = context;
     InitializeSocketFlags(so);