From 71ecbd464cc30584581e961cadcd99bc364d264b Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Wed, 9 Dec 2015 16:27:02 +0900 Subject: [PATCH] Fix for coding rule Change-Id: I641a40752b0100888ba4753d049f97fe24c7b422 --- packaging/capi-media-tone-player.spec | 4 +- test/multimedia_tone_player_test.c | 72 +++++++++++++++++------------------ 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/packaging/capi-media-tone-player.spec b/packaging/capi-media-tone-player.spec index 4428176..20b3d3a 100755 --- a/packaging/capi-media-tone-player.spec +++ b/packaging/capi-media-tone-player.spec @@ -1,7 +1,7 @@ Name: capi-media-tone-player Summary: A tone player library in Tizen C API -Version: 0.1.5 -Release: 18 +Version: 0.1.6 +Release: 0 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/test/multimedia_tone_player_test.c b/test/multimedia_tone_player_test.c index 201cc91..044e913 100755 --- a/test/multimedia_tone_player_test.c +++ b/test/multimedia_tone_player_test.c @@ -14,8 +14,6 @@ * limitations under the License. */ - - #include #include #include @@ -30,9 +28,10 @@ static GMainLoop *g_mainloop = NULL; static GThread *event_thread; -gpointer GmainThread(gpointer data) { - g_mainloop = g_main_loop_new (NULL, 0); - g_main_loop_run (g_mainloop); +gpointer GmainThread(gpointer data) +{ + g_mainloop = g_main_loop_new(NULL, 0); + g_main_loop_run(g_mainloop); return NULL; } @@ -41,16 +40,16 @@ void help() { printf("Usage : "); printf("multimedia_tone_player_test [OPTION]\n\n" - " -f, --from from which tone type\n" - " -t, --to to which tone type\n" - " -d, --duration duration(ms)\n" - " -s, --sleep sleep time after play start(ms)\n" - " -h, --help help\n"); + " -f, --from from which tone type\n" + " -t, --to to which tone type\n" + " -d, --duration duration(ms)\n" + " -s, --sleep sleep time after play start(ms)\n" + " -h, --help help\n"); } void tone_play_test(int from, int to, int duration, int sleep_time) { - int i ; + int i; printf("From : %2d, To : %2d, Duration : %4d, sleep_time : %4d\n", from, to, duration, sleep_time); @@ -59,14 +58,14 @@ void tone_play_test(int from, int to, int duration, int sleep_time) return; } - for(i = from ;i <= to ;i++) { + for (i = from; i <= to; i++) { printf("Play Tone : %d\n", i); - tone_player_start(i, SOUND_TYPE_MEDIA , duration, NULL); + tone_player_start(i, SOUND_TYPE_MEDIA, duration, NULL); usleep(sleep_time * 1000); } } -int main(int argc, char** argv) +int main(int argc, char **argv) { GError *gerr = NULL; int from = TONE_TYPE_DTMF_0, to = TONE_TYPE_DTMF_S; @@ -76,36 +75,35 @@ int main(int argc, char** argv) int opt; int opt_idx = 0; - static struct option long_options[] = - { - {"from" , required_argument, 0, 'f'}, - {"to" , required_argument, 0, 't'}, + static struct option long_options[] = { + {"from", required_argument, 0, 'f'}, + {"to", required_argument, 0, 't'}, {"duration", required_argument, 0, 'd'}, - {"sleep" , required_argument, 0, 's'}, - {"help" , no_argument , 0, 'h'}, - { 0, 0, 0, 0 } + {"sleep", required_argument, 0, 's'}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; if ((opt = getopt_long(argc, argv, "f:t:d:s:h", long_options, &opt_idx)) == -1) break; switch (opt) { - case 'f': - from = atoi(optarg); - break; - case 't': - to = atoi(optarg); - break; - case 'd': - duration = atoi(optarg); - break; - case 's': - sleep_time = atoi(optarg); - break; - case 'h': - default: - help(); - return 0; + case 'f': + from = atoi(optarg); + break; + case 't': + to = atoi(optarg); + break; + case 'd': + duration = atoi(optarg); + break; + case 's': + sleep_time = atoi(optarg); + break; + case 'h': + default: + help(); + return 0; } } -- 2.7.4