[MPlayer-cvslog] r24425 - in trunk/loader: dmo/dmo.c

Bill Song dev at fastreaming.com
Tue Sep 11 02:45:29 CEST 2007


Dear:

I think this change should be reverted

void ** is correct

The warning should be ignore!



> Author: voroshil
> Date: Mon Sep 10 20:27:45 2007
> New Revision: 24425
>
> Log:
> Fix for:
> dshow/DS_Filter.c: In function 'DS_Filter_CopySample':
> dshow/DS_Filter.c:103: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> dshow/DS_Filter.c:185: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> dshow/DS_Filter.c:191: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> dshow/DS_Filter.c:198: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> dshow/DS_Filter.c:220: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> dshow/DS_Filter.c:245: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> dmo/dmo.c: In function 'DMO_FilterCreate':
> dmo/dmo.c:73: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> dmo/dmo.c:79: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> dmo/dmo.c:86: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> dmo/dmo.c:90: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> dmo/dmo.c:93: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
>
>
> Modified:
>   trunk/loader/dmo/dmo.c
>   trunk/loader/dshow/DS_Filter.c
>
> Modified: trunk/loader/dmo/dmo.c
>
> ==============================================================================
> --- trunk/loader/dmo/dmo.c      (original)
> +++ trunk/loader/dmo/dmo.c      Mon Sep 10 20:27:45 2007
> @@ -70,27 +70,27 @@ DMO_Filter* DMO_FilterCreate(const char*
>            break;
>        }
> //trapbug();
> -       hr = func(id, &IID_IClassFactory, (void**)&factory);
> +       hr = func(id, &IID_IClassFactory, (void*)&factory);
>        if (hr || !factory)
>        {
>            em = "no such class object";
>            break;
>        }
> -       hr = factory->vt->CreateInstance(factory, 0, &IID_IUnknown,
> (void**)&object);
> +       hr = factory->vt->CreateInstance(factory, 0, &IID_IUnknown,
> (void*)&object);
>        factory->vt->Release((IUnknown*)factory);
>        if (hr || !object)
>        {
>            em = "class factory failure";
>            break;
>        }
> -       hr = object->vt->QueryInterface(object, &IID_IMediaObject,
> (void**)&This->m_pMedia);
> +       hr = object->vt->QueryInterface(object, &IID_IMediaObject,
> (void*)&This->m_pMedia);
>        if (hr == 0)
>        {
>             /* query for some extra available interface */
> -           HRESULT r = object->vt->QueryInterface(object,
> &IID_IMediaObjectInPlace, (void**)&This->m_pInPlace);
> +           HRESULT r = object->vt->QueryInterface(object,
> &IID_IMediaObjectInPlace, (void*)&This->m_pInPlace);
>             if (r == 0 && This->m_pInPlace)
>                printf("DMO dll supports InPlace - PLEASE REPORT to
> developer\n");
> -           r = object->vt->QueryInterface(object,
> &IID_IDMOVideoOutputOptimizations, (void**)&This->m_pOptim);
> +           r = object->vt->QueryInterface(object,
> &IID_IDMOVideoOutputOptimizations, (void*)&This->m_pOptim);
>            if (r == 0 && This->m_pOptim)
>            {
>                 unsigned long flags;
>
> Modified: trunk/loader/dshow/DS_Filter.c
>
> ==============================================================================
> --- trunk/loader/dshow/DS_Filter.c      (original)
> +++ trunk/loader/dshow/DS_Filter.c      Mon Sep 10 20:27:45 2007
> @@ -96,7 +96,7 @@ void DS_Filter_Destroy(DS_Filter* This)
> }
>
> static HRESULT STDCALL DS_Filter_CopySample(void* pUserData,IMediaSample*
> pSample){
> -    char* pointer;
> +    BYTE* pointer;
>     int len;
>     SampleProcUserData* pData=(SampleProcUserData*)pUserData;
>     Debug printf("CopySample called(%p,%p)\n",pSample,pUserData);
> @@ -182,20 +182,20 @@ DS_Filter* DS_FilterCreate(const char* d
>            em = "illegal or corrupt DirectShow DLL";
>            break;
>        }
> -       result = func(id, &IID_IClassFactory, (void**)&factory);
> +       result = func(id, &IID_IClassFactory, (void*)&factory);
>        if (result || !factory)
>        {
>            em = "no such class object";
>            break;
>        }
> -       result = factory->vt->CreateInstance(factory, 0, &IID_IUnknown,
> (void**)&object);
> +       result = factory->vt->CreateInstance(factory, 0, &IID_IUnknown,
> (void*)&object);
>        factory->vt->Release((IUnknown*)factory);
>        if (result || !object)
>        {
>            em = "class factory failure";
>            break;
>        }
> -       result = object->vt->QueryInterface(object, &IID_IBaseFilter,
> (void**)&This->m_pFilter);
> +       result = object->vt->QueryInterface(object, &IID_IBaseFilter,
> (void*)&This->m_pFilter);
>        object->vt->Release((IUnknown*)object);
>        if (result || !This->m_pFilter)
>        {
> @@ -216,14 +216,14 @@ DS_Filter* DS_FilterCreate(const char* d
>
>        for (i = 0; i < fetched; i++)
>        {
> -           int direction = -1;
> +           PIN_DIRECTION direction = -1;
>            array[i]->vt->QueryDirection(array[i],
> (PIN_DIRECTION*)&direction);
> -           if (!This->m_pInputPin && direction == 0)
> +           if (!This->m_pInputPin && direction == PINDIR_INPUT)
>            {
>                This->m_pInputPin = array[i];
>
> This->m_pInputPin->vt->AddRef((IUnknown*)This->m_pInputPin);
>            }
> -           if (!This->m_pOutputPin && direction == 1)
> +           if (!This->m_pOutputPin && direction == PINDIR_OUTPUT)
>            {
>                This->m_pOutputPin = array[i];
>
> This->m_pOutputPin->vt->AddRef((IUnknown*)This->m_pOutputPin);
> @@ -242,7 +242,7 @@ DS_Filter* DS_FilterCreate(const char* d
>        }
>        result =
> This->m_pInputPin->vt->QueryInterface((IUnknown*)This->m_pInputPin,
>                                                       &IID_IMemInputPin,
>
> -                                                      (void**)&This->m_pImp);
>
> +                                                      (void*)&This->m_pImp);
>        if (result)
>        {
>            em = "could not get IMemInputPin interface";
>
>
> ------------------------------
>
> _______________________________________________
> MPlayer-cvslog mailing list
> MPlayer-cvslog at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/mplayer-cvslog
>
> End of MPlayer-cvslog Digest, Vol 39, Issue 16
> **********************************************
>


------------------------------------------
Focus on next multimedia development
       Your potential.Our passion.



More information about the MPlayer-cvslog mailing list