Add space if statement in example code 54/311754/5 accepted/tizen/8.0/unified/20240530.161328
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 May 2024 07:40:30 +0000 (16:40 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 28 May 2024 07:57:14 +0000 (16:57 +0900)
Change-Id: I5448980dc1fc47ee32fb2e122de93a3c9abbd035
Signed-off-by: JinWang An <jinwang.an@samsung.com>
src/include/utils_i18n_timezone.h
src/include/utils_i18n_ucnv.h
src/include/utils_i18n_ucnvsel.h
src/include/utils_i18n_udate.h
src/include/utils_i18n_udatepg.h
src/include/utils_i18n_ulocale.h
src/include/utils_i18n_unumsys.h
src/include/utils_i18n_uset.h

index 66e0d19..0693a92 100644 (file)
@@ -80,7 +80,7 @@ extern "C" {
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_create_unknown(&timezone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating unknown timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
@@ -88,8 +88,8 @@ extern "C" {
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created unknown timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -119,7 +119,7 @@ int i18n_timezone_create_unknown(i18n_timezone_h *timezone);
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_create_gmt(&timezone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating GMT timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
@@ -127,8 +127,8 @@ int i18n_timezone_create_unknown(i18n_timezone_h *timezone);
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created gmt timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -156,7 +156,7 @@ int i18n_timezone_create_gmt(i18n_timezone_h *timezone);
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_create(&timezone, "Asia/Seoul");
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
@@ -164,8 +164,8 @@ int i18n_timezone_create_gmt(i18n_timezone_h *timezone);
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -270,7 +270,7 @@ int i18n_timezone_count_equivalent_ids(const char *timezone_id, int32_t *count);
  * @param[in] timezone_id a system time zone ID
  * @param[in] index a value from 0 to n-1, where n is the out parameter value from i18n_timezone_count_equivalent_ids(timezone_id, &n)
  * @param[out] equivalent_timezone_id the ID of the index-th zone in the equivalency group containing 'timezone_id',
- *                        or an empty string if 'timezone_id' is not a valid system ID or 'index' is out of range
+ *                        or an empty string if 'timezone_id' is not a valid system ID or 'index' is out of range
  *
  * @retval #I18N_ERROR_NONE Successful
  * @see i18n_timezone_count_equivalent_ids()
@@ -284,7 +284,7 @@ int i18n_timezone_count_equivalent_ids(const char *timezone_id, int32_t *count);
  *     int32_t index = 0;
  *     char *equivalent_timezone_id;
  *     ret = i18n_timezone_get_equivalent_id(timezone_id, index, &equivalent_timezone_id);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
@@ -326,15 +326,15 @@ int i18n_timezone_get_equivalent_id(const char *timezone_id, int32_t index, char
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_create_default(&timezone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating default timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created default timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -404,8 +404,8 @@ int i18n_timezone_get_offset_with_date(i18n_timezone_h timezone, i18n_udate date
 
 /**
  * @brief Sets the i18n_timezone_h's raw GMT offset
- *       (i.e., the number of milliseconds to add to GMT to get local time, before taking daylight savings time into account).
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *        (i.e., the number of milliseconds to add to GMT to get local time, before taking daylight savings time into account).
+ * @since_tizen 2.3
  *
  * @param[in] timezone The i18n_timezone_h to set a raw offset.
  * @param[in] offset_milliseconds The new raw GMT offset for this time zone.
@@ -446,7 +446,7 @@ int i18n_timezone_get_raw_offset(i18n_timezone_h timezone, int32_t *offset_milli
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_create(&timezone, "Asia/Seoul");
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
@@ -454,8 +454,8 @@ int i18n_timezone_get_raw_offset(i18n_timezone_h timezone, int32_t *offset_milli
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -508,13 +508,13 @@ int i18n_timezone_set_id(i18n_timezone_h timezone, const char *timezone_id);
  *     for(; gmt < 15; gmt++) {
  *             snprintf(timezone_id, 10, (gmt<0)? "GMT%d:00" : "GMT+%d:00", gmt);
  *             error_code = i18n_timezone_create(&timezone, timezone_id);
- *             if (error_code!= I18N_ERROR_NONE) {
+ *             if (error_code != I18N_ERROR_NONE) {
  *                     printf("Error i18n_timezone_create: %d\n", error_code);
  *                     return EXIT_FAILURE;
  *             }
  *
  *             error_code = i18n_timezone_get_display_name(timezone, &display_name);
- *             if (error_code!= I18N_ERROR_NONE) {
+ *             if (error_code != I18N_ERROR_NONE) {
  *                     printf("Error i18n_timezone_get_display_name: %d\n", error_code);
  *                     i18n_timezone_destroy(timezone);
  *                     return EXIT_FAILURE;
@@ -522,7 +522,6 @@ int i18n_timezone_set_id(i18n_timezone_h timezone, const char *timezone_id);
  *             printf("Created %s timezone display_name: %s\n", timezone_id, display_name);
  *             free(display_name);
  *             i18n_timezone_destroy(timezone);
- *             timezone = NULL;
  *     }
  *
  *     return EXIT_SUCCESS;
@@ -562,13 +561,13 @@ int i18n_timezone_get_display_name(i18n_timezone_h timezone, char **display_name
  *     for(; gmt < 15; gmt++) {
  *             snprintf(timezone_id, 10, (gmt<0)? "GMT%d:00" : "GMT+%d:00", gmt);
  *             error_code = i18n_timezone_create(&timezone, timezone_id);
- *             if (error_code!= I18N_ERROR_NONE) {
+ *             if (error_code != I18N_ERROR_NONE) {
  *                     printf("Error i18n_timezone_create: %d\n", error_code);
  *                     return EXIT_FAILURE;
  *             }
  *
  *             error_code = i18n_timezone_get_display_name_with_locale(timezone, language, country, &display_name);
- *             if (error_code!= I18N_ERROR_NONE) {
+ *             if (error_code != I18N_ERROR_NONE) {
  *                     printf("Error i18n_timezone_get_display_name_with_locale: %d\n", error_code);
  *                     i18n_timezone_destroy(timezone);
  *                     return EXIT_FAILURE;
@@ -577,7 +576,6 @@ int i18n_timezone_get_display_name(i18n_timezone_h timezone, char **display_name
  *             free(display_name);
  *
  *             i18n_timezone_destroy(timezone);
- *             timezone = NULL;
  *     }
  *
  *     return EXIT_SUCCESS;
@@ -617,24 +615,23 @@ int i18n_timezone_get_display_name_with_locale(i18n_timezone_h timezone, const c
  *             type = I18N_TIMEZONE_DISPLAY_TYPE_SHORT;
  *             snprintf(timezone_id, 10, (gmt<0)? "GMT%d:00" : "GMT+%d:00", gmt);
  *             error_code = i18n_timezone_create(&timezone, timezone_id);
- *             if (error_code!= I18N_ERROR_NONE) {
+ *             if (error_code != I18N_ERROR_NONE) {
  *                     printf("Error i18n_timezone_create: %d\n", error_code);
  *                     return EXIT_FAILURE;
  *             }
  *
  *             for(; type <= I18N_TIMEZONE_DISPLAY_TYPE_GENERIC_LOCATION; type++) {
  *                     error_code = i18n_timezone_get_display_name_with_type(timezone, daylight, type, &display_name);
- *                     if (error_code!= I18N_ERROR_NONE) {
+ *                     if (error_code != I18N_ERROR_NONE) {
  *                             printf("Error i18n_timezone_get_display_name_with_type: %d\n", error_code);
  *                             i18n_timezone_destroy(timezone);
  *                             return EXIT_FAILURE;
  *                     }
  *                     printf("Created %s timezone display_name: %s\n", timezone_id, display_name);
- *             free(display_name);
+ *                     free(display_name);
  *             }
  *
  *             error_code = i18n_timezone_destroy(timezone);
- *             timezone = NULL;
  *     }
  *
  *     return EXIT_SUCCESS;
@@ -675,13 +672,13 @@ int i18n_timezone_get_display_name_with_type(i18n_timezone_h timezone, i18n_uboo
  *     char *display_name;
  *
  *     error_code = i18n_timezone_create_default(&timezone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating default timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
  *
  *     error_code = i18n_timezone_get_display_name_with_type_locale(timezone, daylight, style, language, country, &display_name);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_timezone_get_display_name_with_type_locale: %d\n", error_code);
  *             i18n_timezone_destroy(timezone);
  *             return EXIT_FAILURE;
@@ -690,9 +687,9 @@ int i18n_timezone_get_display_name_with_type(i18n_timezone_h timezone, i18n_uboo
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created %s timezone display_name: %s\n", timezone_id, display_name);
  *
- *     i18n_timezone_destroy(timezone);
- *     free(display_name);
  *     free(timezone_id);
+ *     free(display_name);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -745,13 +742,13 @@ int i18n_timezone_has_same_rule(i18n_timezone_h timezone, i18n_timezone_h other,
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_create_default(&timezone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating default timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
  *
  *     error_code = i18n_timezone_clone(timezone, &clone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_timezone_get_display_name_with_type_locale: %d\n", error_code);
  *             i18n_timezone_destroy(timezone);
  *             return EXIT_FAILURE;
@@ -760,9 +757,9 @@ int i18n_timezone_has_same_rule(i18n_timezone_h timezone, i18n_timezone_h other,
  *     i18n_timezone_get_id(clone, &timezone_id);
  *     printf("Created clone timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
- *     i18n_timezone_destroy(clone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(clone);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
@@ -810,7 +807,7 @@ int i18n_timezone_get_dst_savings(i18n_timezone_h timezone, int32_t *dst_savings
  *     char *timezone_id = NULL;
  *
  *     error_code = i18n_timezone_detect_host_timezone(&timezone);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error creating timezone: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
@@ -818,8 +815,8 @@ int i18n_timezone_get_dst_savings(i18n_timezone_h timezone, int32_t *dst_savings
  *     i18n_timezone_get_id(timezone, &timezone_id);
  *     printf("Created timezone: %s\n", timezone_id);
  *
- *     i18n_timezone_destroy(timezone);
  *     free(timezone_id);
+ *     i18n_timezone_destroy(timezone);
  *
  *     return EXIT_SUCCESS;
  * }
index 61c8015..8b7c81f 100644 (file)
@@ -299,8 +299,8 @@ int i18n_ucnv_create_package(const char *package_name, const char *converter_nam
  *             i18n_ucnv_destroy(converter);
  *             return EXIT_FAILURE;
  *     }
- *     i18n_ucnv_destroy(converter);
  *     i18n_ucnv_destroy(cloned_converter);
+ *     i18n_ucnv_destroy(converter);
  *     return EXIT_SUCCESS;
  * }
  * @endcode
index 93b838b..8ca993e 100644 (file)
@@ -209,13 +209,13 @@ int i18n_ucnvsel_select_for_string(const i18n_uconverter_selector_h sel, const i
  *     error_code = i18n_ucnvsel_select_for_utf8(sel, string, strlen(string), &enumeration);
  *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_ucnvsel_select_for_utf8: %d\n", error_code);
- *     i18n_uset_destroy(excluded_set);
  *             i18n_ucnvsel_destroy(sel);
+ *             i18n_uset_destroy(excluded_set);
  *             return EXIT_FAILURE;
  *     }
  *
- *     i18n_uset_destroy(excluded_set);
  *     i18n_ucnvsel_destroy(sel);
+ *     i18n_uset_destroy(excluded_set);
  *     return EXIT_SUCCESS;
  * }
  * @endcode
index f0c1683..08f75a7 100644 (file)
 
        dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_destroy\n");
        // destroy an i18n_udate_format_h
-       i18n_udate_destroy(formatter_KR);
-       i18n_udate_destroy(formatter_LA);
        i18n_udate_destroy(formatter_SaoPaulo);
+       i18n_udate_destroy(formatter_LA);
+       i18n_udate_destroy(formatter_KR);
  * @endcode
  */
 
index 21953d4..83c4249 100644 (file)
@@ -643,20 +643,20 @@ int32_t i18n_udatepg_replace_field_types_with_options(i18n_udatepg_h dtpg, const
  * #include <utils_i18n.h>
  * int main() {
  *     i18n_error_code_e error_code;
- *     i18n_uenumeration_h skeletons = NULL;
+ *     i18n_uenumeration_h enumeration = NULL;
  *     i18n_udatepg_h dtpg = NULL;
  *     error_code = i18n_udatepg_create_empty(&dtpg);
  *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_udatepg_create_empty: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
- *     error_code = i18n_udatepg_skeletons_create(dtpg, &skeletons);
+ *     error_code = i18n_udatepg_skeletons_create(dtpg, &enumeration);
  *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_udatepg_skeletons_create: %d\n", error_code);
  *             i18n_udatepg_destroy(dtpg);
  *             return EXIT_FAILURE;
  *     }
- *     i18n_uenumeration_destroy(skeletons);
+ *     i18n_uenumeration_destroy(enumeration);
  *     i18n_udatepg_destroy(dtpg);
  *     return EXIT_SUCCESS;
  * }
index 93bdd5e..ce1295a 100644 (file)
@@ -745,11 +745,11 @@ int32_t i18n_ulocale_get_keyword_value(const char *locale_id, const char *keywor
  *       dlog_print(DLOG_DEBUG, "test", "Locale: %s", only_locale);
  *       dlog_print(DLOG_DEBUG, "test", "Keyword1 value: %s", buff_out);
  *
+ *       free(buff_out);
+ *       free(only_locale);
  *       i18n_uenumeration_destroy(keyword_enum)
- *       free(buff);
  *       free(sub_buff);
- *       free(only_locale);
- *       free(buff_out);
+ *       free(buff);
  * @endcode
  * @remarks The specific error code can be obtained using the get_last_result() method.
  *                     Error codes are described in Exceptions section and #i18n_error_code_e description.
index a23c257..5d85973 100644 (file)
@@ -126,7 +126,7 @@ void i18n_unumsys_destroy(i18n_unumsys_h unumsys);
  *     i18n_error_code_e error_code;
  *     i18n_uenumeration_h uenum;
  *     error_code = i18n_unumsys_get_available_names(&uenum);
- *     if (error_code!= I18N_ERROR_NONE) {
+ *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_unumsys_get_available_names: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
index 0304a91..a93f463 100644 (file)
@@ -319,7 +319,7 @@ int i18n_uset_freeze(i18n_uset_h set);
  * #include <utils_i18n.h>
  * int main() {
  *     i18n_uset_h set = NULL;
- *     i18n_uset_h set_clone = NULL;
+ *     i18n_uset_h set_copy = NULL;
  *     i18n_uchar32 start = 0x41;
  *     i18n_uchar32 end = 0x50;
  *     i18n_error_code_e error_code;
@@ -329,14 +329,14 @@ int i18n_uset_freeze(i18n_uset_h set);
  *             printf("Error i18n_uset_create: %d\n", error_code);
  *             return EXIT_FAILURE;
  *     }
- *     error_code = i18n_uset_clone_as_thawed(set, &set_clone);
+ *     error_code = i18n_uset_clone_as_thawed(set, &set_copy);
  *     if (error_code != I18N_ERROR_NONE) {
  *             printf("Error i18n_uset_clone_as_thawed: %d\n", error_code);
  *             i18n_uset_destroy(set);
  *             return EXIT_FAILURE;
  *     }
+ *     i18n_uset_destroy(set_copy);
  *     i18n_uset_destroy(set);
- *     i18n_uset_destroy(set_clone);
  *     return EXIT_SUCCESS;
  * }
  * @endcode