mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2062 (#5954)
Problem: Using dummy variable to compute struct member offset.
Solution: Use offsetof().
840268400d
This commit is contained in:
parent
340f79b4b8
commit
a062cd4ce5
@ -292,6 +292,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
|
/* for offsetof() */
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/spell.h"
|
#include "nvim/spell.h"
|
||||||
@ -583,8 +586,7 @@ typedef struct wordcount_S {
|
|||||||
char_u wc_word[1]; // word, actually longer
|
char_u wc_word[1]; // word, actually longer
|
||||||
} wordcount_T;
|
} wordcount_T;
|
||||||
|
|
||||||
static wordcount_T dumwc;
|
#define WC_KEY_OFF offsetof(wordcount_T, wc_word)
|
||||||
#define WC_KEY_OFF (unsigned)(dumwc.wc_word - (char_u *)&dumwc)
|
|
||||||
#define HI2WC(hi) ((wordcount_T *)((hi)->hi_key - WC_KEY_OFF))
|
#define HI2WC(hi) ((wordcount_T *)((hi)->hi_key - WC_KEY_OFF))
|
||||||
#define MAXWORDCOUNT 0xffff
|
#define MAXWORDCOUNT 0xffff
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ static int included_patches[] = {
|
|||||||
2065,
|
2065,
|
||||||
// 2064,
|
// 2064,
|
||||||
// 2063 NA
|
// 2063 NA
|
||||||
// 2062,
|
2062,
|
||||||
// 2061,
|
// 2061,
|
||||||
// 2060 NA
|
// 2060 NA
|
||||||
// 2059 NA
|
// 2059 NA
|
||||||
|
Loading…
Reference in New Issue
Block a user