From a2ecceb9db901837d5b1c459f4e36e1982f3e42a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 30 Jul 2022 09:55:34 +0300 Subject: [PATCH 15/15] Correct comments using word "unsure" In most cases "ensure" was meant. See osdn #45273 Signed-off-by: Marko Lindqvist --- client/gui-gtk-2.0/chatline.c | 4 ++-- client/gui-gtk-3.0/chatline.c | 4 ++-- client/gui-gtk-3.22/chatline.c | 4 ++-- common/aicore/path_finding.c | 3 ++- utility/fc_utf8.c | 25 ++++++++++++------------- utility/registry_ini.c | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/client/gui-gtk-2.0/chatline.c b/client/gui-gtk-2.0/chatline.c index d939a36f86..b4c6a78257 100644 --- a/client/gui-gtk-2.0/chatline.c +++ b/client/gui-gtk-2.0/chatline.c @@ -1237,7 +1237,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 { @@ -1245,7 +1245,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-3.0/chatline.c b/client/gui-gtk-3.0/chatline.c index 10a207a0f1..58290796c1 100644 --- a/client/gui-gtk-3.0/chatline.c +++ b/client/gui-gtk-3.0/chatline.c @@ -1221,7 +1221,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 { @@ -1229,7 +1229,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-3.22/chatline.c b/client/gui-gtk-3.22/chatline.c index e33e448426..423d97ed7c 100644 --- a/client/gui-gtk-3.22/chatline.c +++ b/client/gui-gtk-3.22/chatline.c @@ -1225,7 +1225,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 { @@ -1233,7 +1233,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 686d172f57..c624576066 100644 --- a/common/aicore/path_finding.c +++ b/common/aicore/path_finding.c @@ -2217,11 +2217,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 29a0ba6d58..a02631566d 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) { @@ -448,9 +448,8 @@ size_t fc_utf8_strlen(const char *utf8_string) return len; } - /**************************************************************************** - 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 +465,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 +481,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 +504,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 +527,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 +545,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 +563,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 +591,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 +618,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 +648,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 26755a5f9f..73f3626576 100644 --- a/utility/registry_ini.c +++ b/utility/registry_ini.c @@ -3014,7 +3014,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