ini: first implementation
[platform/core/uifw/libtdm.git] / tools / buffers.c
index 805383b..8b04b41 100644 (file)
@@ -37,8 +37,6 @@
 #include <tbm_bufmgr.h>
 #include <tbm_surface.h>
 
-#include <tdm_log.h>
-#include "tdm_macro.h"
 #include "buffers.h"
 
 #define ALPHA_VALUE  100
@@ -159,7 +157,7 @@ unsigned int format_fourcc(const char *name)
  */
 
 struct color_rgb24 {
-       unsigned int value: 24;
+       unsigned int value:24;
 } __attribute__((__packed__));
 
 struct color_yuv {
@@ -169,7 +167,7 @@ struct color_yuv {
 };
 
 #define MAKE_YUV_601_Y(r, g, b) \
-       ((( 66 * (r) + 129 * (g) +  25 * (b) + 128) >> 8) + 16)
+       (((66 * (r) + 129 * (g) +  25 * (b) + 128) >> 8) + 16)
 #define MAKE_YUV_601_U(r, g, b) \
        (((-38 * (r) -  74 * (g) + 112 * (b) + 128) >> 8) + 128)
 #define MAKE_YUV_601_V(r, g, b) \
@@ -585,9 +583,8 @@ fill_smpte_rgb32(const struct rgb_info *rgb, unsigned char *mem,
                        ((uint32_t *)mem)[x] =
                                colors_bottom[(x - width * 5 / 7) * 3
                                                          / (width / 7) + 4];
-               for (; x < width; ++x) {
+               for (; x < width; ++x)
                        ((uint32_t *)mem)[x] = (rand_r(&rand_seed) % 2) ? MAKE_RGBA(rgb, 255, 255, 255, ALPHA_VALUE) : MAKE_RGBA(rgb, 0, 0, 0, ALPHA_VALUE);
-               }
                mem += stride;
        }
 }
@@ -945,7 +942,7 @@ tdm_test_buffer_fill(tbm_surface_h buffer, int pattern)
                rand_seed = time(NULL);
 
        ret = tbm_surface_map(buffer, TBM_OPTION_WRITE, &info);
-       TDM_EXIT_IF_FAIL(ret == 0);
+       assert(ret == 0);
 
        plane[0] = info.planes[0].ptr;
        plane[1] = info.planes[1].ptr;