Media server: 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: If905db6c0b7d759e72cfa649951be5109f952f54
Reviewed-on: https://review.haiku-os.org/485
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
This commit is contained in:
Murai Takashi 2018-05-19 11:44:02 +09:00 committed by Barrett17
parent 7f8a5c09b8
commit bd4813fcc3

View File

@ -462,7 +462,6 @@ DefaultManager::_FindPhysical(volatile media_node_id *id, uint32 default_type,
} }
} }
memset(&format, 0, sizeof(format));
format.type = type; format.type = type;
count = MAX_NODE_INFOS; count = MAX_NODE_INFOS;
rv = fRoster->GetLiveNodes(&info[0], &count, rv = fRoster->GetLiveNodes(&info[0], &count,
@ -563,7 +562,6 @@ DefaultManager::_FindTimeSource()
/* Now try to find another physical audio out node /* Now try to find another physical audio out node
*/ */
memset(&input, 0, sizeof(input));
input.type = B_MEDIA_RAW_AUDIO; input.type = B_MEDIA_RAW_AUDIO;
count = MAX_NODE_INFOS; count = MAX_NODE_INFOS;
rv = fRoster->GetLiveNodes(&info[0], &count, &input, NULL, NULL, rv = fRoster->GetLiveNodes(&info[0], &count, &input, NULL, NULL,
@ -694,7 +692,7 @@ DefaultManager::_ConnectMixerToOutput()
case 1: case 1:
TRACE("DefaultManager: Trying connect in format 1\n"); TRACE("DefaultManager: Trying connect in format 1\n");
memset(&format, 0, sizeof(format)); format.Clear();
format.type = B_MEDIA_RAW_AUDIO; format.type = B_MEDIA_RAW_AUDIO;
format.u.raw_audio.frame_rate = 44100; format.u.raw_audio.frame_rate = 44100;
format.u.raw_audio.channel_count = 2; format.u.raw_audio.channel_count = 2;
@ -703,7 +701,7 @@ DefaultManager::_ConnectMixerToOutput()
case 2: case 2:
TRACE("DefaultManager: Trying connect in format 2\n"); TRACE("DefaultManager: Trying connect in format 2\n");
memset(&format, 0, sizeof(format)); format.Clear();
format.type = B_MEDIA_RAW_AUDIO; format.type = B_MEDIA_RAW_AUDIO;
format.u.raw_audio.frame_rate = 48000; format.u.raw_audio.frame_rate = 48000;
format.u.raw_audio.channel_count = 2; format.u.raw_audio.channel_count = 2;
@ -712,7 +710,7 @@ DefaultManager::_ConnectMixerToOutput()
case 3: case 3:
TRACE("DefaultManager: Trying connect in format 3\n"); TRACE("DefaultManager: Trying connect in format 3\n");
memset(&format, 0, sizeof(format)); format.Clear();
format.type = B_MEDIA_RAW_AUDIO; format.type = B_MEDIA_RAW_AUDIO;
break; break;
@ -727,7 +725,7 @@ DefaultManager::_ConnectMixerToOutput()
case 5: case 5:
TRACE("DefaultManager: Trying connect in format 4\n"); TRACE("DefaultManager: Trying connect in format 4\n");
memset(&format, 0, sizeof(format)); format.Clear();
break; break;
} }