sdm: Default to C++11 standard and use clang toolchain

- Enable newer C++11 features to be used, including the
  updated standard library.
- Enable better compiler diagnostics with clang.

Change-Id: Ice550e866673ab57228ccb1f6f250e94a536e396
diff --git a/sdm/include/utils/constants.h b/sdm/include/utils/constants.h
index 9ea6e70..a73bce6 100644
--- a/sdm/include/utils/constants.h
+++ b/sdm/include/utils/constants.h
@@ -38,6 +38,7 @@
 #define UINT16(exp) static_cast<uint16_t>(exp)
 #define UINT32(exp) static_cast<uint32_t>(exp)
 #define INT32(exp) static_cast<int32_t>(exp)
+#define UINT64(exp) static_cast<uint64_t>(exp)
 
 #define STRUCT_VAR(struct_name, var_name) \
           struct struct_name var_name; \
diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h
index 5b08129..61c258a 100644
--- a/sdm/include/utils/debug.h
+++ b/sdm/include/utils/debug.h
@@ -60,9 +60,9 @@
     debug_.debug_handler_ = debug_handler;
   }
   static inline DebugHandler* Get() { return debug_.debug_handler_; }
-  static uint32_t GetSimulationFlag();
-  static uint32_t GetHDMIResolution();
-  static uint32_t GetIdleTimeoutMs();
+  static int GetSimulationFlag();
+  static int GetHDMIResolution();
+  static int GetIdleTimeoutMs();
   static bool IsRotatorDownScaleDisabled();
   static bool IsDecimationDisabled();
   static bool IsPartialUpdateEnabled();
@@ -83,7 +83,7 @@
     virtual void BeginTrace(const char */*class_name*/, const char */*function_name*/,
                             const char */*custom_string*/) { }
     virtual void EndTrace() { }
-    virtual DisplayError GetProperty(const char *property_name, int *value) {
+    virtual DisplayError GetProperty(const char */*property_name*/, int */*value*/) {
       return kErrorNotSupported;
     }
   };
diff --git a/sdm/libs/core/Android.mk b/sdm/libs/core/Android.mk
index f9c7df7..3b3f1e7 100644
--- a/sdm/libs/core/Android.mk
+++ b/sdm/libs/core/Android.mk
@@ -6,8 +6,9 @@
 LOCAL_C_INCLUDES              := hardware/qcom/display/sdm/include/ \
                                  $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
 LOCAL_CFLAGS                  := -Wno-missing-field-initializers -Wno-unused-parameter \
-                                 -Wconversion -Wall -Werror \
+                                 -Wall -Werror -std=c++11 -fcolor-diagnostics\
                                  -DLOG_TAG=\"SDM\"
+LOCAL_CLANG                   := true
 LOCAL_HW_INTF_PATH            := fb
 LOCAL_SHARED_LIBRARIES        := libdl libsdmutils
 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index a751b20..cbb238c 100644
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -561,7 +561,6 @@
   HWLayersInfo &layer_info = hw_layers->info;
 
   for (uint32_t i = 0; i < layer_info.count; i++) {
-    Layer& layer = layer_info.stack->layers[layer_info.index[i]];
     HWRotatorSession *hw_rotator_session = &hw_layers->config[i].hw_rotator_session;
 
     if (hw_rotator_session->hw_block_count) {
diff --git a/sdm/libs/core/display_primary.cpp b/sdm/libs/core/display_primary.cpp
index 1b0a552..dd1beed 100644
--- a/sdm/libs/core/display_primary.cpp
+++ b/sdm/libs/core/display_primary.cpp
@@ -247,8 +247,6 @@
 DisplayError DisplayPrimary::SetRefreshRate(uint32_t refresh_rate) {
   SCOPE_LOCK(locker_);
 
-  DisplayError error = kErrorNone;
-
   if (!hw_panel_info_.dynamic_fps) {
     DLOGW("Dynamic fps feature is not supported");
     return kErrorNotSupported;
diff --git a/sdm/libs/core/fb/hw_device.cpp b/sdm/libs/core/fb/hw_device.cpp
index d53ae99..a292835 100644
--- a/sdm/libs/core/fb/hw_device.cpp
+++ b/sdm/libs/core/fb/hw_device.cpp
@@ -215,7 +215,6 @@
     HWPipeInfo *right_pipe = &hw_layers->config[i].right_pipe;
     HWRotatorSession *hw_rotator_session = &hw_layers->config[i].hw_rotator_session;
     bool is_rotator_used = (hw_rotator_session->hw_block_count != 0);
-    mdp_input_layer mdp_layer;
 
     for (uint32_t count = 0; count < 2; count++) {
       HWPipeInfo *pipe_info = (count == 0) ? left_pipe : right_pipe;
@@ -728,7 +727,6 @@
 
 HWDisplayPort HWDevice::GetHWDisplayPort(int device_node) {
   char stringbuffer[kMaxStringLength];
-  DisplayError error = kErrorNone;
   char *line = NULL;
   size_t len = kMaxStringLength;
   ssize_t read;
@@ -767,7 +765,6 @@
 
 HWDisplayMode HWDevice::GetHWDisplayMode(int device_node) {
   char stringbuffer[kMaxStringLength];
-  DisplayError error = kErrorNone;
   char *line = NULL;
   size_t len = kMaxStringLength;
   ssize_t read;
diff --git a/sdm/libs/core/fb/hw_hdmi.cpp b/sdm/libs/core/fb/hw_hdmi.cpp
index 80269e8..6ebd392 100644
--- a/sdm/libs/core/fb/hw_hdmi.cpp
+++ b/sdm/libs/core/fb/hw_hdmi.cpp
@@ -39,24 +39,6 @@
 
 namespace sdm {
 
-static int ParseLine(char *input, char *tokens[], const uint32_t max_token, uint32_t *count) {
-  char *tmp_token = NULL;
-  char *temp_ptr;
-  uint32_t index = 0;
-  const char *delim = ", =\n";
-  if (!input) {
-    return -1;
-  }
-  tmp_token = strtok_r(input, delim, &temp_ptr);
-  while (tmp_token && index < max_token) {
-    tokens[index++] = tmp_token;
-    tmp_token = strtok_r(NULL, delim, &temp_ptr);
-  }
-  *count = index;
-
-  return 0;
-}
-
 static bool MapHDMIDisplayTiming(const msm_hdmi_mode_timing_info *mode,
                                  fb_var_screeninfo *info) {
   if (!mode || !info) {
@@ -245,8 +227,6 @@
 DisplayError HWHDMI::SetDisplayAttributes(uint32_t index) {
   DTRACE_SCOPED();
 
-  DisplayError error = kErrorNone;
-
   // Variable screen info
   STRUCT_VAR(fb_var_screeninfo, vscreeninfo);
   if (ioctl_(device_fd_, FBIOGET_VSCREENINFO, &vscreeninfo) < 0) {
diff --git a/sdm/libs/core/fb/hw_info.cpp b/sdm/libs/core/fb/hw_info.cpp
index c3fb41d..28d798a 100644
--- a/sdm/libs/core/fb/hw_info.cpp
+++ b/sdm/libs/core/fb/hw_info.cpp
@@ -103,7 +103,7 @@
     // parse the line and update information accordingly
     if (!ParseLine(line, tokens, max_count, &token_count)) {
       if (!strncmp(tokens[0], "hw_rev", strlen("hw_rev"))) {
-        hw_resource->hw_revision = atoi(tokens[1]);  // HW Rev, v1/v2
+        hw_resource->hw_revision = UINT32(atoi(tokens[1]));  // HW Rev, v1/v2
       } else if (!strncmp(tokens[0], "rgb_pipes", strlen("rgb_pipes"))) {
         hw_resource->num_rgb_pipe = UINT8(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "vig_pipes", strlen("vig_pipes"))) {
@@ -115,33 +115,33 @@
       } else if (!strncmp(tokens[0], "blending_stages", strlen("blending_stages"))) {
         hw_resource->num_blending_stages = UINT8(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "max_downscale_ratio", strlen("max_downscale_ratio"))) {
-        hw_resource->max_scale_down = atoi(tokens[1]);
+        hw_resource->max_scale_down = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "max_upscale_ratio", strlen("max_upscale_ratio"))) {
-        hw_resource->max_scale_up = atoi(tokens[1]);
+        hw_resource->max_scale_up = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "max_bandwidth_low", strlen("max_bandwidth_low"))) {
-        hw_resource->max_bandwidth_low = atol(tokens[1]);
+        hw_resource->max_bandwidth_low = UINT64(atol(tokens[1]));
       } else if (!strncmp(tokens[0], "max_bandwidth_high", strlen("max_bandwidth_high"))) {
-        hw_resource->max_bandwidth_high = atol(tokens[1]);
+        hw_resource->max_bandwidth_high = UINT64(atol(tokens[1]));
       } else if (!strncmp(tokens[0], "max_mixer_width", strlen("max_mixer_width"))) {
-        hw_resource->max_mixer_width = atoi(tokens[1]);
+        hw_resource->max_mixer_width = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "max_pipe_width", strlen("max_pipe_width"))) {
-        hw_resource->max_pipe_width = atoi(tokens[1]);
+        hw_resource->max_pipe_width = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "max_pipe_bw", strlen("max_pipe_bw"))) {
-        hw_resource->max_pipe_bw = atoi(tokens[1]);
+        hw_resource->max_pipe_bw = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "max_mdp_clk", strlen("max_mdp_clk"))) {
-        hw_resource->max_sde_clk = atoi(tokens[1]);
+        hw_resource->max_sde_clk = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "clk_fudge_factor", strlen("clk_fudge_factor"))) {
         hw_resource->clk_fudge_factor = FLOAT(atoi(tokens[1])) / FLOAT(atoi(tokens[2]));
       } else if (!strncmp(tokens[0], "fmt_mt_nv12_factor", strlen("fmt_mt_nv12_factor"))) {
-        hw_resource->macrotile_nv12_factor = atoi(tokens[1]);
+        hw_resource->macrotile_nv12_factor = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "fmt_mt_factor", strlen("fmt_mt_factor"))) {
-        hw_resource->macrotile_factor = atoi(tokens[1]);
+        hw_resource->macrotile_factor = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "fmt_linear_factor", strlen("fmt_linear_factor"))) {
-        hw_resource->linear_factor = atoi(tokens[1]);
+        hw_resource->linear_factor = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "scale_factor", strlen("scale_factor"))) {
-        hw_resource->scale_factor = atoi(tokens[1]);
+        hw_resource->scale_factor = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "xtra_ff_factor", strlen("xtra_ff_factor"))) {
-        hw_resource->extra_fudge_factor = atoi(tokens[1]);
+        hw_resource->extra_fudge_factor = UINT32(atoi(tokens[1]));
       } else if (!strncmp(tokens[0], "features", strlen("features"))) {
         for (uint32_t i = 0; i < token_count; i++) {
           if (!strncmp(tokens[i], "bwc", strlen("bwc"))) {
@@ -172,9 +172,9 @@
         hw_resource->has_decimation, hw_resource->has_macrotile,
         hw_resource->has_rotator_downscale);
   DLOGI("SourceSplit = %d", hw_resource->is_src_split);
-  DLOGI("MaxLowBw = %"PRIu64", MaxHighBw = %"PRIu64"", hw_resource->max_bandwidth_low,
+  DLOGI("MaxLowBw = %" PRIu64 " , MaxHighBw = % " PRIu64 "", hw_resource->max_bandwidth_low,
         hw_resource->max_bandwidth_high);
-  DLOGI("MaxPipeBw = %"PRIu64" KBps, MaxSDEClock = %"PRIu64" Hz, ClockFudgeFactor = %f",
+  DLOGI("MaxPipeBw = %" PRIu64 " KBps, MaxSDEClock = % " PRIu64 " Hz, ClockFudgeFactor = %f",
         hw_resource->max_pipe_bw, hw_resource->max_sde_clk, hw_resource->clk_fudge_factor);
   DLOGI("Prefill factors: Tiled_NV12 = %d, Tiled = %d, Linear = %d, Scale = %d, Fudge_factor = %d",
         hw_resource->macrotile_nv12_factor, hw_resource->macrotile_factor,
diff --git a/sdm/libs/core/fb/hw_primary.cpp b/sdm/libs/core/fb/hw_primary.cpp
index 5cb7f8b..5c79475 100644
--- a/sdm/libs/core/fb/hw_primary.cpp
+++ b/sdm/libs/core/fb/hw_primary.cpp
@@ -471,7 +471,6 @@
 }
 
 DisplayError HWPrimary::SetDisplayMode(const HWDisplayMode hw_display_mode) {
-  DisplayError error = kErrorNone;
   uint32_t mode = -1;
 
   switch (hw_display_mode) {
diff --git a/sdm/libs/core/resource_default.cpp b/sdm/libs/core/resource_default.cpp
index 783b621..2e19493 100644
--- a/sdm/libs/core/resource_default.cpp
+++ b/sdm/libs/core/resource_default.cpp
@@ -295,7 +295,6 @@
                           reinterpret_cast<DisplayResourceContext *>(display_ctx);
   HWBlockType hw_block_id = display_resource_ctx->hw_block_id;
   uint64_t frame_count = display_resource_ctx->frame_count;
-  DisplayError error = kErrorNone;
 
   DLOGV_IF(kTagResources, "Resource for hw_block = %d, frame_count = %d", hw_block_id, frame_count);
 
@@ -457,8 +456,6 @@
   HWPipeInfo *right_pipe = &layer_config->right_pipe;
   float src_width = src_rect.right - src_rect.left;
   float dst_width = dst_rect.right - dst_rect.left;
-  float src_height = src_rect.bottom - src_rect.top;
-  float dst_height = dst_rect.bottom - dst_rect.top;
   float left_mixer_width = FLOAT(display_attributes.split_left);
 
   // Layer cannot qualify for SrcSplit if source or destination width exceeds max pipe width.
@@ -533,11 +530,8 @@
 
 DisplayError ResourceDefault::Config(DisplayResourceContext *display_resource_ctx,
                                 HWLayers *hw_layers) {
-  HWDisplayAttributes &display_attributes = display_resource_ctx->display_attributes;
   HWLayersInfo &layer_info = hw_layers->info;
   DisplayError error = kErrorNone;
-  uint32_t z_order = 0;
-
   Layer& layer = layer_info.stack->layers[layer_info.index[0]];
 
   error = ValidateLayerDimensions(layer);
diff --git a/sdm/libs/hwc/Android.mk b/sdm/libs/hwc/Android.mk
index 56992d4..1b199e2 100644
--- a/sdm/libs/hwc/Android.mk
+++ b/sdm/libs/hwc/Android.mk
@@ -11,8 +11,9 @@
                                  hardware/qcom/display/libcopybit/
 
 LOCAL_CFLAGS                  := -Wno-missing-field-initializers -Wno-unused-parameter \
-                                 -Wconversion -Wall -Werror \
+                                 -Wall -Werror -std=c++11 -fcolor-diagnostics\
                                  -DLOG_TAG=\"SDM\"
+LOCAL_CLANG                   := true
 
 # TODO: Move this to the common makefile
 ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
diff --git a/sdm/libs/hwc/hwc_buffer_allocator.cpp b/sdm/libs/hwc/hwc_buffer_allocator.cpp
index d0fdc8c..3e4a1aa 100644
--- a/sdm/libs/hwc/hwc_buffer_allocator.cpp
+++ b/sdm/libs/hwc/hwc_buffer_allocator.cpp
@@ -56,7 +56,7 @@
     return kErrorMemory;
   }
 
-  int alloc_flags = GRALLOC_USAGE_PRIVATE_IOMMU_HEAP;
+  int alloc_flags = INT(GRALLOC_USAGE_PRIVATE_IOMMU_HEAP);
   int error = 0;
 
   int width = INT(buffer_config.width);
@@ -64,8 +64,8 @@
   int format;
 
   if (buffer_config.secure) {
-    alloc_flags = GRALLOC_USAGE_PRIVATE_MM_HEAP;
-    alloc_flags |= GRALLOC_USAGE_PROTECTED;
+    alloc_flags = INT(GRALLOC_USAGE_PRIVATE_MM_HEAP);
+    alloc_flags |= INT(GRALLOC_USAGE_PROTECTED);
     data.align = SECURE_ALIGN;
   } else {
     data.align = getpagesize();
diff --git a/sdm/libs/hwc/hwc_display.cpp b/sdm/libs/hwc/hwc_display.cpp
index 7b2766c..d8eb251 100644
--- a/sdm/libs/hwc/hwc_display.cpp
+++ b/sdm/libs/hwc/hwc_display.cpp
@@ -475,10 +475,8 @@
   // Configure each layer
   for (size_t i = 0; i < num_hw_layers; i++) {
     hwc_layer_1_t &hwc_layer = content_list->hwLayers[i];
-    const private_handle_t *pvt_handle = static_cast<const private_handle_t *>(hwc_layer.handle);
 
     Layer &layer = layer_stack_.layers[i];
-    LayerBuffer *layer_buffer = layer.input_buffer;
 
     ret = PrepareLayerParams(&content_list->hwLayers[i], &layer_stack_.layers[i],
                              active_config.fps);
@@ -1114,7 +1112,7 @@
 
   int count = INT(sizeof(standard_fps) / sizeof(standard_fps[0]));
   for (int i = 0; i < count; i++) {
-    if (abs(standard_fps[i] - fps) < 2) {
+    if ((standard_fps[i] - fps) < 2) {
       // Most likely used for video, the fps can fluctuate
       // Ex: b/w 29 and 30 for 30 fps clip
       return standard_fps[i];
diff --git a/sdm/libs/hwc/hwc_display_external.cpp b/sdm/libs/hwc/hwc_display_external.cpp
index d40602e..01ed9fe 100644
--- a/sdm/libs/hwc/hwc_display_external.cpp
+++ b/sdm/libs/hwc/hwc_display_external.cpp
@@ -48,7 +48,6 @@
                                HWCDisplay **hwc_display) {
   uint32_t external_width = 0;
   uint32_t external_height = 0;
-  char property[PROPERTY_VALUE_MAX];
 
   HWCDisplay *hwc_display_external = new HWCDisplayExternal(core_intf, hwc_procs);
   int status = hwc_display_external->Init();
diff --git a/sdm/libs/hwc/hwc_display_primary.cpp b/sdm/libs/hwc/hwc_display_primary.cpp
index 8ac8389..aeeee9f 100644
--- a/sdm/libs/hwc/hwc_display_primary.cpp
+++ b/sdm/libs/hwc/hwc_display_primary.cpp
@@ -43,7 +43,6 @@
   int status = 0;
   uint32_t primary_width = 0;
   uint32_t primary_height = 0;
-  char property[PROPERTY_VALUE_MAX];
 
   HWCDisplay *hwc_display_primary = new HWCDisplayPrimary(core_intf, hwc_procs);
   status = hwc_display_primary->Init();
@@ -140,7 +139,7 @@
   return 0;
 }
 
-int HWCDisplayPrimary::SetActiveConfig(uint32_t index) {
+int HWCDisplayPrimary::SetActiveConfig(int index) {
   DisplayError error = kErrorNone;
 
   if (display_intf_) {
diff --git a/sdm/libs/hwc/hwc_display_primary.h b/sdm/libs/hwc/hwc_display_primary.h
index 38175b9..cf9fc57 100644
--- a/sdm/libs/hwc/hwc_display_primary.h
+++ b/sdm/libs/hwc/hwc_display_primary.h
@@ -42,7 +42,7 @@
   static void Destroy(HWCDisplay *hwc_display);
   virtual int Prepare(hwc_display_contents_1_t *content_list);
   virtual int Commit(hwc_display_contents_1_t *content_list);
-  virtual int SetActiveConfig(uint32_t index);
+  virtual int SetActiveConfig(int index);
   virtual int SetRefreshRate(uint32_t refresh_rate);
   virtual int Perform(uint32_t operation, ...);
 
diff --git a/sdm/libs/hwc/hwc_display_virtual.cpp b/sdm/libs/hwc/hwc_display_virtual.cpp
index 15da858..0467fc6 100644
--- a/sdm/libs/hwc/hwc_display_virtual.cpp
+++ b/sdm/libs/hwc/hwc_display_virtual.cpp
@@ -103,7 +103,6 @@
 }
 
 int HWCDisplayVirtual::Init() {
-  int status = 0;
 
   output_buffer_ = new LayerBuffer();
   if (!output_buffer_) {
diff --git a/sdm/libs/hwc/hwc_session.cpp b/sdm/libs/hwc/hwc_session.cpp
index 1d0c5f0..49626db 100644
--- a/sdm/libs/hwc/hwc_session.cpp
+++ b/sdm/libs/hwc/hwc_session.cpp
@@ -57,16 +57,16 @@
 static sdm::HWCSession::HWCModuleMethods g_hwc_module_methods;
 
 hwc_module_t HAL_MODULE_INFO_SYM = {
-  common: {
-    tag: HARDWARE_MODULE_TAG,
-    version_major: 2,
-    version_minor: 0,
-    id: HWC_HARDWARE_MODULE_ID,
-    name: "QTI Hardware Composer Module",
-    author: "CodeAurora Forum",
-    methods: &g_hwc_module_methods,
-    dso: 0,
-    reserved: {0},
+  .common = {
+    .tag = HARDWARE_MODULE_TAG,
+    .version_major = 2,
+    .version_minor = 0,
+    .id = HWC_HARDWARE_MODULE_ID,
+    .name = "QTI Hardware Composer Module",
+    .author = "CodeAurora Forum",
+    .methods = &g_hwc_module_methods,
+    .dso = 0,
+    .reserved = {0},
   }
 };
 
@@ -144,7 +144,7 @@
   }
 
   if (pthread_create(&uevent_thread_, NULL, &HWCUeventThread, this) < 0) {
-    DLOGE("Failed to start = %s, error = %s", uevent_thread_name_);
+    DLOGE("Failed to start = %s, error = %s", uevent_thread_name_, strerror(errno));
     HWCDisplayPrimary::Destroy(hwc_display_[HWC_DISPLAY_PRIMARY]);
     hwc_display_[HWC_DISPLAY_PRIMARY] = 0;
     CoreInterface::DestroyCore();
@@ -227,7 +227,7 @@
     hwc_session->ResetPanel();
   }
 
-  for (ssize_t dpy = (num_displays - 1); dpy >= 0; dpy--) {
+  for (ssize_t dpy = static_cast<ssize_t>(num_displays - 1); dpy >= 0; dpy--) {
     hwc_display_contents_1_t *content_list = displays[dpy];
     if (dpy == HWC_DISPLAY_VIRTUAL) {
       if (hwc_session->hwc_display_[HWC_DISPLAY_EXTERNAL]) {
diff --git a/sdm/libs/utils/Android.mk b/sdm/libs/utils/Android.mk
index 9de5c07..237b48d 100644
--- a/sdm/libs/utils/Android.mk
+++ b/sdm/libs/utils/Android.mk
@@ -4,9 +4,10 @@
 LOCAL_MODULE                  := libsdmutils
 LOCAL_MODULE_TAGS             := optional
 LOCAL_C_INCLUDES              := hardware/qcom/display/sdm/include/
-LOCAL_CFLAGS                  := -Wno-missing-field-initializers -Wno-unused-parameter \
-                                 -Wconversion -Wall -Werror \
+LOCAL_CFLAGS                  := -Wno-missing-field-initializers \
+                                 -Wall -Werror -std=c++11 -fcolor-diagnostics\
                                  -DLOG_TAG=\"SDM\"
+LOCAL_CLANG                   := true
 LOCAL_SRC_FILES               := debug.cpp rect.cpp
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp
index cd7533b..8676546 100644
--- a/sdm/libs/utils/debug.cpp
+++ b/sdm/libs/utils/debug.cpp
@@ -38,21 +38,21 @@
 Debug::Debug() : debug_handler_(&default_debug_handler_) {
 }
 
-uint32_t Debug::GetSimulationFlag() {
+int Debug::GetSimulationFlag() {
   int value = 0;
   debug_.debug_handler_->GetProperty("sdm.composition_simulation", &value);
 
   return value;
 }
 
-uint32_t Debug::GetHDMIResolution() {
+int Debug::GetHDMIResolution() {
   int value = 0;
   debug_.debug_handler_->GetProperty("hw.hdmi.resolution", &value);
 
   return value;
 }
 
-uint32_t Debug::GetIdleTimeoutMs() {
+int Debug::GetIdleTimeoutMs() {
   int value = IDLE_TIMEOUT_DEFAULT_MS;
   debug_.debug_handler_->GetProperty("sdm.idle_time", &value);