tbm_surface_internal: change tbm_surface_internal_get_size() return type 46/95246/1
authorYoungJun Cho <yj44.cho@samsung.com>
Wed, 2 Nov 2016 13:39:29 +0000 (22:39 +0900)
committerYoungJun Cho <yj44.cho@samsung.com>
Wed, 2 Nov 2016 13:39:29 +0000 (22:39 +0900)
This patch changes tbm_surface_internal_get_size() return type
from int to unsigned int.
The type of size in _tbm_surface_info is uint32_t and this function returns it.

Change-Id: I72a3ae9cda8e77a49e36122d19ae9ca8353cc674
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
src/tbm_surface_internal.c
src/tbm_surface_internal.h
ut/src/ut_tbm_surface_internal.cpp

index e5f3243..d915d59 100644 (file)
@@ -940,7 +940,7 @@ tbm_surface_internal_get_bo(tbm_surface_h surface, int bo_idx)
        return bo;
 }
 
-int
+unsigned int
 tbm_surface_internal_get_size(tbm_surface_h surface)
 {
        struct _tbm_surface *surf;
@@ -953,7 +953,7 @@ tbm_surface_internal_get_size(tbm_surface_h surface)
        surf = (struct _tbm_surface *)surface;
        size = surf->info.size;
 
-       TBM_TRACE("tbm_surface(%p) size(%d)\n", surface, size);
+       TBM_TRACE("tbm_surface(%p) size(%u)\n", surface, size);
 
        _tbm_surface_mutex_unlock();
 
@@ -988,7 +988,7 @@ tbm_surface_internal_get_plane_data(tbm_surface_h surface, int plane_idx,
        if (pitch)
                *pitch = surf->info.planes[plane_idx].stride;
 
-       TBM_TRACE("tbm_surface(%p) plane_idx(%d) size(%d) offset(%d) pitch(%d)\n", surface, plane_idx,
+       TBM_TRACE("tbm_surface(%p) plane_idx(%d) size(%u) offset(%u) pitch(%u)\n", surface, plane_idx,
                                surf->info.planes[plane_idx].size, surf->info.planes[plane_idx].offset,
                                surf->info.planes[plane_idx].stride);
 
@@ -1090,7 +1090,7 @@ tbm_surface_internal_get_width(tbm_surface_h surface)
        surf = (struct _tbm_surface *)surface;
        width = surf->info.width;
 
-       TBM_TRACE("tbm_surface(%p) width(%d)\n", surface, width);
+       TBM_TRACE("tbm_surface(%p) width(%u)\n", surface, width);
 
        _tbm_surface_mutex_unlock();
 
@@ -1110,7 +1110,7 @@ tbm_surface_internal_get_height(tbm_surface_h surface)
        surf = (struct _tbm_surface *)surface;
        height = surf->info.height;
 
-       TBM_TRACE("tbm_surface(%p) height(%d)\n", surface, height);
+       TBM_TRACE("tbm_surface(%p) height(%u)\n", surface, height);
 
        _tbm_surface_mutex_unlock();
 
@@ -1743,7 +1743,7 @@ tbm_surface_internal_dump_buffer(tbm_surface_h surface, const char *type)
        TBM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE);
 
        if (info.size > buf_info->size) {
-               TBM_LOG_W("Dump skip. surface over created buffer size(%d, %d)\n", info.size, buf_info->size);
+               TBM_LOG_W("Dump skip. surface over created buffer size(%u, %d)\n", info.size, buf_info->size);
                tbm_surface_unmap(surface);
                return;
        }
index d836774..55a249f 100644 (file)
@@ -231,7 +231,7 @@ tbm_bo tbm_surface_internal_get_bo(tbm_surface_h surface, int bo_idx);
  * @brief Gets the size of the surface.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] surface : the tbm_surface_h
- * @return the size of tbm_surface, otherwise -1.
+ * @return the size of tbm_surface, otherwise 0.
  * @par Example
    @code
    #include <tbm_surface.h>
@@ -246,7 +246,7 @@ tbm_bo tbm_surface_internal_get_bo(tbm_surface_h surface, int bo_idx);
    tbm_surface_destroy (surface);
    @endcode
  */
-int tbm_surface_internal_get_size(tbm_surface_h surface);
+unsigned int tbm_surface_internal_get_size(tbm_surface_h surface);
 
 /**
  * @brief Gets size, offset and pitch data of plane by the plane_index.
index 719e434..2d48a11 100644 (file)
@@ -1021,8 +1021,8 @@ TEST(tbm_surface_internal_get_plane_data, null_ptr_fail_1)
 
 TEST(tbm_surface_internal_get_size, work_flow_success_2)
 {
-       int actual_size = 0;
-       int expected_size = 1024;
+       unsigned int actual_size = 0;
+       unsigned int expected_size = 1024;
        struct _tbm_surface surface;
        struct _tbm_bufmgr bufmgr;
 
@@ -1041,8 +1041,8 @@ TEST(tbm_surface_internal_get_size, work_flow_success_2)
 
 TEST(tbm_surface_internal_get_size, work_flow_success_1)
 {
-       int actual_size = 0;
-       int expected_size = 0;
+       unsigned int actual_size = 0;
+       unsigned int expected_size = 0;
        struct _tbm_surface surface;
        struct _tbm_bufmgr bufmgr;
 
@@ -1058,8 +1058,8 @@ TEST(tbm_surface_internal_get_size, work_flow_success_1)
 
 TEST(tbm_surface_internal_get_size, null_ptr_fail_1)
 {
-       int actual_size = 0;
-       int expected_size = 0;
+       unsigned int actual_size = 0;
+       unsigned int expected_size = 0;
 
        _init_test();