revert: "refactor: use S_LEN macro" (#29319)

revert: "refactor: use S_LEN(s) instead of s, n (#29219)"

This reverts commit c37695a5d5.
This commit is contained in:
Lewis Russell
2024-06-13 22:20:06 +01:00
committed by GitHub
parent 6589d05894
commit 43d8435cf8
42 changed files with 258 additions and 263 deletions

View File

@@ -413,9 +413,9 @@ int spell_check_sps(void)
f = SPS_FAST;
} else if (strcmp(buf, "double") == 0) {
f = SPS_DOUBLE;
} else if (strncmp(buf, S_LEN("expr:")) != 0
&& strncmp(buf, S_LEN("file:")) != 0
&& (strncmp(buf, S_LEN("timeout:")) != 0
} else if (strncmp(buf, "expr:", 5) != 0
&& strncmp(buf, "file:", 5) != 0
&& (strncmp(buf, "timeout:", 8) != 0
|| (!ascii_isdigit(buf[8])
&& !(buf[8] == '-' && ascii_isdigit(buf[9]))))) {
f = -1;
@@ -543,7 +543,7 @@ void spell_suggest(int count)
msg_row = Rows - 1; // for when 'cmdheight' > 1
lines_left = Rows; // avoid more prompt
char *fmt = _("Change \"%.*s\" to:");
if (cmdmsg_rl && strncmp(fmt, S_LEN("Change")) == 0) {
if (cmdmsg_rl && strncmp(fmt, "Change", 6) == 0) {
// And now the rabbit from the high hat: Avoid showing the
// untranslated message rightleft.
fmt = ":ot \"%.*s\" egnahC";
@@ -792,7 +792,7 @@ static void spell_find_suggest(char *badptr, int badlen, suginfo_T *su, int maxc
for (char *p = sps_copy; *p != NUL;) {
copy_option_part(&p, buf, MAXPATHL, ",");
if (strncmp(buf, S_LEN("expr:")) == 0) {
if (strncmp(buf, "expr:", 5) == 0) {
// Evaluate an expression. Skip this when called recursively,
// when using spellsuggest() in the expression.
if (!expr_busy) {
@@ -800,10 +800,10 @@ static void spell_find_suggest(char *badptr, int badlen, suginfo_T *su, int maxc
spell_suggest_expr(su, buf + 5);
expr_busy = false;
}
} else if (strncmp(buf, S_LEN("file:")) == 0) {
} else if (strncmp(buf, "file:", 5) == 0) {
// Use list of suggestions in a file.
spell_suggest_file(su, buf + 5);
} else if (strncmp(buf, S_LEN("timeout:")) == 0) {
} else if (strncmp(buf, "timeout:", 8) == 0) {
// Limit the time searching for suggestions.
spell_suggest_timeout = atoi(buf + 8);
} else if (!did_intern) {