mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Remove project int types: Case short_u: Replace with uint16_t.
- Replace short_u with uint16_t (same size, should give no problems). - When possible, remove explicit downcasts so that they are found when flag -Wconversion enabled. - Remove short_u typedef. Requested in #459.
This commit is contained in:
parent
37935130f9
commit
cb7fb8c008
@ -378,7 +378,7 @@ typedef struct {
|
||||
synstate_T *b_sst_firstfree;
|
||||
int b_sst_freecount;
|
||||
linenr_T b_sst_check_lnum;
|
||||
short_u b_sst_lasttick; /* last display tick */
|
||||
uint16_t b_sst_lasttick; /* last display tick */
|
||||
|
||||
/* for spell checking */
|
||||
garray_T b_langp; /* list of pointers to slang_T, see spell.c */
|
||||
@ -774,7 +774,7 @@ struct tabpage_S {
|
||||
*/
|
||||
typedef struct w_line {
|
||||
linenr_T wl_lnum; /* buffer line number for logical line */
|
||||
short_u wl_size; /* height in screen lines */
|
||||
uint16_t wl_size; /* height in screen lines */
|
||||
char wl_valid; /* TRUE values are valid for text in buffer */
|
||||
char wl_folded; /* TRUE when this is a range of folded lines */
|
||||
linenr_T wl_lastlnum; /* last buffer line number for logical line */
|
||||
|
@ -100,9 +100,9 @@ struct pointer_entry {
|
||||
* A pointer block contains a list of branches in the tree.
|
||||
*/
|
||||
struct pointer_block {
|
||||
short_u pb_id; /* ID for pointer block: PTR_ID */
|
||||
short_u pb_count; /* number of pointers in this block */
|
||||
short_u pb_count_max; /* maximum value for pb_count */
|
||||
uint16_t pb_id; /* ID for pointer block: PTR_ID */
|
||||
uint16_t pb_count; /* number of pointers in this block */
|
||||
uint16_t pb_count_max; /* maximum value for pb_count */
|
||||
PTR_EN pb_pointer[1]; /* list of pointers to blocks (actually longer)
|
||||
* followed by empty space until end of page */
|
||||
};
|
||||
@ -115,7 +115,7 @@ struct pointer_block {
|
||||
* etc. Thus the order of the lines is the opposite of the line number.
|
||||
*/
|
||||
struct data_block {
|
||||
short_u db_id; /* ID for data block: DATA_ID */
|
||||
uint16_t db_id; /* ID for data block: DATA_ID */
|
||||
unsigned db_free; /* free space available */
|
||||
unsigned db_txt_start; /* byte where text starts */
|
||||
unsigned db_txt_end; /* byte just after data block */
|
||||
@ -3011,8 +3011,7 @@ static bhdr_T *ml_new_ptr(memfile_T *mfp)
|
||||
pp = (PTR_BL *)(hp->bh_data);
|
||||
pp->pb_id = PTR_ID;
|
||||
pp->pb_count = 0;
|
||||
pp->pb_count_max = (short_u)((mfp->mf_page_size - sizeof(PTR_BL))
|
||||
/ sizeof(PTR_EN) + 1);
|
||||
pp->pb_count_max = (mfp->mf_page_size - sizeof(PTR_BL)) / sizeof(PTR_EN) + 1;
|
||||
|
||||
return hp;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ typedef void (*nv_func_T)(cmdarg_T *cap);
|
||||
static const struct nv_cmd {
|
||||
int cmd_char; /* (first) command character */
|
||||
nv_func_T cmd_func; /* function for this command */
|
||||
short_u cmd_flags; /* NV_ flags */
|
||||
uint16_t cmd_flags; /* NV_ flags */
|
||||
short cmd_arg; /* value for ca.arg */
|
||||
} nv_cmds[] =
|
||||
{
|
||||
|
@ -568,7 +568,7 @@ typedef struct langp_S {
|
||||
static char_u *int_wordlist = NULL;
|
||||
|
||||
typedef struct wordcount_S {
|
||||
short_u wc_count; // nr of times word was seen
|
||||
uint16_t wc_count; // nr of times word was seen
|
||||
char_u wc_word[1]; // word, actually longer
|
||||
} wordcount_T;
|
||||
|
||||
@ -4252,7 +4252,7 @@ struct wordnode_S {
|
||||
// In the soundfolded word tree "wn_flags" has the MSW of the wordnr and
|
||||
// "wn_region" the LSW of the wordnr.
|
||||
char_u wn_affixID; // supported/required prefix ID or 0
|
||||
short_u wn_flags; // WF_ flags
|
||||
uint16_t wn_flags; // WF_ flags
|
||||
short wn_region; // region mask
|
||||
|
||||
#ifdef SPELL_PRINTTREE
|
||||
@ -7236,7 +7236,7 @@ put_node (
|
||||
// associated condition nr (stored in wn_region). The
|
||||
// byte value is misused to store the "rare" and "not
|
||||
// combining" flags
|
||||
if (np->wn_flags == (short_u)PFX_FLAGS)
|
||||
if (np->wn_flags == (uint16_t)PFX_FLAGS)
|
||||
putc(BY_NOFLAGS, fd); // <byte>
|
||||
else {
|
||||
putc(BY_FLAGS, fd); // <byte>
|
||||
|
@ -69,8 +69,8 @@ typedef struct attr_entry {
|
||||
} term;
|
||||
struct {
|
||||
/* These colors need to be > 8 bits to hold 256. */
|
||||
short_u fg_color; /* foreground color number */
|
||||
short_u bg_color; /* background color number */
|
||||
uint16_t fg_color; /* foreground color number */
|
||||
uint16_t bg_color; /* background color number */
|
||||
} cterm;
|
||||
} ae_u;
|
||||
} attrentry_T;
|
||||
|
@ -15,7 +15,6 @@
|
||||
* already defined, so we use char_u to avoid trouble.
|
||||
*/
|
||||
typedef unsigned char char_u;
|
||||
typedef unsigned short short_u;
|
||||
typedef unsigned int int_u;
|
||||
|
||||
#endif /* NEOVIM_TYPES_H */
|
||||
|
Loading…
Reference in New Issue
Block a user