From 380ce86a7f0a9f70f9b152541c53e74c52863ef5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Apr 2019 01:50:49 +1000 Subject: Cleanup: comments (long lines) in avi, blf & blt --- source/blender/avi/AVI_avi.h | 12 ++++++++---- source/blender/blenfont/BLF_api.h | 4 ++-- source/blender/blenfont/intern/blf_thumbs.c | 6 +++--- source/blender/blentranslation/BLT_lang.h | 4 ++-- source/blender/blentranslation/BLT_translation.h | 11 ++++++----- source/blender/blentranslation/intern/blt_lang.c | 12 ++++++++---- source/blender/blentranslation/intern/blt_translation.c | 4 ++-- source/blender/blentranslation/msgfmt/msgfmt.c | 9 ++++++--- 8 files changed, 37 insertions(+), 25 deletions(-) (limited to 'source/blender') diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h index 86f0189343e..7b7f58506da 100644 --- a/source/blender/avi/AVI_avi.h +++ b/source/blender/avi/AVI_avi.h @@ -153,10 +153,14 @@ typedef struct _AviIndex { } AviIndex; typedef enum { - AVI_FORMAT_RGB24, /* The most basic of forms, 3 bytes per pixel, 1 per r, g, b */ - AVI_FORMAT_RGB32, /* The second most basic of forms, 4 bytes per pixel, 1 per r, g, b, alpha */ - AVI_FORMAT_AVI_RGB, /* Same as above, but is in the weird AVI order (bottom to top, left to right) */ - AVI_FORMAT_MJPEG, /* Motion-JPEG */ + /** The most basic of forms, 3 bytes per pixel, 1 per r, g, b. */ + AVI_FORMAT_RGB24, + /** The second most basic of forms, 4 bytes per pixel, 1 per r, g, b, alpha. */ + AVI_FORMAT_RGB32, + /** Same as above, but is in the weird AVI order (bottom to top, left to right). */ + AVI_FORMAT_AVI_RGB, + /** Motion-JPEG. */ + AVI_FORMAT_MJPEG, } AviFormat; typedef struct _AviStreamRec { diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index bf5ecd24269..60b27ead968 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -198,8 +198,8 @@ void BLF_buffer(int fontid, /* Set the color to be used for text. */ void BLF_buffer_col(int fontid, const float rgba[4]) ATTR_NONNULL(2); -/* Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_ - * it's not necessary set both buffer, NULL is valid here. +/* Draw the string into the buffer, this function draw in both buffer, + * float and unsigned char _BUT_ it's not necessary set both buffer, NULL is valid here. */ void BLF_draw_buffer_ex(int fontid, const char *str, size_t len, struct ResultBLF *r_info) ATTR_NONNULL(2); diff --git a/source/blender/blenfont/intern/blf_thumbs.c b/source/blender/blenfont/intern/blf_thumbs.c index f2036d2e4e9..f334511ac7a 100644 --- a/source/blender/blenfont/intern/blf_thumbs.c +++ b/source/blender/blenfont/intern/blf_thumbs.c @@ -106,9 +106,9 @@ void BLF_thumb_preview(const char *filename, font->pos[1] -= font->glyph_cache->ascender * 1.1f; - /* We fallback to default english strings in case not enough chars are available in current font for given - * translated string (useful in non-latin i18n context, like chinese, since many fonts will then show - * nothing but ugly 'missing char' in their preview). + /* We fallback to default english strings in case not enough chars are available in current font + * for given translated string (useful in non-latin i18n context, like chinese, + * since many fonts will then show nothing but ugly 'missing char' in their preview). * Does not handle all cases, but much better than nothing. */ if (blf_font_count_missing_chars(font, draw_str_i18n, draw_str_i18n_len, &draw_str_i18n_nbr) > diff --git a/source/blender/blentranslation/BLT_lang.h b/source/blender/blentranslation/BLT_lang.h index 544f2701258..6ce9a0ba71c 100644 --- a/source/blender/blentranslation/BLT_lang.h +++ b/source/blender/blentranslation/BLT_lang.h @@ -42,8 +42,8 @@ void BLT_lang_set(const char *); /* Get the current locale ([partial] ISO code, e.g. es_ES). */ const char *BLT_lang_get(void); -/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant, - * *variant and *language_variant will always be NULL). +/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. + * if there is no variant, *variant and *language_variant will always be NULL). * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them. * NOTE: Always available, even in non-WITH_INTERNATIONAL builds. */ diff --git a/source/blender/blentranslation/BLT_translation.h b/source/blender/blentranslation/BLT_translation.h index 5fdae83951c..c3667c364bc 100644 --- a/source/blender/blentranslation/BLT_translation.h +++ b/source/blender/blentranslation/BLT_translation.h @@ -86,11 +86,11 @@ bool BLT_lang_is_ime_supported(void); /* Default, void context. * WARNING! The "" context is not the same as no (NULL) context at mo/boost::locale level! - * NOTE: We translate BLT_I18NCONTEXT_DEFAULT as BLT_I18NCONTEXT_DEFAULT_BPY in Python, as we can't use "natural" - * None value in rna string properties... :/ + * NOTE: We translate BLT_I18NCONTEXT_DEFAULT as BLT_I18NCONTEXT_DEFAULT_BPY in Python, + * as we can't use "natural" None value in rna string properties... :/ * The void string "" is also interpreted as BLT_I18NCONTEXT_DEFAULT. - * For perf reason, we only use the first char to detect this context, so other contexts should never start - * with the same char! + * For perf reason, we only use the first char to detect this context, + * so other contexts should never start with the same char! */ #define BLT_I18NCONTEXT_DEFAULT NULL #define BLT_I18NCONTEXT_DEFAULT_BPYRNA "*" @@ -102,7 +102,8 @@ bool BLT_lang_is_ime_supported(void); * easy to get collisions with other areas...). */ #define BLT_I18NCONTEXT_UI_EVENTS "UI_Events_KeyMaps" -/* Mark the msgid applies to several elements (needed in some cases, as english adjectives have no plural mark :( ). */ +/* Mark the msgid applies to several elements + * (needed in some cases, as english adjectives have no plural mark :( ). */ #define BLT_I18NCONTEXT_PLURAL "Plural" /* ID-types contexts. */ diff --git a/source/blender/blentranslation/intern/blt_lang.c b/source/blender/blentranslation/intern/blt_lang.c index e8955235198..52d15a29fc2 100644 --- a/source/blender/blentranslation/intern/blt_lang.c +++ b/source/blender/blentranslation/intern/blt_lang.c @@ -118,7 +118,8 @@ static void fill_locales(void) /* And now, build locales and locale_menu! */ locales_menu = MEM_callocN(num_locales_menu * sizeof(EnumPropertyItem), __func__); line = lines; - /* Do not allocate locales with zero-sized mem, as LOCALE macro uses NULL locales as invalid marker! */ + /* Do not allocate locales with zero-sized mem, + * as LOCALE macro uses NULL locales as invalid marker! */ if (num_locales > 0) { locales = MEM_callocN(num_locales * sizeof(char *), __func__); while (line) { @@ -155,7 +156,8 @@ static void fill_locales(void) /* The DEFAULT/Automatic item... */ if (BLI_strnlen(loc, 2)) { locales[id] = ""; - /* Keep this tip in sync with the one in rna_userdef (rna_enum_language_default_items). */ + /* Keep this tip in sync with the one in rna_userdef + * (rna_enum_language_default_items). */ locales_menu[idx].description = BLI_strdup( "Automatically choose system's defined language " "if available, or fall-back to English"); @@ -307,10 +309,12 @@ const char *BLT_lang_get(void) #undef LOCALE #undef ULANGUAGE -/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant, +/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. + * if there is no variant, * *variant and *language_variant will always be NULL). * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them. - * NOTE: Keep that one always available, you never know, may become useful even in no-WITH_INTERNATIONAL context... + * NOTE: Keep that one always available, you never know, + * may become useful even in no-WITH_INTERNATIONAL context... */ void BLT_lang_locale_explode(const char *locale, char **language, diff --git a/source/blender/blentranslation/intern/blt_translation.c b/source/blender/blentranslation/intern/blt_translation.c index a4bac6bc01f..64e14522aca 100644 --- a/source/blender/blentranslation/intern/blt_translation.c +++ b/source/blender/blentranslation/intern/blt_translation.c @@ -61,8 +61,8 @@ const char *BLT_pgettext(const char *msgctxt, const char *msgid) msgctxt = BLT_I18NCONTEXT_DEFAULT; } ret = bl_locale_pgettext(msgctxt, msgid); - /* We assume if the returned string is the same (memory level) as the msgid, no translation was found, - * and we can try py scripts' ones! + /* We assume if the returned string is the same (memory level) as the msgid, + * no translation was found, and we can try py scripts' ones! */ # ifdef WITH_PYTHON if (ret == msgid) { diff --git a/source/blender/blentranslation/msgfmt/msgfmt.c b/source/blender/blentranslation/msgfmt/msgfmt.c index 6beaef74a9f..4ab0bd29a5f 100644 --- a/source/blender/blentranslation/msgfmt/msgfmt.c +++ b/source/blender/blentranslation/msgfmt/msgfmt.c @@ -24,8 +24,10 @@ * * Generate binary message catalog from textual translation description. * - * This program converts a textual Uniforum-style message catalog (.po file) into a binary GNU catalog (.mo file). - * This is essentially the same function as the GNU msgfmt program, however, it is a simpler implementation. + * This program converts a textual Uniforum-style message catalog (.po file) + * into a binary GNU catalog (.mo file). + * This is essentially the same function as the GNU msgfmt program, + * however, it is a simpler implementation. * * Usage: msgfmt input.po output.po */ @@ -206,7 +208,8 @@ static char *generate(GHash *messages, size_t *r_output_size) tot_vals_len += off->val_len + 1; } - /* The header is 7 32-bit unsigned integers. then comes the keys index table, then the values index table. */ + /* The header is 7 32-bit unsigned integers. + * Then comes the keys index table, then the values index table. */ const uint32_t idx_keystart = 7 * 4; const uint32_t idx_valstart = idx_keystart + 8 * num_keys; /* We don't use hash tables, so the keys start right after the index tables. */ -- cgit v1.2.3