[MPlayer-cvslog] r32200 - trunk/loader/afl.c

reimar subversion at mplayerhq.hu
Sun Sep 12 17:35:41 CEST 2010


Author: reimar
Date: Sun Sep 12 17:35:41 2010
New Revision: 32200

Log:
Avoid some pointless uses of sizeof() and one related cast.

Modified:
   trunk/loader/afl.c

Modified: trunk/loader/afl.c
==============================================================================
--- trunk/loader/afl.c	Sun Sep 12 17:14:47 2010	(r32199)
+++ trunk/loader/afl.c	Sun Sep 12 17:35:41 2010	(r32200)
@@ -401,15 +401,15 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREA
     if (was == NULL)
 	return MMSYSERR_NOMEM;
     was->drvInst.cbStruct = sizeof(was->drvInst);
-    was->drvInst.pwfxSrc = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was));
+    was->drvInst.pwfxSrc = (PWAVEFORMATEX)(was + 1);
     memcpy(was->drvInst.pwfxSrc, pwfxSrc, wfxSrcSize);
     // LHACM is checking for 0x1
     // but if this will not help
     // was->drvInst.pwfxSrc->wFormatTag = 1;
-    was->drvInst.pwfxDst = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was) + wfxSrcSize);
+    was->drvInst.pwfxDst = (PWAVEFORMATEX)((LPSTR)(was + 1) + wfxSrcSize);
     memcpy(was->drvInst.pwfxDst, pwfxDst, wfxDstSize);
     if (pwfltr) {
-	was->drvInst.pwfltr = (PWAVEFILTER)((LPSTR)was + sizeof(*was) + wfxSrcSize + wfxDstSize);
+	was->drvInst.pwfltr = (PWAVEFILTER)((LPSTR)(was + 1) + wfxSrcSize + wfxDstSize);
 	memcpy(was->drvInst.pwfltr, pwfltr, sizeof(WAVEFILTER));
     } else {
 	was->drvInst.pwfltr = NULL;


More information about the MPlayer-cvslog mailing list