From 09095817eb0340fe0165accc44a84877fb4b88aa Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sat, 19 May 2018 08:58:10 +0900 Subject: [PATCH] Mediaplayer: Suppress -Werror=class-memaccess Suppress -Werror=class-memaccess pointed out by gcc8. * Remove unneed memset(), since media_format is cleared by constructor. * Use media_format::Clear() instead of memset() Change-Id: I02e19c1fab1f1b3f6c348e1d3ac63536d5c829b2 Reviewed-on: https://review.haiku-os.org/484 Reviewed-by: Barrett17 --- src/apps/mediaplayer/media_node_framework/NodeManager.cpp | 1 - src/apps/mediaplayer/supplier/MediaTrackVideoSupplier.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apps/mediaplayer/media_node_framework/NodeManager.cpp b/src/apps/mediaplayer/media_node_framework/NodeManager.cpp index e984a57d0c..a1d9ff466e 100644 --- a/src/apps/mediaplayer/media_node_framework/NodeManager.cpp +++ b/src/apps/mediaplayer/media_node_framework/NodeManager.cpp @@ -41,7 +41,6 @@ NodeManager::Connection::Connection() : connected(false) { - memset(&format, 0, sizeof(media_format)); } diff --git a/src/apps/mediaplayer/supplier/MediaTrackVideoSupplier.cpp b/src/apps/mediaplayer/supplier/MediaTrackVideoSupplier.cpp index e83c09e0c2..4a29617244 100644 --- a/src/apps/mediaplayer/supplier/MediaTrackVideoSupplier.cpp +++ b/src/apps/mediaplayer/supplier/MediaTrackVideoSupplier.cpp @@ -268,7 +268,7 @@ status_t MediaTrackVideoSupplier::_SwitchFormat(color_space format, uint32 bytesPerRow) { // get the encoded format - memset(&fFormat, 0, sizeof(media_format)); + fFormat.Clear(); status_t ret = fVideoTrack->EncodedFormat(&fFormat); if (ret < B_OK) { printf("MediaTrackVideoSupplier::_SwitchFormat() - " @@ -349,7 +349,7 @@ MediaTrackVideoSupplier::_SetDecodedFormat(uint32 width, uint32 height, { // specifiy the decoded format. we derive this information from // the encoded format (width & height). - memset(&fFormat, 0, sizeof(media_format)); + fFormat.Clear(); // fFormat.u.raw_video.last_active = height - 1; // fFormat.u.raw_video.orientation = B_VIDEO_TOP_LEFT_RIGHT; // fFormat.u.raw_video.pixel_width_aspect = 1;