Fix compile errors in ViE with latest clang.
Rolling to the latest Chromium picks up a new clang, which catches a fresh error:
error: 'reinterpret_cast' to class 'webrtc::VideoEngineImpl *' from its base at non-zero offset 'webrtc::VideoEngine *' behaves differently from 'static_cast' [-Werror,-Wreinterpret-base-class]
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../webrtc/video_engine/vie_codec_impl.cc:36:31: note: use 'static_cast' to adjust the pointer correctly while downcasting
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
^~~~~~~~~~~~~~~~
static_cast
This was triggered by André's change here:
https://code.google.com/p/webrtc/source/detail?r=3986
which made VideoEngineImpl a derived class of VideoEngine (good).
Picked up one other error as well:
error: implicit conversion from 'long' to 'int' changes value from 9223372036854775807 to -1 [-Werror,-Wconstant-conversion]
AutoTestSleep(std::numeric_limits<long>::max());
~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fixes the errors and is required before stable can be rolled in Chromium.
TBR=mflodman,andresp
Review URL: https://webrtc-codereview.appspot.com/1450004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3989 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
c6a3755ada
commit
d72262dc01
@ -578,7 +578,7 @@ int ViEAutoTest::ViECustomCall() {
|
||||
"Keep the call running indefinitely\n")
|
||||
.WithDefault("Keep the call running indefinitely").Choose();
|
||||
if (selection == 3) {
|
||||
AutoTestSleep(std::numeric_limits<long>::max());
|
||||
AutoTestSleep(std::numeric_limits<int>::max());
|
||||
}
|
||||
|
||||
while (selection == 2) {
|
||||
|
||||
@ -35,7 +35,7 @@ ViEBase* ViEBase::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViEBaseImpl* vie_base_impl = vie_impl;
|
||||
(*vie_base_impl)++; // Increase ref count.
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ ViECapture* ViECapture::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViECaptureImpl* vie_capture_impl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_capture_impl)++;
|
||||
|
||||
@ -33,7 +33,7 @@ ViECodec* ViECodec::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViECodecImpl* vie_codec_impl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_codec_impl)++;
|
||||
|
||||
@ -25,7 +25,7 @@ ViEEncryption* ViEEncryption::GetInterface(VideoEngine* video_engine) {
|
||||
if (video_engine == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViEEncryptionImpl* vie_encryption_impl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_encryption_impl)++;
|
||||
|
||||
@ -26,7 +26,7 @@ ViEExternalCodec* ViEExternalCodec::GetInterface(VideoEngine* video_engine) {
|
||||
if (video_engine == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViEExternalCodecImpl* vie_external_codec_impl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_external_codec_impl)++;
|
||||
|
||||
@ -28,7 +28,7 @@ ViEImageProcess* ViEImageProcess::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViEImageProcessImpl* vie_image_process_impl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_image_process_impl)++;
|
||||
|
||||
@ -32,7 +32,7 @@ bool VideoEngine::Delete(VideoEngine*& video_engine) {
|
||||
}
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo, kModuleId,
|
||||
"VideoEngine::Delete(vie = 0x%p)", video_engine);
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
|
||||
// Check all reference counters.
|
||||
ViEBaseImpl* vie_base = vie_impl;
|
||||
|
||||
@ -31,7 +31,7 @@ ViENetwork* ViENetwork::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViENetworkImpl* vie_networkImpl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_networkImpl)++;
|
||||
|
||||
@ -33,7 +33,7 @@ ViERender* ViERender::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViERenderImpl* vie_render_impl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_render_impl)++;
|
||||
|
||||
@ -79,7 +79,7 @@ ViERTP_RTCP* ViERTP_RTCP::GetInterface(VideoEngine* video_engine) {
|
||||
if (!video_engine) {
|
||||
return NULL;
|
||||
}
|
||||
VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
|
||||
VideoEngineImpl* vie_impl = static_cast<VideoEngineImpl*>(video_engine);
|
||||
ViERTP_RTCPImpl* vie_rtpimpl = vie_impl;
|
||||
// Increase ref count.
|
||||
(*vie_rtpimpl)++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user