summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungjae Shin <yj99.shin@samsung.com>2017-09-18 05:35:53 (GMT)
committerYoungjae Shin <yj99.shin@samsung.com>2017-09-18 05:35:53 (GMT)
commit52f0181fdd6419e2671b8d2ac0ce23f86a67862d (patch)
tree858bd681062084f5a62452fff85c47a5b3eda025
parentd97a51c1cf761fdb9cf15a135074fdbd60ccee24 (diff)
downloadair_mediahub-52f0181fdd6419e2671b8d2ac0ce23f86a67862d.zip
air_mediahub-52f0181fdd6419e2671b8d2ac0ce23f86a67862d.tar.gz
air_mediahub-52f0181fdd6419e2671b8d2ac0ce23f86a67862d.tar.bz2
fix coding rule errorrefs/changes/24/150624/1
Change-Id: If16dbf80fef3b030415fb40c81eb00ae49575c59
-rw-r--r--src/data/albumdata.c18
-rw-r--r--src/data/mediadata.c21
-rw-r--r--src/main.c3
-rw-r--r--src/util/util.c2
4 files changed, 20 insertions, 24 deletions
diff --git a/src/data/albumdata.c b/src/data/albumdata.c
index 9079260..5e98c6b 100644
--- a/src/data/albumdata.c
+++ b/src/data/albumdata.c
@@ -143,16 +143,15 @@ static int _compare_name(struct group_info *gi, struct album_info *ai)
converted_album_title = util_convert_to_UTF16_string(ai->name);
if (converted_group_name && converted_album_title) {
- result = u_strncasecmp(converted_group_name, converted_album_title, 1, U_FOLD_CASE_DEFAULT);
+ result = u_strncasecmp(converted_group_name,
+ converted_album_title, 1, U_FOLD_CASE_DEFAULT);
}
- if (converted_group_name) {
+ if (converted_group_name)
free(converted_group_name);
- }
- if (converted_album_title) {
+ if (converted_album_title)
free(converted_album_title);
- }
return result;
}
@@ -221,16 +220,15 @@ static int _compare_artist(struct group_info *gi, struct album_info *ai)
converted_artist = util_convert_to_UTF16_string(ai->artist);
if (converted_group_name && converted_artist) {
- result = u_strncasecmp(converted_group_name, converted_artist, 1, U_FOLD_CASE_DEFAULT);
+ result = u_strncasecmp(converted_group_name,
+ converted_artist, 1, U_FOLD_CASE_DEFAULT);
}
- if (converted_group_name) {
+ if (converted_group_name)
free(converted_group_name);
- }
- if (converted_artist) {
+ if (converted_artist)
free(converted_artist);
- }
return result;
}
diff --git a/src/data/mediadata.c b/src/data/mediadata.c
index 66d3d1f..70e4c31 100644
--- a/src/data/mediadata.c
+++ b/src/data/mediadata.c
@@ -122,7 +122,7 @@ static bool _create_filter(struct mediadata *md, filter_h *filter)
char s[64];
snprintf(s, sizeof(s), " AND MEDIA_STORAGE_TYPE=%d",
- md->source_type);
+ md->source_type);
strncat(buf, s, strlen(s));
}
@@ -157,16 +157,15 @@ static int _compare_title(struct group_info *gi, app_media_info *info)
converted_media_title = util_convert_to_UTF16_string(info->title);
if (converted_group_name && converted_media_title) {
- result = u_strncasecmp(converted_group_name, converted_media_title, 1, U_FOLD_CASE_DEFAULT);
+ result = u_strncasecmp(converted_group_name,
+ converted_media_title, 1, U_FOLD_CASE_DEFAULT);
}
- if (converted_group_name) {
+ if (converted_group_name)
free(converted_group_name);
- }
- if (converted_media_title) {
+ if (converted_media_title)
free(converted_media_title);
- }
return result;
}
@@ -803,11 +802,11 @@ struct data_ops *mediadata_get_ops(void)
bool _media_item_cb(media_info_h item, void *user_data)
{
- app_media **am = (app_media**)user_data;
+ app_media **am = (app_media**)user_data;
- *am = app_media_create(item);
+ *am = app_media_create(item);
- return false; //only 1 item
+ return false; //only 1 item
}
@@ -840,9 +839,9 @@ app_media* mediadata_get_app_media_by_file_path(char *file_path)
ret = media_filter_set_order(media_filter, MEDIA_CONTENT_ORDER_DESC, MEDIA_DISPLAY_NAME, MEDIA_CONTENT_COLLATE_NOCASE);
- if ((ret = media_info_foreach_media_from_db(media_filter, _media_item_cb, &am)) != MEDIA_CONTENT_ERROR_NONE) {
+ ret = media_info_foreach_media_from_db(media_filter, _media_item_cb, &am);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
_ERR("media_info_foreach_media_from_db is failed [%d]", ret);
- }
out:
if (media_filter)
diff --git a/src/main.c b/src/main.c
index 67b0ecb..aa3dc48 100644
--- a/src/main.c
+++ b/src/main.c
@@ -198,9 +198,8 @@ static void _app_control(app_control_h app_control, void *data)
}
if (file_path != NULL) {
- if (media_type != NULL) {
+ if (media_type != NULL)
_open_media_file(media_type, file_path);
- }
}
}
if (media_id)
diff --git a/src/util/util.c b/src/util/util.c
index 5c0f282..1810f85 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -501,7 +501,7 @@ OUT:
char* util_convert_to_UTF8_string(UChar *source_string)
{
int buffer_length = 0;
- UErrorCode error_from_icu;
+ UErrorCode error_from_icu;
char *converted_string = NULL;
u_strToUTF8(NULL, 0, &buffer_length, source_string, -1, &error_from_icu);