mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix lint error
This commit is contained in:
parent
a5f36e24bb
commit
1984e784fb
@ -284,7 +284,7 @@ static hashtab_T buf_hashtab;
|
|||||||
|
|
||||||
static void buf_hashtab_add(buf_T *buf)
|
static void buf_hashtab_add(buf_T *buf)
|
||||||
{
|
{
|
||||||
sprintf((char *)buf->b_key, "%x", buf->b_fnum);
|
snprintf((char *)buf->b_key, sizeof(buf->b_key), "%x", buf->b_fnum);
|
||||||
if (hash_add(&buf_hashtab, buf->b_key) == FAIL) {
|
if (hash_add(&buf_hashtab, buf->b_key) == FAIL) {
|
||||||
EMSG(_("E931: Buffer cannot be registered"));
|
EMSG(_("E931: Buffer cannot be registered"));
|
||||||
}
|
}
|
||||||
@ -1388,7 +1388,7 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags)
|
|||||||
if (top_file_num == 1) {
|
if (top_file_num == 1) {
|
||||||
hash_init(&buf_hashtab);
|
hash_init(&buf_hashtab);
|
||||||
}
|
}
|
||||||
fname_expand(curbuf, &ffname, &sfname); /* will allocate ffname */
|
fname_expand(curbuf, &ffname, &sfname); // will allocate ffname
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If file name already exists in the list, update the entry.
|
* If file name already exists in the list, update the entry.
|
||||||
@ -2025,19 +2025,19 @@ static char_u *fname_match(regmatch_T *rmp, char_u *name, bool ignore_case)
|
|||||||
/// Find a file in the buffer list by buffer number.
|
/// Find a file in the buffer list by buffer number.
|
||||||
buf_T *buflist_findnr(int nr)
|
buf_T *buflist_findnr(int nr)
|
||||||
{
|
{
|
||||||
char_u key[SIZEOF_INT * 2 + 1];
|
char_u key[sizeof(handle_T) * 2 + 1];
|
||||||
hashitem_T *hi;
|
hashitem_T *hi;
|
||||||
|
|
||||||
if (nr == 0) {
|
if (nr == 0) {
|
||||||
nr = curwin->w_alt_fnum;
|
nr = curwin->w_alt_fnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf((char *)key, "%x", nr);
|
snprintf((char *)key, sizeof(key), "%x", nr);
|
||||||
hi = hash_find(&buf_hashtab, key);
|
hi = hash_find(&buf_hashtab, key);
|
||||||
|
|
||||||
if (!HASHITEM_EMPTY(hi)) {
|
if (!HASHITEM_EMPTY(hi)) {
|
||||||
return (buf_T *)(hi->hi_key
|
return (buf_T *)(hi->hi_key -
|
||||||
- ((unsigned)(curbuf->b_key - (char_u *)curbuf)));
|
((unsigned)(curbuf->b_key - (char_u *)curbuf)));
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -490,9 +490,8 @@ struct file_buffer {
|
|||||||
bool file_id_valid;
|
bool file_id_valid;
|
||||||
FileID file_id;
|
FileID file_id;
|
||||||
|
|
||||||
char_u b_key[SIZEOF_INT * 2 + 1]; // key used for buf_hashtab, holds
|
char_u b_key[sizeof(handle_T) * 2 + 1]; // key used for buf_hashtab, holds
|
||||||
// b_fnum as hex string
|
// b_fnum as hex string
|
||||||
|
|
||||||
int b_changed; // 'modified': Set to true if something in the
|
int b_changed; // 'modified': Set to true if something in the
|
||||||
// file has been changed and not written out.
|
// file has been changed and not written out.
|
||||||
int b_changedtick; // incremented for each change, also for undo
|
int b_changedtick; // incremented for each change, also for undo
|
||||||
|
Loading…
Reference in New Issue
Block a user