Author: dchapyshev
Date: Sat Apr 11 12:58:56 2009
New Revision: 40456

URL: http://svn.reactos.org/svn/reactos?rev=40456&view=rev
Log:
- Sync gdiplus, iccvid, imaadp32.acm, inetcomm with Wine 1.1.19
- Remove unneeded gdiplus_ros.diff

Removed:
    trunk/reactos/dll/win32/gdiplus/gdiplus_ros.diff
Modified:
    trunk/reactos/dll/win32/gdiplus/gdiplus.c
    trunk/reactos/dll/win32/gdiplus/gdiplus.spec
    trunk/reactos/dll/win32/gdiplus/gdiplus_private.h
    trunk/reactos/dll/win32/iccvid/iccvid.c
    trunk/reactos/dll/win32/imaadp32.acm/imaadp32.c
    trunk/reactos/dll/win32/inetcomm/internettransport.c

Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.c?rev=40456&r1=40455&r2=40456&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus.c [iso-8859-1] Sat Apr 11 12:58:56 
2009
@@ -214,7 +214,7 @@
     unstretch_angle(&startAngle, x2 / 2.0, y2 / 2.0);
     unstretch_angle(&endAngle, x2 / 2.0, y2 / 2.0);
 
-    count = ceil(fabs(endAngle - startAngle) / M_PI_2) * 3 + 1;
+    count = ceilf(fabs(endAngle - startAngle) / M_PI_2) * 3 + 1;
     /* don't make more than a full circle */
     count = min(MAX_ARC_PTS, count);
 

Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.spec?rev=40456&r1=40455&r2=40456&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] Sat Apr 11 
12:58:56 2009
@@ -47,7 +47,7 @@
 @ stdcall GdipBitmapUnlockBits(ptr ptr)
 @ stdcall GdipClearPathMarkers(ptr)
 @ stub GdipCloneBitmapArea
-@ stub GdipCloneBitmapAreaI
+@ stdcall GdipCloneBitmapAreaI(long long long long long ptr ptr)
 @ stdcall GdipCloneBrush(ptr ptr)
 @ stdcall GdipCloneCustomLineCap(ptr ptr)
 @ stdcall GdipCloneFont(ptr ptr)

Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_private.h?rev=40456&r1=40455&r2=40456&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] Sat Apr 11 
12:58:56 2009
@@ -61,7 +61,7 @@
 
 static inline INT roundr(REAL x)
 {
-    return (INT) floor(x + 0.5);
+    return (INT) floorf(x + 0.5);
 }
 
 static inline REAL deg2rad(REAL degrees)

Removed: trunk/reactos/dll/win32/gdiplus/gdiplus_ros.diff
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_ros.diff?rev=40455&view=auto
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus_ros.diff (removed)
@@ -1,58 +1,0 @@
-Index: gdiplus.c
-===================================================================
-RCS file: /home/wine/wine/dlls/gdiplus/gdiplus.c,v
-retrieving revision 1.15
-diff -u -r1.15 gdiplus.c
---- gdiplus.c  8 Jan 2008 16:22:52 -0000       1.15
-+++ gdiplus.c  23 Mar 2008 21:21:23 -0000
-@@ -200,7 +200,7 @@
-     unstretch_angle(&startAngle, x2 / 2.0, y2 / 2.0);
-     unstretch_angle(&endAngle, x2 / 2.0, y2 / 2.0);
- 
--    count = ceilf(fabs(endAngle - startAngle) / M_PI_2) * 3 + 1;
-+    count = ceil(fabs(endAngle - startAngle) / M_PI_2) * 3 + 1;
-     /* don't make more than a full circle */
-     count = min(MAX_ARC_PTS, count);
- 
-Index: gdiplus_private.h
-===================================================================
-RCS file: /home/wine/wine/dlls/gdiplus/gdiplus_private.h,v
-retrieving revision 1.58
-diff -u -r1.58 gdiplus_private.h
---- gdiplus_private.h  15 Aug 2007 09:36:31 -0000      1.58
-+++ gdiplus_private.h  23 Mar 2008 09:25:54 -0000
-@@ -46,7 +46,7 @@
- 
- static inline INT roundr(REAL x)
- {
--    return (INT) floorf(x + 0.5);
-+    return (INT) floor(x + 0.5);
- }
- 
- static inline REAL deg2rad(REAL degrees)
-Index: graphics.c
-===================================================================
-RCS file: /home/wine/wine/dlls/gdiplus/graphics.c,v
-retrieving revision 1.102
-diff -u -r1.102 graphics.c
---- graphics.c 1 Mar 2008 12:15:48 -0000       1.102
-+++ graphics.c 23 Mar 2008 21:21:23 -0000
-@@ -1464,7 +1464,7 @@
-     DeleteObject(SelectObject(graphics->hdc, CreateFontIndirectW(&lfw)));
- 
-     for(i = 0, j = 0; i < length; i++){
--        if(!isprintW(string[i]) && (string[i] != '\n'))
-+        if(!isprint(string[i]) && (string[i] != '\n'))
-             continue;
- 
-         stringdup[j] = string[i];
-@@ -1873,7 +1873,7 @@
-         nwidth = nheight = INT_MAX;
- 
-     for(i = 0, j = 0; i < length; i++){
--        if(!isprintW(string[i]) && (string[i] != '\n'))
-+        if(!isprint(string[i]) && (string[i] != '\n'))
-             continue;
- 
-         stringdup[j] = string[i];
-

Modified: trunk/reactos/dll/win32/iccvid/iccvid.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iccvid/iccvid.c?rev=40456&r1=40455&r2=40456&view=diff
==============================================================================
--- trunk/reactos/dll/win32/iccvid/iccvid.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iccvid/iccvid.c [iso-8859-1] Sat Apr 11 12:58:56 
2009
@@ -57,6 +57,7 @@
 static HINSTANCE ICCVID_hModule;
 
 #define ICCVID_MAGIC mmioFOURCC('c', 'v', 'i', 'd')
+#define compare_fourcc(fcc1, fcc2) (((fcc1)^(fcc2))&~0x20202020)
 
 #define DBUG    0
 #define MAX_STRIPS 32
@@ -975,7 +976,7 @@
 
         TRACE("Opened\n");
 
-        if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
+        if (icinfo && compare_fourcc(icinfo->fccType, ICTYPE_VIDEO)) return 0;
 
         info = heap_alloc( sizeof (ICCVID_Info) );
         if( info )

Modified: trunk/reactos/dll/win32/imaadp32.acm/imaadp32.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imaadp32.acm/imaadp32.c?rev=40456&r1=40455&r2=40456&view=diff
==============================================================================
--- trunk/reactos/dll/win32/imaadp32.acm/imaadp32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/imaadp32.acm/imaadp32.c [iso-8859-1] Sat Apr 11 
12:58:56 2009
@@ -120,7 +120,50 @@
            return i;
     }
 
+    switch (wfx->wFormatTag)
+    {
+    case WAVE_FORMAT_PCM:
+       if(3 > wfx->nChannels &&
+          wfx->nChannels > 0 &&
+          wfx->nAvgBytesPerSec == 2 * wfx->nSamplesPerSec * wfx->nChannels &&
+          wfx->nBlockAlign == 2 * wfx->nChannels &&
+          wfx->wBitsPerSample == 16)
+          return hi;
+       break;
+    case WAVE_FORMAT_IMA_ADPCM:
+       if(3 > wfx->nChannels &&
+          wfx->nChannels > 0 &&
+          wfx->wBitsPerSample == 4 &&
+          wfx->cbSize == 2)
+          return hi;
+       break;
+    }
+
     return 0xFFFFFFFF;
+}
+
+static void     init_wfx_ima_adpcm(IMAADPCMWAVEFORMAT* awfx/*, DWORD nba*/)
+{
+    register WAVEFORMATEX*      pwfx = &awfx->wfx;
+
+    /* we assume wFormatTag, nChannels, nSamplesPerSec and wBitsPerSample
+     * have been initialized... */
+
+    if (pwfx->wFormatTag != WAVE_FORMAT_IMA_ADPCM) {FIXME("wrong FT\n"); 
return;}
+    if (ADPCM_GetFormatIndex(pwfx) == 0xFFFFFFFF) {FIXME("wrong fmt\n"); 
return;}
+
+    switch (pwfx->nSamplesPerSec)
+    {
+    case  8000: pwfx->nBlockAlign = 256 * pwfx->nChannels;   break;
+    case 11025: pwfx->nBlockAlign = 256 * pwfx->nChannels;   break;
+    case 22050: pwfx->nBlockAlign = 512 * pwfx->nChannels;   break;
+    case 44100: pwfx->nBlockAlign = 1024 * pwfx->nChannels;  break;
+    default: /*pwfx->nBlockAlign = nba;*/  break;
+    }
+    pwfx->cbSize = sizeof(WORD);
+
+    awfx->wSamplesPerBlock = (pwfx->nBlockAlign - (4 * pwfx->nChannels) * 2) / 
pwfx->nChannels + 1;
+    pwfx->nAvgBytesPerSec = (pwfx->nSamplesPerSec * pwfx->nBlockAlign) / 
awfx->wSamplesPerBlock;
 }
 
 /***********************************************************************
@@ -612,6 +655,7 @@
     /* some tests ... */
     if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
        adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
+       adfs->pwfxSrc->wFormatTag == adfs->pwfxDst->wFormatTag ||
        ADPCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return 
ACMERR_NOTPOSSIBLE;
     /* FIXME: should do those tests against the real size (according to format 
tag */
 
@@ -636,26 +680,24 @@
             adfs->pwfxDst->wFormatTag = WAVE_FORMAT_PCM;
     }
 
-    /* check if result is ok */
-    if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return 
ACMERR_NOTPOSSIBLE;
-
     /* recompute other values */
     switch (adfs->pwfxDst->wFormatTag)
     {
     case WAVE_FORMAT_PCM:
         adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * 
adfs->pwfxDst->wBitsPerSample) / 8;
         adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * 
adfs->pwfxDst->nBlockAlign;
+        /* check if result is ok */
+        if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return 
ACMERR_NOTPOSSIBLE;
         break;
     case WAVE_FORMAT_IMA_ADPCM:
-        adfs->pwfxDst->nBlockAlign = 1024;
+        init_wfx_ima_adpcm((IMAADPCMWAVEFORMAT*)adfs->pwfxDst);
         /* FIXME: not handling header overhead */
-        adfs->pwfxDst->nAvgBytesPerSec = ((adfs->pwfxDst->nSamplesPerSec * 4) 
/ 8) * adfs->pwfxSrc->nChannels;
-        ((IMAADPCMWAVEFORMAT*)adfs->pwfxDst)->wSamplesPerBlock = (1024 - 4 * 
adfs->pwfxSrc->nChannels) * (2 / adfs->pwfxSrc->nChannels) + 1;
         TRACE("setting spb=%u\n", 
((IMAADPCMWAVEFORMAT*)adfs->pwfxDst)->wSamplesPerBlock);
+        /* check if result is ok */
+        if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return 
ACMERR_NOTPOSSIBLE;
         break;
     default:
-        FIXME("\n");
-        break;
+        return ACMERR_NOTPOSSIBLE;
     }
 
     return MMSYSERR_NOERROR;
@@ -775,6 +817,8 @@
  */
 static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, 
PACMDRVSTREAMSIZE adss)
 {
+    DWORD nblocks;
+
     switch (adss->fdwSize)
     {
     case ACM_STREAMSIZEF_DESTINATION:
@@ -782,14 +826,18 @@
        if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
            adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM)
         {
-           /* don't take block overhead into account, doesn't matter too much 
*/
-           adss->cbSrcLength = adss->cbDstLength * 4;
+            nblocks = adss->cbDstLength / adsi->pwfxDst->nBlockAlign;
+            if (nblocks == 0)
+                return ACMERR_NOTPOSSIBLE;
+            adss->cbSrcLength = nblocks * adsi->pwfxSrc->nBlockAlign * 
((IMAADPCMWAVEFORMAT*)adsi->pwfxDst)->wSamplesPerBlock;
        }
         else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM &&
                  adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
         {
-           FIXME("misses the block header overhead\n");
-           adss->cbSrcLength = 256 + adss->cbDstLength / 4;
+            nblocks = adss->cbDstLength / (adsi->pwfxDst->nBlockAlign * 
((IMAADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock);
+            if (nblocks == 0)
+                return ACMERR_NOTPOSSIBLE;
+            adss->cbSrcLength = nblocks * adsi->pwfxSrc->nBlockAlign;
        }
         else
         {
@@ -801,14 +849,24 @@
        if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
            adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM)
         {
-           FIXME("misses the block header overhead\n");
-           adss->cbDstLength = 256 + adss->cbSrcLength / 4;
+            nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * 
((IMAADPCMWAVEFORMAT*)adsi->pwfxDst)->wSamplesPerBlock);
+            if (nblocks == 0)
+                return ACMERR_NOTPOSSIBLE;
+            if (adss->cbSrcLength % (adsi->pwfxSrc->nBlockAlign * 
((IMAADPCMWAVEFORMAT*)adsi->pwfxDst)->wSamplesPerBlock))
+                /* Round block count up. */
+                nblocks++;
+            adss->cbDstLength = nblocks * adsi->pwfxDst->nBlockAlign;
        }
         else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM &&
                  adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
         {
-           /* don't take block overhead into account, doesn't matter too much 
*/
-           adss->cbDstLength = adss->cbSrcLength * 4;
+            nblocks = adss->cbSrcLength / adsi->pwfxSrc->nBlockAlign;
+            if (nblocks == 0)
+                return ACMERR_NOTPOSSIBLE;
+            if (adss->cbSrcLength % adsi->pwfxSrc->nBlockAlign)
+                /* Round block count up. */
+                nblocks++;
+            adss->cbDstLength = nblocks * adsi->pwfxDst->nBlockAlign * 
((IMAADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock;
        }
         else
         {

Modified: trunk/reactos/dll/win32/inetcomm/internettransport.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/internettransport.c?rev=40456&r1=40455&r2=40456&view=diff
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/internettransport.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/internettransport.c [iso-8859-1] Sat Apr 
11 12:58:56 2009
@@ -20,18 +20,14 @@
 
 #define COBJMACROS
 
-#include <stdarg.h>
-#include <stdio.h>
-
+#include "ws2tcpip.h"
 #include "windef.h"
-#include "winbase.h"
 #include "winnt.h"
-#include "winuser.h"
-#include "winsock2.h"
-#include "ws2tcpip.h"
 #include "objbase.h"
 #include "ole2.h"
 #include "mimeole.h"
+
+#include <stdio.h>
 
 #include "wine/debug.h"
 

Reply via email to