Problem: style: strcmp usage is inconsistent.
Solution: Always explicitly test the return value, matching the dominant
style.
closes: #19101
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
if (*address == NUL)
goto fail;
- if (!STRNCMP(address, "unix:", 5))
+ if (STRNCMP(address, "unix:", 5) == 0)
{
*unix_path = vim_strsave(address + 5);
return OK;
return NULL;
}
- if (!STRNCMP(address, "unix:", 5))
+ if (STRNCMP(address, "unix:", 5) == 0)
{
is_unix = TRUE;
address += 5;
return NULL;
}
- if (!STRNCMP(arg, "unix:", 5))
+ if (STRNCMP(arg, "unix:", 5) == 0)
{
is_unix = TRUE;
arg += 5;
{
if (*p == '=')
p = r = cin_skipcomment(p + 1);
- else if (!STRNCMP(p, "return", 6) && !vim_isIDc(p[6])
+ else if (STRNCMP(p, "return", 6) == 0 && !vim_isIDc(p[6])
&& (p == s || (p > s && !vim_isIDc(p[-1]))))
p = r = cin_skipcomment(p + 6);
else
--offset;
offset -= 1;
- if (!STRNCMP(line + offset, "if", 2))
+ if (STRNCMP(line + offset, "if", 2) == 0)
goto probablyFound;
if (offset >= 1)
{
offset -= 1;
- if (!STRNCMP(line + offset, "for", 3))
+ if (STRNCMP(line + offset, "for", 3) == 0)
goto probablyFound;
if (offset >= 2)
{
offset -= 2;
- if (!STRNCMP(line + offset, "while", 5))
+ if (STRNCMP(line + offset, "while", 5) == 0)
goto probablyFound;
}
}
{
int do_load = 1;
- if (!STRICMP(ext, ".bmp"))
+ if (STRICMP(ext, ".bmp") == 0)
sign.uType = IMAGE_BITMAP;
- else if (!STRICMP(ext, ".ico"))
+ else if (STRICMP(ext, ".ico") == 0)
sign.uType = IMAGE_ICON;
- else if (!STRICMP(ext, ".cur") || !STRICMP(ext, ".ani"))
+ else if (STRICMP(ext, ".cur") == 0 || STRICMP(ext, ".ani") == 0)
sign.uType = IMAGE_CURSOR;
else
do_load = 0;
gui.char_width * 2, gui.char_height,
LR_LOADFROMFILE | LR_CREATEDIBSECTION);
# ifdef FEAT_XPM_W32
- if (!STRICMP(ext, ".xpm"))
+ if (STRICMP(ext, ".xpm") == 0)
{
sign.uType = IMAGE_XPM;
LoadXpmImage((char *)signfile, (HBITMAP *)&sign.hImage,
prt_check_resource(struct prt_ps_resource_S *resource, char_u *version)
{
// Version number m.n should match, the revision number does not matter
- if (STRNCMP(resource->version, version, STRLEN(version)))
+ if (STRNCMP(resource->version, version, STRLEN(version)) != 0)
{
semsg(_(e_str_resource_file_has_wrong_version),
resource->name);
while (ptr2 < ptr3)
{
- if (STRCMP(*ptr1, *ptr2))
+ if (STRCMP(*ptr1, *ptr2) != 0)
*++ptr1 = *ptr2++;
else
{
// find entries with right mode and keys
match = (mp->m_mode & State)
&& qlen == len
- && !STRNCMP(q, ptr, (size_t)len);
+ && STRNCMP(q, ptr, (size_t)len) == 0;
if (q != mp->m_keys)
vim_free(q);
if (match)
|| (*s != '<'
&& last_msg_hist != NULL
&& last_msg_hist->msg != NULL
- && STRCMP(s, last_msg_hist->msg)))
+ && STRCMP(s, last_msg_hist->msg) != 0))
add_msg_hist((char_u *)s, -1, attr);
#ifdef FEAT_EVAL
for (off = (len2 > i ? i : len2); off > 0 && off + len1 > len2;)
{
--off;
- if (!STRNCMP(string + off, com_leader, len2 - off))
+ if (STRNCMP(string + off, com_leader, len2 - off) == 0)
{
if (i - off < lower_check_bound)
lower_check_bound = i - off;
// compare the first "len" chars from "ptr"
startp = skipwhite(p);
if (p_ic)
- matched = !MB_STRNICMP(startp, ptr, len);
+ matched = MB_STRNICMP(startp, ptr, len) == 0;
else
- matched = !STRNCMP(startp, ptr, len);
+ matched = STRNCMP(startp, ptr, len) == 0;
if (matched && define_matched && whole
&& vim_iswordc(startp[len]))
matched = FALSE;
continue;
len += (int)STRLEN(tv->vval.v_string) + 1; // Space for "\tVALUE"
- if (!STRCMP(dict_key, "name"))
+ if (STRCMP(dict_key, "name") == 0)
{
res_name = tv->vval.v_string;
continue;
}
- if (!STRCMP(dict_key, "filename"))
+ if (STRCMP(dict_key, "filename") == 0)
{
res_fname = tv->vval.v_string;
continue;
}
- if (!STRCMP(dict_key, "cmd"))
+ if (STRCMP(dict_key, "cmd") == 0)
{
res_cmd = tv->vval.v_string;
continue;
}
has_extra = 1;
- if (!STRCMP(dict_key, "kind"))
+ if (STRCMP(dict_key, "kind") == 0)
{
res_kind = tv->vval.v_string;
continue;
if (tv->v_type != VAR_STRING || tv->vval.v_string == NULL)
continue;
- if (!STRCMP(dict_key, "name"))
+ if (STRCMP(dict_key, "name") == 0)
continue;
- if (!STRCMP(dict_key, "filename"))
+ if (STRCMP(dict_key, "filename") == 0)
continue;
- if (!STRCMP(dict_key, "cmd"))
+ if (STRCMP(dict_key, "cmd") == 0)
continue;
- if (!STRCMP(dict_key, "kind"))
+ if (STRCMP(dict_key, "kind") == 0)
continue;
*p++ = TAB;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 686,
/**/
685,
/**/