From 70f52ea03de0cf1da6ff98508adf82c3af999d3b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 30 Jul 2022 09:49:16 +0300 Subject: [PATCH 51/51] Correct comments using word "unsure" In most cases "ensure" was meant. See osdn #45273 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/chatline.c | 4 ++-- client/gui-gtk-4.0/chatline.c | 4 ++-- common/aicore/path_finding.c | 3 ++- utility/fc_utf8.c | 24 ++++++++++++------------ utility/registry_ini.c | 2 +- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/client/gui-gtk-3.22/chatline.c b/client/gui-gtk-3.22/chatline.c index 75888b382c..a82db64f3e 100644 --- a/client/gui-gtk-3.22/chatline.c +++ b/client/gui-gtk-3.22/chatline.c @@ -1224,7 +1224,7 @@ static gboolean set_toolbar_visibility(GtkWidget *w, /* button_toggled() will be called and the toolbar shown. */ gtk_toggle_button_set_active(button, TRUE); } else { - /* Unsure the widget is visible. */ + /* Ensure the widget is visible. */ gtk_widget_show(ptoolkit->toolbar); } } else { @@ -1232,7 +1232,7 @@ static gboolean set_toolbar_visibility(GtkWidget *w, /* button_toggled() will be called and the toolbar hidden. */ gtk_toggle_button_set_active(button, FALSE); } else { - /* Unsure the widget is visible. */ + /* Ensure the widget is not visible. */ gtk_widget_hide(ptoolkit->toolbar); } } diff --git a/client/gui-gtk-4.0/chatline.c b/client/gui-gtk-4.0/chatline.c index 8a839167bf..63f8ac500c 100644 --- a/client/gui-gtk-4.0/chatline.c +++ b/client/gui-gtk-4.0/chatline.c @@ -1242,7 +1242,7 @@ static gboolean set_toolbar_visibility(GtkWidget *w, /* button_toggled() will be called and the toolbar shown. */ gtk_toggle_button_set_active(button, TRUE); } else { - /* Unsure the widget is visible. */ + /* Ensure the widget is visible. */ gtk_widget_show(ptoolkit->toolbar); } } else { @@ -1250,7 +1250,7 @@ static gboolean set_toolbar_visibility(GtkWidget *w, /* button_toggled() will be called and the toolbar hidden. */ gtk_toggle_button_set_active(button, FALSE); } else { - /* Unsure the widget is visible. */ + /* Ensure the widget is not visible. */ gtk_widget_hide(ptoolkit->toolbar); } } diff --git a/common/aicore/path_finding.c b/common/aicore/path_finding.c index 90e1d790c0..8d05f4da2f 100644 --- a/common/aicore/path_finding.c +++ b/common/aicore/path_finding.c @@ -2224,11 +2224,12 @@ static inline bool pf_fuel_node_dangerous(const struct pf_fuel_node *node) static inline struct pf_fuel_pos *pf_fuel_pos_ref(struct pf_fuel_pos *pos) { #ifdef PF_DEBUG - /* Unsure we have enough space to store the new count. Maximum is 10 + /* Assert we have enough space to store the new count. Maximum is 10 * (node->pos, node->segment, and 8 for other_pos->prev). */ fc_assert(15 > pos->ref_count); #endif pos->ref_count++; + return pos; } diff --git a/utility/fc_utf8.c b/utility/fc_utf8.c index 786931d1b6..726efa4180 100644 --- a/utility/fc_utf8.c +++ b/utility/fc_utf8.c @@ -201,7 +201,7 @@ bool fc_utf8_char_validate(const char *utf8_char) Jump to next UTF-8 character start. NB: This function can return a invalid UTF-8 character. Check with - fc_utf8_char_validate() to unsure. + fc_utf8_char_validate() to ensure. ****************************************************************************/ char *fc_utf8_find_next_char(const char *utf8_char) { @@ -218,7 +218,7 @@ char *fc_utf8_find_next_char(const char *utf8_char) pointer. If no character is found, returns 'utf8_string'. NB: This function can return a invalid UTF-8 character. Check with - fc_utf8_char_validate() to unsure. + fc_utf8_char_validate() to ensure. ****************************************************************************/ char *fc_utf8_find_prev_char(const char *utf8_char, const char *utf8_string) { @@ -450,7 +450,7 @@ size_t fc_utf8_strlen(const char *utf8_string) /************************************************************************//** - This is a variant of fc_strlcpy() to unsure the result will be a valid + This is a variant of fc_strlcpy() to ensure the result will be a valid UTF-8 string. It truncates the string at the first UTF-8 invalid character. @@ -466,7 +466,7 @@ size_t fc_utf8_strlcpy_trunc(char *dest, const char *src, size_t n) } /************************************************************************//** - This is a variant of fc_strlcpy() to unsure the result will be a valid + This is a variant of fc_strlcpy() to ensure the result will be a valid UTF-8 string. Unlike fc_utf8_strlcpy_trunc(), it replaces the invalid characters by the replacement character, instead of truncating the string. @@ -482,7 +482,7 @@ size_t fc_utf8_strlcpy_rep(char *dest, const char *src, size_t n) } /************************************************************************//** - This is a variant of fc_strlcat() to unsure the result will be a valid + This is a variant of fc_strlcat() to ensure the result will be a valid UTF-8 string. It truncates the string at the first UTF-8 invalid character. @@ -505,7 +505,7 @@ size_t fc_utf8_strlcat_trunc(char *dest, const char *src, size_t n) } /************************************************************************//** - This is a variant of fc_strlcat() to unsure the result will be a valid + This is a variant of fc_strlcat() to ensure the result will be a valid UTF-8 string. Unlike fc_utf8_strlcat_trunc(), it replaces the invalid characters by the replacement character, instead of truncating the string. @@ -528,7 +528,7 @@ size_t fc_utf8_strlcat_rep(char *dest, const char *src, size_t n) } /************************************************************************//** - This is a variant of fc_snprintf() to unsure the result will be a valid + This is a variant of fc_snprintf() to ensure the result will be a valid UTF-8 string. It truncates the string at the first UTF-8 invalid character. @@ -546,7 +546,7 @@ int fc_utf8_snprintf_trunc(char *str, size_t n, const char *format, ...) } /************************************************************************//** - This is a variant of fc_snprintf() to unsure the result will be a valid + This is a variant of fc_snprintf() to ensure the result will be a valid UTF-8 string. Unlike fc_utf8_snprintf_trunc(), it replaces the invalid characters by the replacement character, instead of truncating the string. @@ -564,7 +564,7 @@ int fc_utf8_snprintf_rep(char *str, size_t n, const char *format, ...) } /************************************************************************//** - This is a variant of fc_vsnprintf() to unsure the result will be a valid + This is a variant of fc_vsnprintf() to ensure the result will be a valid UTF-8 string. It truncates the string at the first UTF-8 invalid character. @@ -592,7 +592,7 @@ int fc_utf8_vsnprintf_trunc(char *str, size_t n, const char *format, } /************************************************************************//** - This is a variant of fc_vsnprintf() to unsure the result will be a valid + This is a variant of fc_vsnprintf() to ensure the result will be a valid UTF-8 string. Unlike fc_utf8_vsnprintf_trunc(), it replaces the invalid characters by the replacement character, instead of truncating the string. @@ -619,7 +619,7 @@ int fc_utf8_vsnprintf_rep(char *str, size_t n, const char *format, } /************************************************************************//** - This is a variant of cat_snprintf() to unsure the result will be a valid + This is a variant of cat_snprintf() to ensure the result will be a valid UTF-8 string. It truncates the string at the first UTF-8 invalid character. @@ -649,7 +649,7 @@ int cat_utf8_snprintf_trunc(char *str, size_t n, const char *format, ...) } /************************************************************************//** - This is a variant of cat_snprintf() to unsure the result will be a valid + This is a variant of cat_snprintf() to ensure the result will be a valid UTF-8 string. Unlike cat_utf8_snprintf_trunc(), it replaces the invalid characters by the replacement character, instead of truncating the string. diff --git a/utility/registry_ini.c b/utility/registry_ini.c index 2ecb90309f..e466a91af5 100644 --- a/utility/registry_ini.c +++ b/utility/registry_ini.c @@ -3076,7 +3076,7 @@ struct entry *section_entry_lookup(const struct section *psection, /* Try with full path. */ if ((pentry = secfile_entry_by_path(psection->secfile, fullpath)) && psection == entry_section(pentry)) { - /* Unsure this is really owned by this section. */ + /* Ensured this is really owned by this section. */ return pentry; } -- 2.35.1