aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-05-01 14:00:13 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-05-01 14:00:31 -0400
commit1b5217687abf8e1aeabaf4e5a64073177d56e593 (patch)
treece4bac12fff08088724bee38bee9d96d33bfe416 /src/buffer.c
parent3b77a62a77970a1c1aff5d50df396171ce24b464 (diff)
downloadrneovim-1b5217687abf8e1aeabaf4e5a64073177d56e593.tar.gz
rneovim-1b5217687abf8e1aeabaf4e5a64073177d56e593.tar.bz2
rneovim-1b5217687abf8e1aeabaf4e5a64073177d56e593.zip
revert #652
reverting broad cosmetic/style change because: - increases merge-conflicts - increases overhead of merging upstream Vim patches - reasons for change are ambiguous, so default to no change
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/buffer.c b/src/buffer.c
index c4455bfe8e..8723e31be3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -747,7 +747,7 @@ do_bufdel (
break;
} else { /* addr_count == 1 */
arg = skipwhite(arg);
- if (*arg == '\0')
+ if (*arg == NUL)
break;
if (!VIM_ISDIGIT(*arg)) {
p = skiptowhite_esc(arg);
@@ -1232,7 +1232,7 @@ void enter_buffer(buf_T *buf)
/* If there is no filetype, allow for detecting one. Esp. useful for
* ":ball" used in a autocommand. If there already is a filetype we
* might prefer to keep it. */
- if (*curbuf->b_p_ft == '\0')
+ if (*curbuf->b_p_ft == NUL)
did_filetype = FALSE;
open_buffer(FALSE, NULL, 0);
@@ -1265,7 +1265,7 @@ void enter_buffer(buf_T *buf)
(void)keymap_init();
/* May need to set the spell language. Can only do this after the buffer
* has been properly setup. */
- if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != '\0')
+ if (!curbuf->b_help && curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL)
(void)did_set_spelllang(curwin);
redraw_later(NOT_VALID);
@@ -1768,7 +1768,7 @@ buflist_findpat (
for (attempt = 0; attempt <= 3; ++attempt) {
/* may add '^' and '$' */
if (toggledollar)
- *patend = (attempt < 2) ? '\0' : '$'; /* add/remove '$' */
+ *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */
p = pat;
if (*p == '^' && !(attempt & 1)) /* add/remove '^' */
++p;
@@ -2227,7 +2227,7 @@ setfname (
struct stat st;
#endif
- if (ffname == NULL || *ffname == '\0') {
+ if (ffname == NULL || *ffname == NUL) {
/* Removing the name. */
vim_free(buf->b_ffname);
vim_free(buf->b_sfname);
@@ -2443,7 +2443,7 @@ static int otherfile_buf(buf_T *buf, char_u *ffname
)
{
/* no name is different */
- if (ffname == NULL || *ffname == '\0' || buf->b_ffname == NULL)
+ if (ffname == NULL || *ffname == NUL || buf->b_ffname == NULL)
return TRUE;
if (fnamecmp(ffname, buf->b_ffname) == 0)
return FALSE;
@@ -2653,7 +2653,7 @@ void maketitle(void)
}
t_str = buf;
- if (*p_titlestring != '\0') {
+ if (*p_titlestring != NUL) {
if (stl_syntax & STL_IN_TITLE) {
int use_sandbox = FALSE;
int save_called_emsg = called_emsg;
@@ -2714,7 +2714,7 @@ void maketitle(void)
vim_strncpy(buf + off, (char_u *)_("help"),
(size_t)(SPACE_FOR_DIR - off - 1));
else
- *p = '\0';
+ *p = NUL;
/* Translate unprintable chars and concatenate. Keep some
* room for the server name. When there is no room (very long
@@ -2745,7 +2745,7 @@ void maketitle(void)
if (p_icon) {
i_str = buf;
- if (*p_iconstring != '\0') {
+ if (*p_iconstring != NUL) {
if (stl_syntax & STL_IN_ICON) {
int use_sandbox = FALSE;
int save_called_emsg = called_emsg;
@@ -2766,7 +2766,7 @@ void maketitle(void)
i_name = buf_spname(curbuf);
else /* use file name only in icon */
i_name = path_tail(curbuf->b_ffname);
- *i_str = '\0';
+ *i_str = NUL;
/* Truncate name at 100 bytes. */
len = (int)STRLEN(i_name);
if (len > 100) {
@@ -2914,7 +2914,7 @@ build_stl_str_hl (
/* Get line & check if empty (cursorpos will show "0-1"). Note that
* p will become invalid when getting another buffer line. */
p = ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE);
- empty_line = (*p == '\0');
+ empty_line = (*p == NUL);
/* Get the byte value now, in case we need it below. This is more
* efficient than making a copy of the line. */
@@ -2939,22 +2939,22 @@ build_stl_str_hl (
break;
}
- if (*s != '\0' && *s != '%')
+ if (*s != NUL && *s != '%')
prevchar_isflag = prevchar_isitem = FALSE;
/*
* Handle up to the next '%' or the end.
*/
- while (*s != '\0' && *s != '%' && p + 1 < out + outlen)
+ while (*s != NUL && *s != '%' && p + 1 < out + outlen)
*p++ = *s++;
- if (*s == '\0' || p + 1 >= out + outlen)
+ if (*s == NUL || p + 1 >= out + outlen)
break;
/*
* Handle one '%' item.
*/
s++;
- if (*s == '\0') /* ignore trailing % */
+ if (*s == NUL) /* ignore trailing % */
break;
if (*s == '%') {
if (p + 1 >= out + outlen)
@@ -2984,7 +2984,7 @@ build_stl_str_hl (
groupdepth--;
t = item[groupitem[groupdepth]].start;
- *p = '\0';
+ *p = NUL;
l = vim_strsize(t);
if (curitem > groupitem[groupdepth] + 1
&& item[groupitem[groupdepth]].minwid == 0) {
@@ -3144,7 +3144,7 @@ build_stl_str_hl (
case STL_VIM_EXPR: /* '{' */
itemisflag = TRUE;
t = p;
- while (*s != '}' && *s != '\0' && p + 1 < out + outlen)
+ while (*s != '}' && *s != NUL && p + 1 < out + outlen)
*p++ = *s++;
if (*s != '}') /* missing '}' or out of space */
break;
@@ -3167,7 +3167,7 @@ build_stl_str_hl (
do_unlet((char_u *)"g:actual_curbuf", TRUE);
if (str != NULL && *str != 0) {
- if (*skipdigits(str) == '\0') {
+ if (*skipdigits(str) == NUL) {
num = atoi((char *)str);
vim_free(str);
str = NULL;
@@ -3194,7 +3194,7 @@ build_stl_str_hl (
case STL_VIRTCOL_ALT:
/* In list mode virtcol needs to be recomputed */
virtcol = wp->w_virtcol;
- if (wp->w_p_list && lcs_tab1 == '\0') {
+ if (wp->w_p_list && lcs_tab1 == NUL) {
wp->w_p_list = FALSE;
getvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL);
wp->w_p_list = TRUE;
@@ -3273,7 +3273,7 @@ build_stl_str_hl (
break;
case STL_FILETYPE:
- if (*wp->w_buffer->b_p_ft != '\0'
+ if (*wp->w_buffer->b_p_ft != NUL
&& STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 3) {
vim_snprintf((char *)tmp, sizeof(tmp), "[%s]",
wp->w_buffer->b_p_ft);
@@ -3283,7 +3283,7 @@ build_stl_str_hl (
case STL_FILETYPE_ALT:
itemisflag = TRUE;
- if (*wp->w_buffer->b_p_ft != '\0'
+ if (*wp->w_buffer->b_p_ft != NUL
&& STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 2) {
vim_snprintf((char *)tmp, sizeof(tmp), ",%s",
wp->w_buffer->b_p_ft);
@@ -3325,7 +3325,7 @@ build_stl_str_hl (
case STL_HIGHLIGHT:
t = s;
- while (*s != '#' && *s != '\0')
+ while (*s != '#' && *s != NUL)
++s;
if (*s == '#') {
item[curitem].type = Highlight;
@@ -3333,7 +3333,7 @@ build_stl_str_hl (
item[curitem].minwid = -syn_namen2id(t, (int)(s - t));
curitem++;
}
- if (*s != '\0')
+ if (*s != NUL)
++s;
continue;
}
@@ -3432,7 +3432,7 @@ build_stl_str_hl (
prevchar_isflag = FALSE; /* Item not NULL, but not a flag */
curitem++;
}
- *p = '\0';
+ *p = NUL;
itemcnt = curitem;
if (usefmt != fmt)
@@ -3497,7 +3497,7 @@ build_stl_str_hl (
while (++width < maxwidth) {
s = s + STRLEN(s);
*s++ = fillchar;
- *s = '\0';
+ *s = NUL;
}
--n; /* count the '<' */
@@ -4131,7 +4131,7 @@ chk_modeline (
scid_T save_SID;
prev = -1;
- for (s = ml_get(lnum); *s != '\0'; ++s) {
+ for (s = ml_get(lnum); *s != NUL; ++s) {
if (prev == -1 || vim_isspace(prev)) {
if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0)
|| STRNCMP(s, "vi:", (size_t)3) == 0)
@@ -4174,17 +4174,17 @@ chk_modeline (
end = FALSE;
while (end == FALSE) {
s = skipwhite(s);
- if (*s == '\0')
+ if (*s == NUL)
break;
/*
* Find end of set command: ':' or end of line.
* Skip over "\:", replacing it with ":".
*/
- for (e = s; *e != ':' && *e != '\0'; ++e)
+ for (e = s; *e != ':' && *e != NUL; ++e)
if (e[0] == '\\' && e[1] == ':')
STRMOVE(e, e + 1);
- if (*e == '\0')
+ if (*e == NUL)
end = TRUE;
/*
@@ -4201,9 +4201,9 @@ chk_modeline (
end = TRUE;
s = vim_strchr(s, ' ') + 1;
}
- *e = '\0'; /* truncate the set command */
+ *e = NUL; /* truncate the set command */
- if (*s != '\0') { /* skip over an empty "::" */
+ if (*s != NUL) { /* skip over an empty "::" */
save_SID = current_SID;
current_SID = SID_MODELINE;
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);