From 1f0635d2277dcd0818dc7f539c1cb1b296f6444b Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Mon, 25 Feb 2019 20:10:29 +0900 Subject: [PATCH] Game Kit: Fix -Werror=class-memaccess Replace memset() with media_format.Clear() to fix -Werror=class-memaccess, pointed by gcc8. Change-Id: I87a72ac06947e90c468deda6bf6d7bb3b5fb4003 Reviewed-on: https://review.haiku-os.org/c/1113 Reviewed-by: Adrien Destugues --- src/kits/game/FileGameSound.cpp | 2 +- src/kits/game/SimpleGameSound.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/game/FileGameSound.cpp b/src/kits/game/FileGameSound.cpp index daf5063a5a..0669544911 100644 --- a/src/kits/game/FileGameSound.cpp +++ b/src/kits/game/FileGameSound.cpp @@ -406,7 +406,7 @@ BFileGameSound::Init(const entry_ref* file) gs_audio_format dformat = Device()->Format(); // request the format we want the sound - memset(&playFormat, 0, sizeof(media_format)); + playFormat.Clear(); playFormat.type = B_MEDIA_RAW_AUDIO; if (fAudioStream->stream->DecodedFormat(&playFormat) != B_OK) { fAudioStream->file->ReleaseTrack(fAudioStream->stream); diff --git a/src/kits/game/SimpleGameSound.cpp b/src/kits/game/SimpleGameSound.cpp index 9cfdbe5a53..fb0250c23d 100644 --- a/src/kits/game/SimpleGameSound.cpp +++ b/src/kits/game/SimpleGameSound.cpp @@ -159,7 +159,7 @@ BSimpleGameSound::Init(const entry_ref* inFile) int64 frames = audioStream->CountFrames(); - memset(&mformat, 0, sizeof(media_format)); + mformat.Clear(); mformat.type = B_MEDIA_RAW_AUDIO; // mformat.u.raw_audio.byte_order // = (B_HOST_IS_BENDIAN) ? B_MEDIA_BIG_ENDIAN : B_MEDIA_LITTLE_ENDIAN;