apply tizen c++ coding rule 05/75005/1
authorKyeonghun Lee <kh9090.lee@samsung.com>
Thu, 16 Jun 2016 08:51:45 +0000 (17:51 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Thu, 16 Jun 2016 08:51:45 +0000 (17:51 +0900)
Change-Id: If5b90dc8e774ccfc723f305267c9f1fd96755b9e
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
31 files changed:
framework/deliver-handler/MsgDeliverHandler.cpp
framework/setting-handler/MsgSettingHandler.cpp
framework/storage-handler/MsgStorageManager.cpp
framework/storage-handler/MsgStorageMessage.cpp
framework/transaction-manager/MsgCmdHandlerStorage.cpp
framework/transaction-manager/MsgTransManager.cpp
manager/src/msg-manager-notification.cpp
manager/src/msg-manager-sound.cpp
manager/src/msg-manager.cpp
mapi/msg_message.cpp
mapi/msg_mms.cpp
mapi/msg_svc.cpp
plugin/mms_plugin/MmsPluginCodecCommon.cpp
plugin/mms_plugin/MmsPluginComposer.cpp
plugin/mms_plugin/MmsPluginMain.cpp
plugin/mms_plugin/MmsPluginMessage.cpp
plugin/mms_plugin/MmsPluginSMILValidate.cpp
plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp
plugin/sms_cdma_plugin/SmsCdmaPluginTransport.cpp
plugin/sms_plugin/SmsPluginCbMsgHandler.cpp
plugin/sms_plugin/SmsPluginEventHandler.cpp
plugin/sms_plugin/SmsPluginSetting.cpp
plugin/sms_plugin/SmsPluginStorage.cpp
proxy/MsgProxyContact.cpp
utils/MsgIpcSocket.cpp
utils/MsgMmsMessage.cpp
utils/MsgSmil.cpp
utils/MsgSqliteWrapper.cpp
utils/MsgUtilMime.cpp
utils/MsgUtilStorage.cpp
utils/MsgVMessage.cpp

index b57b995..268e269 100755 (executable)
@@ -358,8 +358,7 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO
                snprintf(pMsgInfo->msgText, sizeof(pMsgInfo->msgText), "%d", voicecnt);
                pMsgInfo->dataSize = strlen(pMsgInfo->msgText);
                MSG_DEBUG("Add Voice or other Message");
-       }
-       else {
+       } else {
                MSG_DEBUG("No matching type [%d]", pMsgInfo->msgType.subType);
                return err;
        }
index 37c4cf0..78159ad 100755 (executable)
 
 /* To store latest setting values */
 /* when it sets to vconf, it will be compared with below values */
-MSG_GENERAL_OPT_S              g_generalOpt = {0,};
-MSG_SMS_SENDOPT_S              g_smsSendOpt = {0,};
-MSG_SMSC_LIST_S                        g_smscList = {0,};
-MSG_MMS_SENDOPT_S              g_mmsSendOpt = {0,};
-MSG_MMS_RECVOPT_S              g_mmsRecvOpt = {0,};
-MSG_MMS_STYLEOPT_S             g_mmsStyleOpt = {0,};
-MSG_PUSHMSG_OPT_S              g_pushMsgOpt = {0,};
+MSG_GENERAL_OPT_S              g_generalOpt = {0, };
+MSG_SMS_SENDOPT_S              g_smsSendOpt = {0, };
+MSG_SMSC_LIST_S                        g_smscList = {0, };
+MSG_MMS_SENDOPT_S              g_mmsSendOpt = {0, };
+MSG_MMS_RECVOPT_S              g_mmsRecvOpt = {0, };
+MSG_MMS_STYLEOPT_S             g_mmsStyleOpt = {0, };
+MSG_PUSHMSG_OPT_S              g_pushMsgOpt = {0, };
 
 /*==================================================================================================
                                      FUNCTION IMPLEMENTATION
index e9ce72c..2c5f9cd 100755 (executable)
@@ -975,9 +975,9 @@ msg_error_t MsgStoRestoreMessage(const char *filepath, msg_id_list_s **result_id
                        msg_message_id_t * msg_id_list;
                        msg_id_list = (msg_message_id_t*)realloc(msgIdList->msgIdList, sizeof(msg_message_id_t)*(msgIdList->nCount+1));
 
-                       if (msg_id_list)
+                       if (msg_id_list) {
                                msgIdList->msgIdList = msg_id_list;
-                       else {
+                       else {
                                MSG_DEBUG("realloc failed");
                                err = MSG_ERR_UNKNOWN;
                                goto __RETURN;
index 0444e26..6886f74 100755 (executable)
@@ -2457,18 +2457,18 @@ msg_error_t MsgStoCountMsgByContact(const MSG_THREAD_LIST_INDEX_S *pAddrInfo, MS
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
        if (pAddrInfo->contactId > 0) {
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, \
-                               SUM(CASE WHEN READ_STATUS = 0 AND FOLDER_ID = %d THEN 1 ELSE 0 END), \
-                               SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END), \
-                               SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END) \
-                               FROM (SELECT * FROM %s A  JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.CONTACT_ID = %d)",
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, "
+                               "SUM(CASE WHEN READ_STATUS = 0 AND FOLDER_ID = %d THEN 1 ELSE 0 END), "
+                               "SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END), "
+                               "SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END) "
+                               "FROM (SELECT * FROM %s A  JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.CONTACT_ID = %d)",
                                MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE, MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->contactId);
        } else {
-               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, \
-                               SUM(CASE WHEN READ_STATUS = 0 AND FOLDER_ID = %d THEN 1 ELSE 0 END), \
-                               SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END), \
-                               SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END) \
-                               FROM (SELECT * FROM %s A JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.ADDRESS_VAL = '%s')",
+               snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, "
+                               "SUM(CASE WHEN READ_STATUS = 0 AND FOLDER_ID = %d THEN 1 ELSE 0 END), "
+                               "SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END), "
+                               "SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END) "
+                               "FROM (SELECT * FROM %s A JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.ADDRESS_VAL = '%s')",
                                MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE, MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->msgAddrInfo.addressVal);
        }
 
@@ -3049,13 +3049,11 @@ msg_error_t MsgCheckUniqueness(bool bInsert, msg_message_id_t msgId, MSG_UNIQUE_
                if (nRowCnt == 0) {
                        MSG_DEBUG("<<<<This incoming message is a new message>>>>");
                        return MSG_SUCCESS;
-               }
-               else {
+               } else {
                        MSG_DEBUG("<<<<This incoming message is a repeated message>>>>");
                        return MSG_ERR_UNKNOWN;
                }
-       }
-       else {
+       } else {
                memset(sqlQuery, 0x00, sizeof(sqlQuery));
                dbHandle->beginTrans();
 
index 915fc71..cbae6c5 100755 (executable)
@@ -1231,8 +1231,9 @@ int MsgRestoreMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                } else {
                        MSG_DEBUG("Not Exist msg id list to restore");
                }
-       } else
+       } else {
                MSG_DEBUG("Command Handle Fail : MsgStoRestoreMessage()");
+       }
 
        /* Make Event Data */
        eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_RESTORE_MESSAGE, err, (void**)ppEvent);
index 05764fb..dcede79 100755 (executable)
@@ -1299,8 +1299,8 @@ _RETURN_ERR:
        if (p_conf) {
                cynara_configuration_destroy(p_conf);
        }
-       return result;
 
+       return result;
 }
 
 
index 0c417df..06902a6 100644 (file)
@@ -388,7 +388,7 @@ int MsgMgrRefreshNotification(msg_mgr_notification_type_t noti_type, bool bFeedb
        int bNotification = 1;
 /*     bool bReplyPopup = false; */
 
-       MSG_MGR_NOTI_INFO_S noti_info = {0,};
+       MSG_MGR_NOTI_INFO_S noti_info = {0, };
        noti_info.type = noti_type;
        noti_info.id = getPrivId(noti_info.type, -1);
 
@@ -445,7 +445,7 @@ int MsgMgrAddReportNotification(msg_mgr_notification_type_t noti_type, MSG_MGR_M
        report_notification_s *info = new report_notification_s;
        memset(info, 0x00, sizeof(report_notification_s));
 
-       MSG_MGR_NOTI_INFO_S noti_info = {0,};
+       MSG_MGR_NOTI_INFO_S noti_info = {0, };
        noti_info.type = noti_type;
 
        createInfoData(&noti_info, msg_info);
@@ -952,12 +952,6 @@ void setText(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info)
                        setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_INFO_1, "Message unreachable", UNREACHABLE_MESSAGE);
                else if (noti_info->extra_data == MSG_DELIVERY_REPORT_ERROR)
                        setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_INFO_1, "Message error", NULL);
-               /* CID 45672: noti_info->extra_data in unsigned char but MSG_READ_REPORT_NONE is -1. So the expression is always false */
-#if 0
-               else if (noti_info->extra_data == MSG_DELIVERY_REPORT_NONE) {
-                       /* notification free */
-               }
-#endif
                else
                        setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_INFO_1, "Message delivered", DELIVERED_MESSAGE);
 
@@ -1213,8 +1207,8 @@ void setSoundAndVibration(notification_h noti_h, char *addressVal, bool bVoiceMa
 {
        MSG_MGR_BEGIN();
 
-       MSG_MGR_ADDRESS_INFO_S addrInfo = {0,};
-       MSG_MGR_CONTACT_INFO_S contactInfo = {0,};
+       MSG_MGR_ADDRESS_INFO_S addrInfo = {0, };
+       MSG_MGR_CONTACT_INFO_S contactInfo = {0, };
 
        if (addressVal != NULL) {
                snprintf(addrInfo.addressVal, sizeof(addrInfo.addressVal), "%s", addressVal);
@@ -1239,9 +1233,9 @@ void setSoundAndVibration(notification_h noti_h, char *addressVal, bool bVoiceMa
        MsgMgrGetPlayStatus(bVoiceMail, &bPlaySound, &bPlayVibration, &bOnCall);
 
        if (bPlaySound) {
-               if (msg_tone_file_path)
+               if (msg_tone_file_path) {
                        setNotiSound(noti_h, NOTIFICATION_SOUND_TYPE_USER_DATA, msg_tone_file_path);
-               else {
+               else {
                        int tmpVal = 0;
                        if (vconf_get_int(MSG_SETTING_RINGTONE_TYPE, &tmpVal) != 0) {
                                MSG_MGR_INFO("MsgSettingGetInt() is failed");
@@ -2057,11 +2051,11 @@ int getLatestMsgInfo(MSG_MGR_NOTI_INFO_S *noti_info, bool isForInstantMessage)
                        noti_info->count = atoi(db_res[col_cnt+6]);
 
                        if (noti_info->count > 0) {
-                               MSG_MGR_ADDRESS_INFO_S addrInfo = {0,};
+                               MSG_MGR_ADDRESS_INFO_S addrInfo = {0, };
 
                                snprintf(addrInfo.addressVal, MAX_ADDRESS_VAL_LEN, "%s", db_res[col_cnt]);
 
-                               MSG_MGR_CONTACT_INFO_S tmpContact = {0,};
+                               MSG_MGR_CONTACT_INFO_S tmpContact = {0, };
 
                                MsgMgrGetContactInfo(&addrInfo, &tmpContact);
 
@@ -2385,8 +2379,8 @@ void createInfoData(MSG_MGR_NOTI_INFO_S *noti_info, MSG_MGR_MESSAGE_INFO_S *msg_
                noti_info->time = msg_info->displayTime;
                noti_info->extra_data = msg_info->networkStatus;
 
-               MSG_MGR_CONTACT_INFO_S contactInfo = {0,};
-               MSG_MGR_ADDRESS_INFO_S tmpAddressInfo = {0,};
+               MSG_MGR_CONTACT_INFO_S contactInfo = {0, };
+               MSG_MGR_ADDRESS_INFO_S tmpAddressInfo = {0, };
                if (msg_info->addressVal[0] != '\0') {
                        snprintf(tmpAddressInfo.addressVal, MAX_ADDRESS_VAL_LEN, "%s", msg_info->addressVal);
                        if (_is_valid_email(msg_info->addressVal)) {
@@ -2421,8 +2415,8 @@ void createInfoData(MSG_MGR_NOTI_INFO_S *noti_info, MSG_MGR_MESSAGE_INFO_S *msg_
                noti_info->layout = NOTIFICATION_LY_NOTI_EVENT_SINGLE;
                noti_info->time = msg_info->displayTime;
 
-               MSG_MGR_CONTACT_INFO_S contactInfo = {0,};
-               MSG_MGR_ADDRESS_INFO_S tmpAddressInfo = {0,};
+               MSG_MGR_CONTACT_INFO_S contactInfo = {0, };
+               MSG_MGR_ADDRESS_INFO_S tmpAddressInfo = {0, };
                if (msg_info->addressVal[0] != '\0') {
                        snprintf(tmpAddressInfo.addressVal, MAX_ADDRESS_VAL_LEN, "%s", msg_info->addressVal);
                        if (_is_valid_email(msg_info->addressVal)) {
index 69a7d57..55d3920 100644 (file)
@@ -341,7 +341,7 @@ void MsgMgrSoundPlayStart(const MSG_MGR_ADDRESS_INFO_S *pAddrInfo, MSG_MGR_SOUND
                return;
        }
 
-       MSG_MGR_CONTACT_INFO_S contactInfo = {0,};
+       MSG_MGR_CONTACT_INFO_S contactInfo = {0, };
        if (pAddrInfo) {
                if (MsgMgrGetContactInfo(pAddrInfo, &contactInfo) != 0) {
                        MSG_MGR_DEBUG("MsgGetContactInfo() fail.");
index 0bb8fc2..b358d5e 100644 (file)
@@ -149,7 +149,7 @@ void _incoming_msg_func(app_control_h app_control)
        msg_message_id_t msg_id = atoi(rcv_msg_id);
        msg_struct_t msg = NULL;
        msg_struct_t opt = NULL;
-       contactInfo contact_info = {0,};
+       contactInfo contact_info = {0, };
        contact_info.msgId = msg_id;
 
        msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
@@ -210,7 +210,7 @@ void _outgoing_msg_func(app_control_h app_control)
        msg_message_id_t msg_id = atoi(sent_msg_id);
        msg_struct_t msg = NULL;
        msg_struct_t opt = NULL;
-       contactInfo contact_info = {0,};
+       contactInfo contact_info = {0, };
        contact_info.msgId = msg_id;
 
        msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
@@ -325,7 +325,7 @@ void _add_noti_func(app_control_h app_control)
        msg_struct_t msg = NULL;
        msg_struct_t opt = NULL;
        msg_list_handle_t addr_list = NULL;
-       MSG_MGR_MESSAGE_INFO_S msg_info = {0,};
+       MSG_MGR_MESSAGE_INFO_S msg_info = {0, };
        msg_info.msgId = msg_id;
 
        msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
@@ -432,7 +432,7 @@ void _add_report_noti_func(app_control_h app_control)
        msg_struct_t msg = NULL;
        msg_struct_t opt = NULL;
        msg_list_handle_t addr_list = NULL;
-       MSG_MGR_MESSAGE_INFO_S msg_info = {0,};
+       MSG_MGR_MESSAGE_INFO_S msg_info = {0, };
        msg_info.msgId = msg_id;
 
        msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
@@ -505,7 +505,7 @@ void _insert_only_active_noti_func(app_control_h app_control)
        msg_struct_t msg = NULL;
        msg_struct_t opt = NULL;
        msg_list_handle_t addr_list = NULL;
-       MSG_MGR_MESSAGE_INFO_S msg_info = {0,};
+       MSG_MGR_MESSAGE_INFO_S msg_info = {0, };
        msg_info.msgId = msg_id;
 
        msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
@@ -624,7 +624,7 @@ void _sound_play_start_func(app_control_h app_control)
        ret = app_control_get_extra_data(app_control, "address", &addr);
 
        if (addr) {
-               MSG_MGR_ADDRESS_INFO_S addr_info = {0,};
+               MSG_MGR_ADDRESS_INFO_S addr_info = {0, };
                snprintf(addr_info.addressVal, MAX_ADDRESS_VAL_LEN, "%s", addr);
 
                MsgMgrSoundPlayStart(&addr_info, sound_type);
@@ -699,7 +699,7 @@ void service_app_control(app_control_h app_control, void *data)
 
 int main(int argc, char* argv[])
 {
-       service_app_lifecycle_callback_s event_callback = {0,};
+       service_app_lifecycle_callback_s event_callback = {0, };
 
        event_callback.create = service_app_create;
        event_callback.terminate = service_app_terminate;
index 9b8f0aa..02ba5e6 100755 (executable)
@@ -225,8 +225,7 @@ int msg_message_get_int_value(void *data, int field, int *value)
                                        *value = MSG_TYPE_SMS;
                                        break;
                        }
-               }
-               else if (msg_data->mainType == MSG_MMS_TYPE) {
+               } else if (msg_data->mainType == MSG_MMS_TYPE) {
                        if (msg_data->subType == MSG_NOTIFICATIONIND_MMS)
                                *value = MSG_TYPE_MMS_NOTI;
                        else if (msg_data->subType == MSG_SENDREQ_JAVA_MMS)
index e2afdbd..0714225 100755 (executable)
@@ -463,9 +463,9 @@ int msg_mms_get_int_value(msg_struct_s *msg_struct, int field, int *value)
                        *value = mms_data->header.mmsStatus;
                } else if (field == MSG_MMS_HEADER_CONTENT_CLASS_INT) {
                        *value = mms_data->header.contentClass;
-               }
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MMS_PAGE: {
@@ -615,34 +615,35 @@ int msg_mms_get_str_value(msg_struct_s *msg_struct, int field, char *value, int
                        strncpy(value, mms_data->smil.szContentID, size);
                } else if (field == MSG_MMS_SMIL_MULTIPART_CONTENT_LOCATION_STR) {
                        strncpy(value, mms_data->smil.szContentLocation, size);
-               }
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MMS_MEDIA: {
                MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
-               if (field == MSG_MMS_MEDIA_SRC_STR)
+               if (field == MSG_MMS_MEDIA_SRC_STR) {
                        strncpy(value, mms_media_data->szSrc, size);
-               else if (field == MSG_MMS_MEDIA_FILENAME_STR)
+               } else if (field == MSG_MMS_MEDIA_FILENAME_STR) {
                        strncpy(value, mms_media_data->szFileName, size);
-               else if (field == MSG_MMS_MEDIA_FILEPATH_STR)
+               } else if (field == MSG_MMS_MEDIA_FILEPATH_STR) {
                        strncpy(value, mms_media_data->szFilePath, size);
-               else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR) {
+               else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR) {
                        if (strlen(mms_media_data->szContentID) > 0)
                                snprintf(value, size, "<%s>", mms_media_data->szContentID);
-               } else if (field == MSG_MMS_MEDIA_REGION_ID_STR)
+               } else if (field == MSG_MMS_MEDIA_REGION_ID_STR) {
                        strncpy(value, mms_media_data->regionId, size);
-               else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR)
+               } else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR) {
                        strncpy(value, mms_media_data->szAlt, size);
-               else if (field == MSG_MMS_MEDIA_DRM_FULLPATH_STR)
+               } else if (field == MSG_MMS_MEDIA_DRM_FULLPATH_STR) {
                        strncpy(value, mms_media_data->szDrm2FullPath, size);
-               else if (field == MSG_MMS_MEDIA_CONTENT_LOCATION_STR)
+               } else if (field == MSG_MMS_MEDIA_CONTENT_LOCATION_STR) {
                        strncpy(value, mms_media_data->szContentLocation, size);
-               else if (field == MSG_MMS_MEDIA_CONTENT_TYPE_STR)
+               } else if (field == MSG_MMS_MEDIA_CONTENT_TYPE_STR) {
                        strncpy(value, mms_media_data->szContentType, size);
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MMS_ATTACH: {
@@ -839,11 +840,11 @@ int msg_mms_set_int_value(msg_struct_s *msg_struct, int field, int value)
        switch (msg_struct->type) {
        case MSG_STRUCT_MMS: {
                MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
-               if (field == MSG_MMS_ROOTLAYOUT_WIDTH_INT)
+               if (field == MSG_MMS_ROOTLAYOUT_WIDTH_INT) {
                        mms_data->rootlayout.width.value = value;
-               else if (field == MSG_MMS_ROOTLAYOUT_HEIGHT_INT)
+               } else if (field == MSG_MMS_ROOTLAYOUT_HEIGHT_INT) {
                        mms_data->rootlayout.height.value = value;
-               else if (field == MSG_MMS_ROOTLAYOUT_BGCOLOR_INT) {
+               else if (field == MSG_MMS_ROOTLAYOUT_BGCOLOR_INT) {
                        mms_data->rootlayout.bBgColor = true;
                        mms_data->rootlayout.bgColor = value;
                } else if (field == MSG_MMS_HEADER_DATE_INT) {
@@ -872,9 +873,9 @@ int msg_mms_set_int_value(msg_struct_s *msg_struct, int field, int value)
                        mms_data->header.mmsStatus = value;
                } else if (field == MSG_MMS_HEADER_CONTENT_CLASS_INT) {
                        mms_data->header.contentClass = value;
-               }
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MMS_PAGE: {
@@ -919,21 +920,22 @@ int msg_mms_set_int_value(msg_struct_s *msg_struct, int field, int value)
        break;
        case MSG_STRUCT_MMS_REGION: {
                MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
-               if (field == MSG_MMS_REGION_LENGTH_LEFT_INT)
+               if (field == MSG_MMS_REGION_LENGTH_LEFT_INT) {
                        mms_region_data->nLeft.value = value;
-               else if (field == MSG_MMS_REGION_LENGTH_TOP_INT)
+               } else if (field == MSG_MMS_REGION_LENGTH_TOP_INT) {
                        mms_region_data->nTop.value = value;
-               else if (field == MSG_MMS_REGION_LENGTH_WIDTH_INT)
+               } else if (field == MSG_MMS_REGION_LENGTH_WIDTH_INT) {
                        mms_region_data->width.value = value;
-               else if (field == MSG_MMS_REGION_LENGTH_HEIGHT_INT)
+               } else if (field == MSG_MMS_REGION_LENGTH_HEIGHT_INT) {
                        mms_region_data->height.value = value;
-               else if (field == MSG_MMS_REGION_BGCOLOR_INT) {
+               else if (field == MSG_MMS_REGION_BGCOLOR_INT) {
                        mms_region_data->bBgColor = true;
                        mms_region_data->bgColor = value;
-               } else if (field == MSG_MMS_REGION_FIT_TYPE_INT)
+               } else if (field == MSG_MMS_REGION_FIT_TYPE_INT) {
                        mms_region_data->fit = (REGION_FIT_TYPE_T)value;
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MMS_TRANSITION: {
@@ -1003,9 +1005,9 @@ int msg_mms_set_str_value(msg_struct_s *msg_struct, int field, const char *value
        switch (msg_struct->type) {
        case MSG_STRUCT_MMS_MEDIA: {
                MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
-               if (field == MSG_MMS_MEDIA_SRC_STR)
+               if (field == MSG_MMS_MEDIA_SRC_STR) {
                        strncpy(mms_media_data->szSrc, value, MSG_FILEPATH_LEN_MAX);
-               else if (field == MSG_MMS_MEDIA_FILENAME_STR) {
+               else if (field == MSG_MMS_MEDIA_FILENAME_STR) {
                        strncpy(mms_media_data->szFileName, value, MSG_FILEPATH_LEN_MAX);
                } else if (field == MSG_MMS_MEDIA_FILEPATH_STR) {
                        MSG_SEC_DEBUG("media file path = %s", value);
@@ -1021,20 +1023,21 @@ int msg_mms_set_str_value(msg_struct_s *msg_struct, int field, const char *value
                                strncpy(mms_media_data->szFileName, value, MSG_FILENAME_LEN_MAX);
                                strncpy(mms_media_data->szContentID, value, MSG_MSG_ID_LEN);
                        }
-               } else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR)
+               } else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR) {
                        __removeLessGreaterMark(value, mms_media_data->szContentID, MSG_MSG_ID_LEN);
-                else if (field == MSG_MMS_MEDIA_REGION_ID_STR)
+               } else if (field == MSG_MMS_MEDIA_REGION_ID_STR) {
                        strncpy(mms_media_data->regionId, value, MAX_SMIL_REGION_ID);
-               else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR)
+               } else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR) {
                        strncpy(mms_media_data->szAlt, value, MAX_SMIL_ALT_LEN);
-               else if (field == MSG_MMS_MEDIA_DRM_FULLPATH_STR)
+               } else if (field == MSG_MMS_MEDIA_DRM_FULLPATH_STR) {
                        strncpy(mms_media_data->szDrm2FullPath, value, MSG_FILEPATH_LEN_MAX);
-               else if (field == MSG_MMS_MEDIA_CONTENT_LOCATION_STR)
+               } else if (field == MSG_MMS_MEDIA_CONTENT_LOCATION_STR) {
                        strncpy(mms_media_data->szContentLocation, value, MSG_MSG_ID_LEN);
-               else if (field == MSG_MMS_MEDIA_CONTENT_TYPE_STR)
+               } else if (field == MSG_MMS_MEDIA_CONTENT_TYPE_STR) {
                        strncpy(mms_media_data->szContentType, value, MSG_MSG_ID_LEN);
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MMS_ATTACH: {
@@ -1135,9 +1138,9 @@ int msg_mms_set_str_value(msg_struct_s *msg_struct, int field, const char *value
                        strncpy(mms_data->smil.szContentID, value, sizeof(mms_data->smil.szContentID) - 1 );
                } else if (field == MSG_MMS_SMIL_MULTIPART_CONTENT_LOCATION_STR) {
                        strncpy(mms_data->smil.szContentLocation, value, sizeof(mms_data->smil.szContentLocation) - 1 );
-               }
-               else
+               } else {
                        err = MSG_ERR_INVALID_PARAMETER;
+               }
        }
        break;
        case MSG_STRUCT_MULTIPART_INFO:
index 80755ad..6a7b523 100755 (executable)
@@ -1515,8 +1515,7 @@ EXPORT_API int msg_util_calculate_text_length(const char* msg_text, msg_encode_t
                if ((decodeLen + headerSize) > 160) {
                        headerLen = 1;
                        segSize = ((140 - (headerLen + concat + headerSize)) * 8)/7;
-               }
-               else {
+               } else {
                        segSize = ((140 - headerLen - headerSize) * 8) / 7;
                }
 
index 13becbf..30d07a7 100755 (executable)
@@ -459,17 +459,17 @@ void *MsgDecodeBase64(unsigned char *pSrc, unsigned long srcLen, unsigned long *
 
                /* Convert base64 character into original value */
 
-               if (isupper(c))
+               if (isupper(c)) {
                        c -= 'A';
-               else if (islower(c))
+               } else if (islower(c)) {
                        c -= 'a' - 26;
-               else if (isdigit(c))
+               } else if (isdigit(c)) {
                        c -= '0' - 52;
-               else if (c == '+')
+               } else if (c == '+') {
                        c = 62;
-               else if (c == '/')
+               } else if (c == '/') {
                        c = 63;
-               else if (c == '=') {
+               else if (c == '=') {
                        switch (e++) {
                        case 2:
                                if (*pSrc != '=') {
@@ -485,8 +485,9 @@ void *MsgDecodeBase64(unsigned char *pSrc, unsigned long srcLen, unsigned long *
                                return ret;
                        }
                        continue;
-               } else
+               } else {
                        continue;                                       /* Actually, never get here */
+               }
 
                /* Pad 4*6bit character into 3*8bit character */
 
index c9fa98c..232804a 100755 (executable)
@@ -110,8 +110,8 @@ MMSList *getAddressList(const MSG_MESSAGE_INFO_S *pMsgInfo, int recipientType)
                                pAddressData = MsgMmsCreateAddress(MSG_ADDRESS_TYPE_PLMN, pMsgInfo->addressList[i].addressVal);
                        } else if (pMsgInfo->addressList[i].addressType == MSG_ADDRESS_TYPE_EMAIL) {
                                pAddressData = MsgMmsCreateAddress(MSG_ADDRESS_TYPE_EMAIL, pMsgInfo->addressList[i].addressVal);
-                       } else
-                               ; /* Need to consider IPV4, IPV6, and Alias formatted address */
+                       }
+                       /* Need to consider IPV4, IPV6, and Alias formatted address */
 
                        if (pAddressData)
                                addressList = g_list_append(addressList, pAddressData);
index 0abbbd7..1081735 100755 (executable)
@@ -249,8 +249,9 @@ msg_error_t MmsUpdateRejectStatus(MSG_MESSAGE_INFO_S *pMsgInfo)
                        MSG_DEBUG("MmsPlgUpdRejectStatus : Encode Notify Response Success");
                        pMsgInfo->dataSize = strlen(pMsgInfo->msgData);
                        pMsgInfo->bTextSms = true;
-               } else
+               } else {
                        MSG_DEBUG("MmsPlgSetRejectStatus : Encode Notify Response Failed");
+               }
        } catch (MsgException& e) {
                MSG_FATAL("%s", e.what());
                return MSG_ERR_PLUGIN_STORAGE;
index ebeb94c..a93eed7 100755 (executable)
@@ -122,8 +122,8 @@ char *MmsComposeAddress(const MSG_MESSAGE_INFO_S *pMsgInfo, int recipientType)
                                addrLen += strlen(pMsgInfo->addressList[i].addressVal);
                        } else if (pMsgInfo->addressList[i].addressType == MSG_ADDRESS_TYPE_EMAIL) {
                                addrLen += strlen(pMsgInfo->addressList[i].addressVal);
-                       } else
-                               ; /* Need to consider IPV4, IPV6, and Alias formatted address */
+                       }
+                       /*  Need to consider IPV4, IPV6, and Alias formatted address */
 
                        nRecpCnt++;
                }
@@ -145,8 +145,8 @@ char *MmsComposeAddress(const MSG_MESSAGE_INFO_S *pMsgInfo, int recipientType)
                                MSG_DEBUG("%s", pString);
                        } else if (pMsgInfo->addressList[i].addressType == MSG_ADDRESS_TYPE_EMAIL) {
                                snprintf(pString, MSG_LOCALE_NAME_LEN + MSG_ADDR_LEN + 3, "%s", pMsgInfo->addressList[i].addressVal);
-                       } else
-                               ; /* Need to consider IPV4, IPV6, and Alias formatted address */
+                       }
+                       /* Need to consider IPV4, IPV6, and Alias formatted address */
 
                        g_strlcat(szCompose, pString, addrLen + 1);
                }
index 9cea890..252de69 100755 (executable)
@@ -140,11 +140,11 @@ MSG_SMIL_ERR_E _MsgMMSValidateSMILRegion(MMS_MESSAGE_DATA_S *pMsgData, bool *pbR
                                        nMediaCnt++;
                        }
 
-                       if (nMediaCnt == 1)
+                       if (nMediaCnt == 1) {
                                bfullReg = true;
-                       else if (nMediaCnt == 2)
+                       } else if (nMediaCnt == 2) {
                                btwoReg = true;
-                       else if (nMediaCnt > 2) {
+                       else if (nMediaCnt > 2) {
                                MSG_DEBUG("_MsgMMSValidateSMILRegion: Invalid Region Information\n");
                                eRet = MSG_SMIL_ERR_INVALID_PAGE_INFO;
                                return eRet;
@@ -412,39 +412,44 @@ MSG_SMIL_ERR_E  _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegA
                                if ((bImgExists == true) || (bVidExists == true) ||
                                        (bImgOrVidExists== true)) {
                                        eRet = MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS;
-                               } else
+                               } else {
                                        bImgExists = true;
+                               }
                                break;
                        }
                        case MMS_SMIL_MEDIA_AUDIO: {
                                if ((bAudExists == true) || (bVidExists == true) ||
                                        (bImgOrVidExists== true)) {
                                        eRet = MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS;
-                               } else
+                               } else {
                                        bAudExists = true;
+                               }
                                break;
                        }
                        case MMS_SMIL_MEDIA_VIDEO: {
                                if ((bImgExists == true) || (bVidExists == true) ||
                                        (bImgOrVidExists== true)) {
                                        eRet = MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS;
-                               } else
+                               } else {
                                        bVidExists = true;
+                               }
                                break;
                        }
                        case MMS_SMIL_MEDIA_TEXT: {
                                if (bTxtExists == true) {
                                        eRet = MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS;
-                               } else
+                               } else {
                                        bTxtExists = true;
+                               }
                                break;
                        }
                        case MMS_SMIL_MEDIA_IMG_OR_VIDEO: {
                                if ((bImgExists == true) || (bVidExists == true) ||
                                        (bImgOrVidExists== true)) {
                                        eRet = MSG_SMIL_ERR_SIMILAR_MEDIA_EXISTS;
-                               } else
+                               } else {
                                        bImgOrVidExists = true;
+                               }
                                break;
                        }
                        default: {
@@ -470,8 +475,9 @@ MSG_SMIL_ERR_E  _MsgMMSValidateSMILPage(MMS_MESSAGE_DATA_S *pMsgData, bool bRegA
                                                snprintf(pMedia->regionId, MAX_SMIL_REGION_ID, "%s", MSG_SMIL_DEFAULT_TXT_REG);
                                        else
                                                snprintf(pMedia->regionId, MAX_SMIL_REGION_ID, "%s", MSG_SMIL_DEFAULT_IMG_REG);
-                               } else
+                               } else {
                                        snprintf(pMedia->regionId, MAX_SMIL_REGION_ID, "%s", MSG_SMIL_DEFAULT_FULL_REG);
+                               }
                        }
                        PageRegionIdx++;
                }
index 85aab56..c573434 100755 (executable)
@@ -241,14 +241,12 @@ msg_error_t SmsPluginStorage::checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
                        pMsgInfo->folderId = 0;
                        err = MSG_SUCCESS;
-               }
-               /*
+/*             }
                else if (pMsgInfo->msgType.classType == MSG_CLASS_2 &&
                                (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS)) {
                        err = addClass2Message(pMsgInfo);
-               }
-               */
-               else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
+*/
+               } else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
                        err = MSG_SUCCESS;
                }
                return err;
index 81ed75d..6737c31 100755 (executable)
@@ -425,7 +425,6 @@ void SmsPluginTransport::sendDeliverReport(msg_error_t err, sms_trans_p2p_msg_s
                }
 
        } else if (err == MSG_ERR_MESSAGE_COUNT_FULL) {
-
                cause_code.error_class = SMS_TRANS_ERR_CLASS_TEMPORARY;
 
                response = TAPI_NETTEXT_ME_FULL;
index da8f06c..7847359 100755 (executable)
@@ -786,8 +786,7 @@ void SmsPluginCbMsgHandler::convertCbMsgToMsginfo(SMS_CBMSG_S *pCbMsg, MSG_MESSA
                                pCbMsg->msgData[pCbMsg->msgLength-1] == '\r' ||
                                pCbMsg->msgData[pCbMsg->msgLength-1] == '\n') {
                        pCbMsg->msgLength--;
-               }
-               else {
+               } else {
                        break;
                }
        }
index dda8132..5cf386f 100755 (executable)
@@ -660,9 +660,9 @@ void SmsPluginEventHandler::convertDeliverTpduToMsginfo(const SMS_DELIVER_S *pTp
                        strftime(displayTime, 32, "%Y-%02m-%02d %T %z", &timeTM);
                        MSG_DEBUG("displayTime [%s]", displayTime);
                }
-       }
-       else
+       } else {
                rawtime = time(NULL);
+       }
 
        msgInfo->displayTime = rawtime;
 
index 56b3ea7..c1de8a4 100755 (executable)
@@ -1207,13 +1207,13 @@ void SmsPluginSetting::setMwiInfo(int simIndex, MSG_SUB_TYPE_T type, int count)
 
        if (pTmpsimMwiInfo.b_cphs) {
                MSG_DEBUG("b_cphs is set");
-               if (type == MSG_MWI_VOICE_SMS)
+               if (type == MSG_MWI_VOICE_SMS) {
                        pTmpsimMwiInfo.cphs_mwi.b_voice1 = (count > 0 ? 1:0);
-               else if (type == MSG_MWI_VOICE2_SMS)
+               } else if (type == MSG_MWI_VOICE2_SMS) {
                        pTmpsimMwiInfo.cphs_mwi.b_voice2 = (count > 0 ? 1:0);
-               else if (type == MSG_MWI_FAX_SMS)
+               } else if (type == MSG_MWI_FAX_SMS) {
                        pTmpsimMwiInfo.cphs_mwi.b_fax = (count > 0 ? 1:0);
-               else {
+               else {
                        MSG_DEBUG("There is no type [%d] in CPHS.", type);
                        return;
                }
index 546682b..3b3f215 100755 (executable)
@@ -415,12 +415,10 @@ msg_error_t SmsPluginStorage::checkMessage(MSG_MESSAGE_INFO_S *pMsgInfo)
                if (pMsgInfo->msgType.classType == MSG_CLASS_0) {
                        pMsgInfo->folderId = 0;
                        err = MSG_SUCCESS;
-               }
-               else if (pMsgInfo->msgType.classType == MSG_CLASS_2 &&
+               } else if (pMsgInfo->msgType.classType == MSG_CLASS_2 &&
                                (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS)) {
                        err = addClass2Message(pMsgInfo);
-               }
-               else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
+               } else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
                        err = MSG_SUCCESS;
                }
                return err;
index 8f78570..9dd54b0 100644 (file)
@@ -156,8 +156,7 @@ msg_error_t MsgGetContactSearchList(const char *pSearchVal, MSG_ADDRESS_INFO_S *
                ret = contacts_record_get_str(personNumber, _contacts_person_number.normalized_number, &normalizedNumber);
                if (ret != CONTACTS_ERROR_NONE) {
                        MSG_DEBUG("contacts_record_get_int() Error [%d]", ret);
-               }
-               else if (normalizedNumber) {
+               } else if (normalizedNumber) {
                        MSG_DEBUG("normalizedNumber [%s]", normalizedNumber);
                        strncpy((*pAddrInfo)[index].addressVal, normalizedNumber, MAX_ADDRESS_VAL_LEN);
                }
index c7ac95e..b34ea2b 100755 (executable)
@@ -227,8 +227,7 @@ bool MsgIpcClientSocket::wait_for_reply()
        if (err == -1) {
                MSG_FATAL("select error[%d] fd[%d]", errno, sockfd);
                return false;
-       }
-       else if (err == 0) {
+       } else if (err == 0) {
                MSG_FATAL("select timeout fd[%d]", sockfd);
                return false;
        }
@@ -262,8 +261,7 @@ int MsgIpcClientSocket::read(char** buf, unsigned int* len)
        if (n == CLOSE_CONNECTION_BY_SIGNAL) { /* if msgfw gets down, it signals to all IPC clients */
                MSG_FATAL("sockfd [%d] CLOSE_CONNECTION_BY_SIGNAL", sockfd);
                return n;
-       }
-       else if (n != sizeof(int)) {
+       } else if (n != sizeof(int)) {
                MSG_FATAL("WARNING: read header_size[%d] not matched [%d]", n, sizeof(int));
                return CUSTOM_SOCKET_ERROR;
        }
@@ -443,9 +441,9 @@ int MsgIpcServerSocket::readn(int fd, char *buf, unsigned int len )
                if (nread < 0) {
                        MSG_FATAL("read: %s", g_strerror(errno));
                        return nread;
-               }
-               else if (nread == 0)
+               } else if (nread == 0) {
                        break;
+               }
 
                if (nleft >= (unsigned int)nread)
                        nleft -= nread;
@@ -479,9 +477,7 @@ int MsgIpcServerSocket::read(int fd, char** buf, int* len )
        if (n == CLOSE_CONNECTION_BY_SIGNAL) {
                MSG_FATAL("fd %d CLOSE_CONNECTION_BY_SIGNAL", fd);
                return n;
-       }
-
-       else if (n != sizeof(int)) {
+       } else if (n != sizeof(int)) {
                MSG_FATAL("readn %d(%d)", n, sizeof(int));
                return CUSTOM_SOCKET_ERROR;
        }
index 27af827..64a7c71 100755 (executable)
@@ -753,9 +753,9 @@ bool _MsgMmsDeserializeMessageData(MMS_MESSAGE_DATA_S *pMsgData, const char *pDa
                offset += sizeof(MMS_ATTACH_S);
 
                MSG_SEC_DEBUG("[#%2d][%5d][%d attach] drm type [%d],  attach filepath = [%s], content type = [%s]", serial_index++, offset, i, pAttach->drmType, pAttach->szFilePath, pAttach->szContentType);
-               if (strlen(pAttach->szFilePath) >0)
+               if (strlen(pAttach->szFilePath) >0) {
                        pMsgData->attachlist = g_list_append(pMsgData->attachlist, pAttach);
-               else {
+               else {
                        free(pAttach);
                        pAttach = NULL;
                }
index afd42ab..bc935b0 100755 (executable)
@@ -939,8 +939,9 @@ bool MsgSmilAddRegion(HMsgSmil hSmilDoc, MMS_SMIL_REGION *pstSmilRegion)
                        }
 
                        MsgSmilInsertNode(pstLayoutList, pstRootLayoutList, pstRegion);
-               } else
+               } else {
                        MSG_DEBUG("There is no attribute in <region> node");
+               }
 
                MSG_END();
                return true;
@@ -1754,13 +1755,13 @@ void MsgSmilParseNode(MMS_MESSAGE_DATA_S *pMmsMsg, xmlNode *a_node, int depth)
 
                                case ATTRIBUTE_VALUE:
 
-                                       if (paramType == ATTRIBUTE_SIZE && gCmd[ELEMENT_TEXT] && gMedia)
+                                       if (paramType == ATTRIBUTE_SIZE && gCmd[ELEMENT_TEXT] && gMedia) {
                                                gMedia->sMedia.sText.nSize = MsgSmilGetFontSizeValue((char *)pAttr->children->content);
-                                       else if (paramType == ATTRIBUTE_FGCOLOR && gCmd[ELEMENT_TEXT] && gMedia)
+                                       } else if (paramType == ATTRIBUTE_FGCOLOR && gCmd[ELEMENT_TEXT] && gMedia) {
                                                gMedia->sMedia.sText.nColor =  MsgSmilGetColorValue(pAttr->children->content);
-                                       else if (paramType == ATTRIBUTE_BGCOLOR && gCmd[ELEMENT_TEXT] && gMedia)
+                                       } else if (paramType == ATTRIBUTE_BGCOLOR && gCmd[ELEMENT_TEXT] && gMedia) {
                                                gMedia->sMedia.sText.nBgColor =  MsgSmilGetColorValue(pAttr->children->content);
-                                       else if (paramType == ATTRIBUTE_TEXTFORMAT && gCmd[ELEMENT_TEXT] && gMedia) {
+                                       else if (paramType == ATTRIBUTE_TEXTFORMAT && gCmd[ELEMENT_TEXT] && gMedia) {
                                                MmsSmilFontType fontType;
 
                                                fontType = MsgSmilGetFontTypeValue((char *)pAttr->children->content);
index 3aecc02..21cb34a 100755 (executable)
@@ -446,8 +446,7 @@ void MsgDbHandler::shm_mutex_timedlock(int sec)
        if (err == EOWNERDEAD) {
                err = pthread_mutex_consistent(mmapMx);
                MSG_DEBUG("Previous owner is dead with lock. Fix mutex");
-       }
-       else if (err != 0) {
+       } else if (err != 0) {
                MSG_FATAL("pthread_mutex_timedlock error [%d]", errno);
                return;
        }
index aa1ccb6..77acc47 100755 (executable)
@@ -604,8 +604,9 @@ int __MimeGetTableIndexString(const char *szMime)
                        type = __MimeGetMainTypeName(szType);
                        szTmpStart = &szTmpStart[i];
                        break;
-               } else
+               } else {
                        szType[j++] = c;
+               }
        }
 
        i = 0;
@@ -629,8 +630,9 @@ int __MimeGetTableIndexString(const char *szMime)
                        if (!strcasecmp(szSubType, "x"))
                                subtype = MIME_SUB_TYPE_X;
                        break;
-               } else
+               } else {
                        szSubType[j++] = c;
+               }
        }
 
 
index defb17c..735bb28 100755 (executable)
@@ -868,8 +868,8 @@ msg_error_t MsgStoClearConversationTable(MsgDbHandler *pDbHandle)
 
        memset(sqlQuery, 0x00, sizeof(sqlQuery));
 
-       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s \
-                       WHERE CONV_ID NOT IN (SELECT CONV_ID FROM %s) AND CONV_ID <> 0;",
+       snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s "
+                       "WHERE CONV_ID NOT IN (SELECT CONV_ID FROM %s) AND CONV_ID <> 0;",
                        MSGFW_CONVERSATION_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
 
        err = pDbHandle->execQuery(sqlQuery);
@@ -1407,8 +1407,7 @@ bool MsgExistAddress(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsg,  msg_thr
        if (err == MSG_ERR_DB_NORECORD) {
                pDbHandle->freeTable();
                return false;
-       }
-       else if (err != MSG_SUCCESS) {
+       } else if (err != MSG_SUCCESS) {
                pDbHandle->freeTable();
                return false;
        }
@@ -2359,8 +2358,7 @@ msg_error_t MsgStoGetMessageList(const MSG_LIST_CONDITION_S *pListCond, msg_stru
                memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "FROM %s C, %s B, %s A WHERE A.CONV_ID > 0 AND A.CONV_ID = B.CONV_ID AND ",
                        MSGFW_MMS_MULTIPART_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
-       }
-       else {
+       } else {
                memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),        "FROM %s B, %s A WHERE A.CONV_ID > 0 AND A.CONV_ID = B.CONV_ID AND ",
                MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
@@ -2476,8 +2474,7 @@ msg_error_t MsgStoGetMessageList(const MSG_LIST_CONDITION_S *pListCond, msg_stru
                                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
                                                "AND ((A.MSG_TEXT LIKE ? ESCAPE '%c' OR A.SUBJECT LIKE ? ESCAPE '%c' OR (C.NAME LIKE ? ESCAPE '%c' AND A.MSG_ID = C.MSG_ID AND C.CONTENT_TYPE <> 'application/smil'))) ",
                                                MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR);
-                       }
-                       else {
+                       } else {
                                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
                                                "AND ((A.MSG_TEXT LIKE ? ESCAPE '%c' OR A.SUBJECT LIKE ? ESCAPE '%c')) ",
                                                MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR);
@@ -2492,8 +2489,7 @@ msg_error_t MsgStoGetMessageList(const MSG_LIST_CONDITION_S *pListCond, msg_stru
                                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
                                                "AND ((A.MSG_TEXT LIKE ? ESCAPE '%c' OR A.SUBJECT LIKE ? ESCAPE '%c' OR (C.NAME LIKE ? ESCAPE '%c' AND A.MSG_ID = C.MSG_ID AND C.CONTENT_TYPE <> 'application/smil')) ",
                                                MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR);
-                       }
-                       else {
+                       } else {
                                snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
                                                "AND ((A.MSG_TEXT LIKE ? ESCAPE '%c' OR A.SUBJECT LIKE ? ESCAPE '%c') ",
                                                MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR);
index 6d5542e..3a8850c 100755 (executable)
@@ -261,8 +261,7 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                        *r = '\\';
                                        r++;
                                        *r = 'n';
-                               }
-                               else {
+                               } else {
                                        *r = *s;
                                }
                                break;
@@ -272,9 +271,9 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                str_len++;
                                if (*buf_size < str_len+len+1) {
                                        *buf_size = *buf_size * 2;
-                                       if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+                                       if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
                                                return -1;
-                                       else {
+                                       else {
                                                int pos_temp = r-(*buf+len);
                                                *buf = tmp;
                                                r = (char *)(*buf+len+pos_temp);
@@ -293,9 +292,9 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                str_len++;
                                if (*buf_size < str_len+len+1) {
                                        *buf_size = *buf_size * 2;
-                                       if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+                                       if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
                                                return -1;
-                                       else {
+                                       else {
                                                int pos_temp = r-(*buf+len);
                                                *buf = tmp;
                                                r = (char *)(*buf+len+pos_temp);
@@ -310,9 +309,9 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                        str_len++;
                                        if (*buf_size < str_len+len+1) {
                                                *buf_size = *buf_size * 2;
-                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
                                                        return -1;
-                                               else {
+                                               else {
                                                        int pos_temp = r-(*buf+len);
                                                        *buf = tmp;
                                                        r = (char *)(*buf+len+pos_temp);
@@ -324,17 +323,16 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                        s++;
                                        if (*buf_size < str_len+len+1) {
                                                *buf_size = *buf_size * 2;
-                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
                                                        return -1;
-                                               else {
+                                               else {
                                                        int pos_temp = r-(*buf+len);
                                                        *buf = tmp;
                                                        r = (char *)(*buf+len+pos_temp);
                                                }
                                        }
                                        *r = *s;
-                               }
-                               else {
+                               } else {
                                        *r = *s;
                                }
                                break;
@@ -345,9 +343,9 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                        str_len++;
                                        if (*buf_size < str_len+len+1) {
                                                *buf_size = *buf_size * 2;
-                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
                                                        return -1;
-                                               else {
+                                               else {
                                                        int pos_temp = r-(*buf+len);
                                                        *buf = tmp;
                                                        r = (char *)(*buf+len+pos_temp);
@@ -359,17 +357,16 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                                        s++;
                                        if (*buf_size < str_len+len+1) {
                                                *buf_size = *buf_size * 2;
-                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+                                               if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
                                                        return -1;
-                                               else {
+                                               else {
                                                        int pos_temp = r-(*buf+len);
                                                        *buf = tmp;
                                                        r = (char *)(*buf+len+pos_temp);
                                                }
                                        }
                                        *r = *s;
-                               }
-                               else {
+                               } else {
                                        *r = *s;
                                }
                                break;
@@ -381,8 +378,7 @@ static int __msgsvc_vmsg_append_str(char **buf, int *buf_size, int len, const ch
                        s++;
                }
                len_temp = str_len;
-       }
-       else {
+       } else {
                len_temp = snprintf(*buf+len, *buf_size-len+1, "%s", safe_str);
        }
        len += len_temp;
@@ -638,8 +634,7 @@ static inline int __msgsvc_vmsg_add_folding(char **buf, int *buf_size, int buf_l
                        if (NULL == (tmp = (char *)realloc(buf_copy, *buf_size))) {
                                free(buf_copy);
                                return -1;
-                       }
-                       else {
+                       } else {
                                buf_copy = tmp;
                                r = (buf_copy + result_len);
                        }
@@ -652,9 +647,9 @@ static inline int __msgsvc_vmsg_add_folding(char **buf, int *buf_size, int buf_l
                                encode_64 = true;
                }
 
-               if ('\r' == *s)
+               if ('\r' == *s) {
                        len--;
-               else if ('\n' == *s) {
+               else if ('\n' == *s) {
                        len = -1;
                        char_len = 0;
                        content_start = false;
@@ -1110,9 +1105,9 @@ char *MsgVMessageEncode(MSG_MESSAGE_INFO_S *pMsg)
                char* msgText = NULL;
 #if 0
                char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
-               if(pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
+               if(pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
                        pFileData = MsgOpenAndReadMmsFile(pMsg->msgData, 0, -1, &fileSize);
-               else {
+               else {
                        err = MsgStoGetMmsRawFilePath(pDbHandle, pMsg->msgId, filePath);
 
                        if (err != MSG_SUCCESS)
@@ -1431,8 +1426,7 @@ static inline char* __msgsvc_vmsg_translate_charset(char *src, int len)
                                val += sizeof("CHARSET");
                                break;
                        }
-               }
-               else if (':' == *val) {
+               } else if (':' == *val) {
                        return NULL;
                }
                val++;
@@ -1488,8 +1482,7 @@ static void __msgsvc_vmsg_get_prefix(char **prefix, char *src)
                long len = (long)temp - (long)src;
                *prefix = (char *)calloc(len+1, sizeof(char));
                snprintf(*prefix, len+1, "%s", src);
-       }
-       else {
+       } else {
                *prefix = NULL;
        }
 }
@@ -1548,8 +1541,7 @@ static char* __msgsvc_vmsg_get_val(int ver, char *src, char **prefix, char **des
 
                        cursor++;
                }
-       }
-       else {
+       } else {
                while (*cursor) {
                        if ('\r' == *cursor && '\n' == *(cursor+1) && ' ' != *(cursor+2))
                                break;
@@ -1564,8 +1556,7 @@ static char* __msgsvc_vmsg_get_val(int ver, char *src, char **prefix, char **des
        if (src == cursor) {
                *dest = NULL;
                return NULL;
-       }
-       else {
+       } else {
                int len = 0;
                char temp = *cursor;
                char *new_dest;
@@ -1604,9 +1595,9 @@ static int  __msgsvc_vmsg_check_content_type(char **vcard)
                        break;
        }
 
-       if (VMSG_MAXIMUM_VALUE == i)
+       if (VMSG_MAXIMUM_VALUE == i) {
                return VMSG_VALUE_NONE;
-       else {
+       else {
                *vcard = new_start;
                return i;
        }
@@ -1767,8 +1758,7 @@ static inline msg_error_t __msgsvc_vmsg_get_msg_box(MSG_MESSAGE_INFO_S *pMsg, ch
                pMsg->folderId = MSG_DRAFT_ID;
                pMsg->direction = MSG_DIRECTION_TYPE_MO;
                pMsg->networkStatus = MSG_NETWORK_NOT_SEND;
-       }
-       else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_INBOX]) == 0) {
+       } else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_INBOX]) == 0) {
                pMsg->folderId = MSG_INBOX_ID;
                pMsg->direction = MSG_DIRECTION_TYPE_MT;
                pMsg->networkStatus = MSG_NETWORK_RECEIVED;
@@ -1776,8 +1766,9 @@ static inline msg_error_t __msgsvc_vmsg_get_msg_box(MSG_MESSAGE_INFO_S *pMsg, ch
                pMsg->folderId = MSG_SENTBOX_ID;
                pMsg->direction = MSG_DIRECTION_TYPE_MO;
                pMsg->networkStatus = MSG_NETWORK_SEND_SUCCESS;
-       } else
+       } else {
                return MSG_ERR_INVALID_PARAMETER;
+       }
 
        MSG_DEBUG("pMsg->folderId = %d", pMsg->folderId);
        return MSG_SUCCESS;
@@ -1796,12 +1787,11 @@ static inline msg_error_t __msgsvc_vmsg_get_msg_type(MSG_MESSAGE_INFO_S *pMsg, c
                pMsg->msgType.mainType = MSG_SMS_TYPE;
                pMsg->msgType.subType = MSG_NORMAL_SMS;
                pMsg->msgType.classType = MSG_CLASS_NONE;
-       }
-       else if (strcmp(temp, content_name[VMSG_INDICATION_MESSAGE_TYPE_INET]) == 0) {
+       } else if (strcmp(temp, content_name[VMSG_INDICATION_MESSAGE_TYPE_INET]) == 0) {
                /* To do */
-       }
-       else
+       } else {
                return MSG_ERR_INVALID_PARAMETER;
+       }
 
        MSG_DEBUG("pMsg->msgType.subType = %d", pMsg->msgType.subType);
        return MSG_SUCCESS;
@@ -1984,9 +1974,9 @@ static inline msg_error_t __msgsvc_vmsg_get_msg(int ver, char *vmsg, MSG_MESSAGE
                                if (new_start) {
                                        cursor = new_start;
                                        continue;
-                               }
-                               else
+                               } else {
                                        break;
+                               }
                        }
                }
 
@@ -2041,8 +2031,9 @@ static inline msg_error_t __msgsvc_vmsg_get_msg(int ver, char *vmsg, MSG_MESSAGE
                                g_free(val);
                                g_free(prefix);
                                return MSG_SUCCESS;
-                       } else
+                       } else {
                                break;
+                       }
                default:
                        MSG_ERR("Invalid parameter : __msgsvc_vmsg_check_content_type() Failed(%d)", type);
                        g_free(val);