From 73dab7a8c4c6ac33d8697936183797eba0f07233 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 14 Nov 2019 14:37:16 +0900 Subject: [PATCH] Fix svace & coverity issues Change-Id: I2e03bef398add9124d6aea61a4a373736daa6c82 --- .../tizen-wayland/input-method-context-impl-ecore-wl.cpp | 2 +- dali/internal/system/common/time-service.cpp | 13 +++++++++---- .../text/text-abstraction/font-client-plugin-impl.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index 7a9d4ae..1d7be3e 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -650,7 +650,7 @@ bool InputMethodContextEcoreWl::RetrieveSurrounding( void* data, ImfContext* imf *text = strdup( plainText ); // If the current input panel is password mode, dali should replace the plain text with '*' (Asterisk) character. - if( ecore_imf_context_input_hint_get( mIMFContext ) & ECORE_IMF_INPUT_HINT_SENSITIVE_DATA ) + if( ( ecore_imf_context_input_hint_get( mIMFContext ) & ECORE_IMF_INPUT_HINT_SENSITIVE_DATA ) && *text ) { for( char* iter = *text; *iter; ++iter ) { diff --git a/dali/internal/system/common/time-service.cpp b/dali/internal/system/common/time-service.cpp index e0b35b2..aa310b7 100644 --- a/dali/internal/system/common/time-service.cpp +++ b/dali/internal/system/common/time-service.cpp @@ -41,10 +41,15 @@ const uint64_t NANOSECONDS_PER_SECOND = 1e+9; void GetNanoseconds( uint64_t& timeInNanoseconds ) { timespec timeSpec; - clock_gettime( CLOCK_MONOTONIC, &timeSpec ); - - // Convert all values to uint64_t to match our return type - timeInNanoseconds = ( static_cast< uint64_t >( timeSpec.tv_sec ) * NANOSECONDS_PER_SECOND ) + static_cast< uint64_t >( timeSpec.tv_nsec ); + if( clock_gettime( CLOCK_MONOTONIC, &timeSpec ) == 0 ) + { + // Convert all values to uint64_t to match our return type + timeInNanoseconds = ( static_cast< uint64_t >( timeSpec.tv_sec ) * NANOSECONDS_PER_SECOND ) + static_cast< uint64_t >( timeSpec.tv_nsec ); + } + else + { + timeInNanoseconds = 0; + } } void SleepUntil( uint64_t timeInNanoseconds ) diff --git a/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp b/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp index 8bae462..11d9087 100755 --- a/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp +++ b/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp @@ -1463,7 +1463,7 @@ void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, boo { if( glyph->format != FT_GLYPH_FORMAT_BITMAP ) { - int offsetX, offsetY; + int offsetX = 0, offsetY = 0; bool isOutlineGlyph = ( glyph->format == FT_GLYPH_FORMAT_OUTLINE && outlineWidth > 0 ); // Create a bitmap for the outline -- 2.7.4