From 1c44c129755a129a45d4d59e54ac482a58d64f62 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Wed, 11 Jan 2017 19:38:22 +0900 Subject: [PATCH] apply tizen coding rule Change-Id: I22de70e36d516c2c4dce32642945e46c64477573 --- client/tdm_client.c | 2 +- src/tdm.c | 10 +++++----- src/tdm_buffer.c | 2 +- src/tdm_capture.c | 2 +- src/tdm_display.c | 4 ++-- src/tdm_helper.c | 28 +++++++++++++--------------- src/tdm_monitor_server.c | 5 ++--- src/tdm_pp.c | 2 +- src/tdm_server.c | 6 +++--- src/tdm_vblank.c | 10 +++++----- tools/tdm_test_client.c | 4 ++-- tools/tdm_test_server.c | 12 ++++++------ 12 files changed, 42 insertions(+), 45 deletions(-) diff --git a/client/tdm_client.c b/client/tdm_client.c index 7e17d1e..c9b312c 100644 --- a/client/tdm_client.c +++ b/client/tdm_client.c @@ -852,4 +852,4 @@ tdm_client_vblank_wait_seq(tdm_client_vblank *vblank, unsigned int sequence, free(w); return TDM_ERROR_NONE; -} \ No newline at end of file +} diff --git a/src/tdm.c b/src/tdm.c index 5d2714c..c6023a2 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -1110,7 +1110,7 @@ tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_s if (!strncmp(arg, "none", 4)) { tdm_debug_dump = 0; - TDM_SNPRINTF(reply, len, "path: %s\n", (tdm_debug_dump_dir)?:"unknown"); + TDM_SNPRINTF(reply, len, "path: %s\n", (tdm_debug_dump_dir) ? : "unknown"); if (tdm_debug_dump_dir) { free(tdm_debug_dump_dir); tdm_debug_dump_dir = NULL; @@ -1257,9 +1257,9 @@ tdm_display_enable_ttrace_vblank(tdm_display *dpy, tdm_output *output, int enabl return TDM_ERROR_NONE; enable_fail: - if (vblank) - tdm_vblank_destroy(vblank); - vblank = NULL; - return ret; + if (vblank) + tdm_vblank_destroy(vblank); + vblank = NULL; + return ret; } diff --git a/src/tdm_buffer.c b/src/tdm_buffer.c index e691507..e3f4107 100644 --- a/src/tdm_buffer.c +++ b/src/tdm_buffer.c @@ -223,7 +223,7 @@ tdm_buffer_unref_backend(tbm_surface_h buffer) tbm_surface_internal_ref(buffer); LIST_FOR_EACH_ENTRY_SAFE(func_info, next, &buf_info->release_funcs, link) - func_info->release_func(buffer, func_info->user_data); + func_info->release_func(buffer, func_info->user_data); tbm_surface_internal_unref(buffer); tbm_surface_internal_unref(buffer); diff --git a/src/tdm_capture.c b/src/tdm_capture.c index a422914..4772332 100644 --- a/src/tdm_capture.c +++ b/src/tdm_capture.c @@ -494,7 +494,7 @@ tdm_capture_attach(tdm_capture *capture, tbm_surface_h buffer) } } - capture_buffer = calloc(1, sizeof *capture_buffer); + capture_buffer = calloc(1, sizeof * capture_buffer); if (!capture_buffer) { _pthread_mutex_unlock(&private_display->lock); TDM_ERR("alloc failed"); diff --git a/src/tdm_display.c b/src/tdm_display.c index 935824e..9cfd290 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -1280,7 +1280,7 @@ tdm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value) if (!private_output->dpms_changed_timer) { private_output->dpms_changed_timer = tdm_event_loop_add_timer_handler(private_output->private_display, - _tdm_output_dpms_changed_timeout, private_output, NULL); + _tdm_output_dpms_changed_timeout, private_output, NULL); if (!private_output->dpms_changed_timer) { TDM_ERR("can't create dpms timer!!"); _pthread_mutex_unlock(&private_display->lock); @@ -1301,7 +1301,7 @@ tdm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value) if (!private_output->regist_dpms_cb) { private_output->regist_dpms_cb = 1; ret = func_output->output_set_dpms_handler(private_output->output_backend, - tdm_output_cb_dpms, private_output); + tdm_output_cb_dpms, private_output); } } diff --git a/src/tdm_helper.c b/src/tdm_helper.c index 9b31d68..a72f3eb 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -191,7 +191,7 @@ tdm_helper_dump_make_directory(const char *path, char *reply, int *len) TDM_GOTO_IF_FAIL(t != NULL, failed_make); snprintf(fullpath, TDM_PATH_LEN, "%s/dump_%04d%02d%02d.%02d%02d%02d", path, - t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); + t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); if ((mkdir(fullpath, 0755)) < 0) { TDM_ERR("mkdir '%s' fail\n", fullpath); @@ -457,15 +457,15 @@ tdm_helper_convert_buffer(tbm_surface_h srcbuf, tbm_surface_h dstbuf, if (rotate_step > 0) { int c, s, tx = 0, ty = 0; switch (rotate_step) { - case 1: - c = 0, s = -1, tx = -dstpos->w; - break; - case 2: - c = -1, s = 0, tx = -dstpos->w, ty = -dstpos->h; - break; - case 3: - c = 0, s = 1, ty = -dstpos->h; - break; + case 1: + c = 0, s = -1, tx = -dstpos->w; + break; + case 2: + c = -1, s = 0, tx = -dstpos->w, ty = -dstpos->h; + break; + case 3: + c = 0, s = 1, ty = -dstpos->h; + break; } pixman_f_transform_translate(&ft, NULL, tx, ty); pixman_f_transform_rotate(&ft, NULL, c, s); @@ -595,14 +595,12 @@ _tdm_helper_buffer_convert(tbm_surface_h srcbuf, tbm_surface_h dstbuf, TDM_RETURN_VAL_IF_FAIL(srcbuf != NULL, TDM_ERROR_INVALID_PARAMETER); TDM_RETURN_VAL_IF_FAIL(dstbuf != NULL, TDM_ERROR_INVALID_PARAMETER); - if (tbm_surface_map(srcbuf, TBM_SURF_OPTION_READ, &src_info) - != TBM_SURFACE_ERROR_NONE) { + if (tbm_surface_map(srcbuf, TBM_SURF_OPTION_READ, &src_info) != TBM_SURFACE_ERROR_NONE) { TDM_ERR("cannot mmap srcbuf\n"); return TDM_ERROR_OPERATION_FAILED; } - if (tbm_surface_map(dstbuf, TBM_SURF_OPTION_WRITE, &dst_info) - != TBM_SURFACE_ERROR_NONE) { + if (tbm_surface_map(dstbuf, TBM_SURF_OPTION_WRITE, &dst_info) != TBM_SURFACE_ERROR_NONE) { TDM_ERR("cannot mmap dstbuf\n"); tbm_surface_unmap(srcbuf); return TDM_ERROR_OPERATION_FAILED; @@ -845,7 +843,7 @@ tdm_helper_get_display_information(tdm_display *dpy, char *reply, int *len) size.v = tbm_surface_get_height(private_layer->showing_buffer); if (info.src_config.format) - format = (info.src_config.format)?:format; + format = (info.src_config.format) ? : format; TDM_SNPRINTF(reply, len, "%d %d %d %p %c%c%c%c %ux%u %ux%u+%u+%u %ux%u+%u+%u %s\n", private_layer->index, diff --git a/src/tdm_monitor_server.c b/src/tdm_monitor_server.c index 2a1b318..55ef89b 100644 --- a/src/tdm_monitor_server.c +++ b/src/tdm_monitor_server.c @@ -124,7 +124,7 @@ _tdm_monitor_server_ttrace_vblank(unsigned int pid, char *cwd, int argc, char *a tdm_display_enable_ttrace_vblank(dpy, output, enable); TDM_SNPRINTF(reply, len, "%s ttrace vblank for '%s'\n", - (enable)?"enable":"disable", tdm_conn_str(type)); + (enable) ? "enable" : "disable", tdm_conn_str(type)); } static void @@ -357,8 +357,7 @@ _tdm_monitor_server_punch(unsigned int pid, char *cwd, int argc, char *argv[], c } tdm_helper_clear_buffer_pos(buffer, &pos); - } - else + } else tdm_helper_clear_buffer(buffer); } diff --git a/src/tdm_pp.c b/src/tdm_pp.c index 3be10d3..02de669 100644 --- a/src/tdm_pp.c +++ b/src/tdm_pp.c @@ -418,7 +418,7 @@ tdm_pp_attach(tdm_pp *pp, tbm_surface_h src, tbm_surface_h dst) tdm_helper_dump_buffer_str(src, tdm_debug_dump_dir, str); } - pp_buffer = calloc(1, sizeof *pp_buffer); + pp_buffer = calloc(1, sizeof * pp_buffer); if (!pp_buffer) { _pthread_mutex_unlock(&private_display->lock); TDM_ERR("alloc failed"); diff --git a/src/tdm_server.c b/src/tdm_server.c index ca1ef40..914b1da 100644 --- a/src/tdm_server.c +++ b/src/tdm_server.c @@ -247,7 +247,7 @@ _tdm_server_vblank_cb_wait_vblank(struct wl_client *client, struct wl_resource * TDM_TRACE_COUNT(ServerWaitVBlank, req_id); - wait_info = calloc(1, sizeof *wait_info); + wait_info = calloc(1, sizeof * wait_info); if (!wait_info) { TDM_ERR("alloc failed"); ret = TDM_ERROR_OUT_OF_MEMORY; @@ -287,7 +287,7 @@ _tdm_server_vblank_cb_wait_vblank_seq(struct wl_client *client, struct wl_resour TDM_TRACE_COUNT(ServerWaitVBlank, req_id); - wait_info = calloc(1, sizeof *wait_info); + wait_info = calloc(1, sizeof * wait_info); if (!wait_info) { TDM_ERR("alloc failed"); ret = TDM_ERROR_OUT_OF_MEMORY; @@ -357,7 +357,7 @@ _tdm_server_output_cb_create_vblank(struct wl_client *client, struct wl_resource return; } - vblank_info = calloc(1, sizeof *vblank_info); + vblank_info = calloc(1, sizeof * vblank_info); if (!vblank_info) { wl_resource_post_no_memory(resource); wl_resource_destroy(vblank_resource); diff --git a/src/tdm_vblank.c b/src/tdm_vblank.c index 8dc85e5..947fcf6 100644 --- a/src/tdm_vblank.c +++ b/src/tdm_vblank.c @@ -296,7 +296,7 @@ _tdm_vblank_cb_output_change(tdm_output *output, tdm_output_change_type type, } } -EXTERN tdm_vblank* +EXTERN tdm_vblank * tdm_vblank_create(tdm_display *dpy, tdm_output *output, tdm_error *error) { tdm_private_vblank *private_vblank; @@ -332,7 +332,7 @@ tdm_vblank_create(tdm_display *dpy, tdm_output *output, tdm_error *error) tdm_output_get_dpms(output, &dpms); - private_vblank = calloc(1, sizeof *private_vblank); + private_vblank = calloc(1, sizeof * private_vblank); if (!private_vblank) { if (error) *error = TDM_ERROR_OUT_OF_MEMORY; @@ -364,7 +364,7 @@ tdm_vblank_create(tdm_display *dpy, tdm_output *output, tdm_error *error) VIN("created. vrefresh(%d) dpms(%d)", private_vblank->vrefresh, private_vblank->dpms); - return (tdm_vblank*)private_vblank; + return (tdm_vblank *)private_vblank; } EXTERN void @@ -498,7 +498,7 @@ _tdm_vblank_sw_timer_update(tdm_private_vblank *private_vblank) if (ms_delay > 5000) VER("wait(%p) curr(%.6f) target(%.6f) ms_delay(%d)", first_wait_info, curr, target, ms_delay); - else if (tdm_debug_module & TDM_DEBUG_VBLANK) + else if (tdm_debug_module & TDM_DEBUG_VBLANK) VIN("wait(%p) curr(%.6f) target(%.6f) ms_delay(%d)", first_wait_info, curr, target, ms_delay); tdm_display_lock(private_vblank->dpy); @@ -828,7 +828,7 @@ tdm_vblank_wait(tdm_vblank *vblank, unsigned int req_sec, unsigned int req_usec, return TDM_ERROR_DPMS_OFF; } - wait_info = calloc(1, sizeof *wait_info); + wait_info = calloc(1, sizeof * wait_info); if (!wait_info) { VER("alloc failed"); return TDM_ERROR_OUT_OF_MEMORY; diff --git a/tools/tdm_test_client.c b/tools/tdm_test_client.c index bb80cc7..fb371f5 100644 --- a/tools/tdm_test_client.c +++ b/tools/tdm_test_client.c @@ -177,10 +177,10 @@ parse_args(tdm_test_client *data, int argc, char *argv[]) data->args.interval = 1; for (i = 1; i < argc; i++) { - if (!strncmp(argv[i]+1, "qo", 2)) { + if (!strncmp(argv[i] + 1, "qo", 2)) { data->do_query = 1; parse_arg_qo(data, argv[++i]); - } else if (!strncmp(argv[i]+1, "v", 1)) { + } else if (!strncmp(argv[i] + 1, "v", 1)) { data->do_vblank = 1; parse_arg_v(data, argv[++i]); } else { diff --git a/tools/tdm_test_server.c b/tools/tdm_test_server.c index d6942a8..1b3854e 100644 --- a/tools/tdm_test_server.c +++ b/tools/tdm_test_server.c @@ -974,9 +974,9 @@ layer_get_buffer(tdm_test_server_layer *l) int i, size = TDM_ARRAY_SIZE(l->bufs); if (!l->bufs[0]) { for (i = 0; i < size; i++) { - int width = (l->info.src_config.size.h)?:l->info.src_config.pos.w; - int height = (l->info.src_config.size.v)?:l->info.src_config.pos.h; - unsigned int format = (l->info.src_config.format)?:DEFAULT_FORMAT; + int width = (l->info.src_config.size.h) ? : l->info.src_config.pos.w; + int height = (l->info.src_config.size.v) ? : l->info.src_config.pos.h; + unsigned int format = (l->info.src_config.format) ? : DEFAULT_FORMAT; int flags = l->o->data->bflags; tbm_surface_h b = buffer_allocate(width, height, format, flags); TDM_EXIT_IF_FAIL(b != NULL); @@ -1109,9 +1109,9 @@ pp_get_buffer(tdm_test_server_pp *p) int i, size = TDM_ARRAY_SIZE(p->bufs); if (!p->bufs[0]) { for (i = 0; i < size; i++) { - int width = (p->info.src_config.size.h)?:p->info.src_config.pos.w; - int height = (p->info.src_config.size.v)?:p->info.src_config.pos.h; - unsigned int format = (p->info.src_config.format)?:DEFAULT_FORMAT; + int width = (p->info.src_config.size.h) ? : p->info.src_config.pos.w; + int height = (p->info.src_config.size.v) ? : p->info.src_config.pos.h; + unsigned int format = (p->info.src_config.format) ? : DEFAULT_FORMAT; tbm_surface_h b = buffer_allocate(width, height, format, 0); TDM_EXIT_IF_FAIL(b != NULL); p->bufs[i] = b; -- 2.7.4