changeset 32116:601319a3523e

Avoid some pointless uses of sizeof() and one related cast.
author reimar
date Sun, 12 Sep 2010 15:35:41 +0000
parents 38ffbeed52a0
children 7af5fdfdc3d9
files loader/afl.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/loader/afl.c	Sun Sep 12 15:14:47 2010 +0000
+++ b/loader/afl.c	Sun Sep 12 15:35:41 2010 +0000
@@ -401,15 +401,15 @@
     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;