From 3b546caeb0a576c4d7d7f1e8d2fdfed2bb8bdeed Mon Sep 17 00:00:00 2001 From: synergydev Date: Fri, 25 Oct 2013 12:36:28 -0700 Subject: Fix c++11 narrowing The best fix for these narrowing violations is to use static casting As an example, this change would the following for libnaio: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to 'long' in initializer list const struct timespec req = {0, ns}; ^~ Change-Id: I04ed1de4497dc19772194afef3ebf8fe0c8b82bc --- libvideoeditor/lvpp/VideoEditorPreviewController.cpp | 4 ++-- libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp | 8 ++++---- .../vss/stagefrightshells/src/VideoEditorAudioDecoder.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'libvideoeditor') diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp index 149c4ea..c3cd3d0 100755 --- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp +++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp @@ -1248,7 +1248,7 @@ void VideoEditorPreviewController::notify( case MEDIA_SET_VIDEO_SIZE: ALOGV("MEDIA_SET_VIDEO_SIZE; New video size %d x %d", ext1, ext2); break; - case 0xAAAAAAAA: + case static_cast(0xAAAAAAAA): ALOGV("VIDEO PLAYBACK ALMOST over, prepare next player"); // Select next player and prepare it // If there is a clip after this one @@ -1268,7 +1268,7 @@ void VideoEditorPreviewController::notify( } } break; - case 0xBBBBBBBB: + case static_cast(0xBBBBBBBB): { ALOGV("VIDEO PLAYBACK, Update Overlay"); int overlayIndex = ext2; diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp index 3c8915a..99cf9ec 100755 --- a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp +++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp @@ -776,16 +776,16 @@ M4OSA_ERR VideoEditor3gpReader_setOption(M4OSA_Context context, case M4READER_kOptionID_SetOsaFileReaderFctsPtr: break; - case M4READER_3GP_kOptionID_AudioOnly: + case static_cast(M4READER_3GP_kOptionID_AudioOnly): break; - case M4READER_3GP_kOptionID_VideoOnly: + case static_cast(M4READER_3GP_kOptionID_VideoOnly): break; - case M4READER_3GP_kOptionID_FastOpenMode: + case static_cast(M4READER_3GP_kOptionID_FastOpenMode): break; - case M4READER_kOptionID_MaxMetadataSize: + case static_cast(M4READER_kOptionID_MaxMetadataSize): break; default: diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioDecoder.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioDecoder.cpp index 9b35d07..e4c7ea1 100755 --- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioDecoder.cpp +++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorAudioDecoder.cpp @@ -809,7 +809,7 @@ M4OSA_ERR VideoEditorAudioDecoder_setOption(M4AD_Context pContext, pDecoderContext = (VideoEditorAudioDecoder_Context*)pContext; switch( optionID ) { - case M4AD_kOptionID_UserParam: + case static_cast(M4AD_kOptionID_UserParam): ALOGV("VideoEditorAudioDecodersetOption UserParam is not supported"); err = M4ERR_NOT_IMPLEMENTED; break; -- cgit v1.1