Skip to content

Commit

Permalink
ncstyle functions ought return uint16_t #1777 #2200
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Oct 12, 2021
1 parent 369548e commit 041b8bd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/notcurses/direct.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ API int ncdirect_dim_y(struct ncdirect* nc) __attribute__ ((nonnull (1)));
// (NCSTYLE_UNDERLINE, NCSTYLE_BOLD, etc.) The attribute is only
// indicated as supported if the terminal can support it together with color.
// For more information, see the "ncv" capability in terminfo(5).
API unsigned ncdirect_supported_styles(const struct ncdirect* nc);
API uint16_t ncdirect_supported_styles(const struct ncdirect* nc);

// ncplane_styles_*() analogues
API int ncdirect_set_styles(struct ncdirect* n, unsigned stylebits)
Expand All @@ -210,7 +210,7 @@ API int ncdirect_on_styles(struct ncdirect* n, unsigned stylebits)
__attribute__ ((nonnull (1)));
API int ncdirect_off_styles(struct ncdirect* n, unsigned stylebits)
__attribute__ ((nonnull (1)));
API unsigned ncdirect_styles(const struct ncdirect* n)
API uint16_t ncdirect_styles(const struct ncdirect* n)
__attribute__ ((nonnull (1)));

// Deprecated forms of above.
Expand Down
4 changes: 2 additions & 2 deletions include/notcurses/notcurses.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ nccell_set_styles(nccell* c, unsigned stylebits){
}

// Extract the style bits from the nccell.
static inline unsigned
static inline uint16_t
nccell_styles(const nccell* c){
return c->stylemask;
}
Expand Down Expand Up @@ -1403,7 +1403,7 @@ typedef struct nccapabilities {
// (NCSTYLE_UNDERLINE, NCSTYLE_BOLD, etc.) The attribute is only
// indicated as supported if the terminal can support it together with color.
// For more information, see the "ncv" capability in terminfo(5).
API unsigned notcurses_supported_styles(const struct notcurses* nc)
API uint16_t notcurses_supported_styles(const struct notcurses* nc)
__attribute__ ((nonnull (1))) __attribute__ ((pure));

// Returns the number of simultaneous colors claimed to be supported, or 1 if
Expand Down
4 changes: 2 additions & 2 deletions src/lib/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ int ncdirect_styles_off(ncdirect* n, unsigned stylebits){
return ncdirect_off_styles(n, stylebits);
}

unsigned ncdirect_styles(const ncdirect* n){
uint16_t ncdirect_styles(const ncdirect* n){
return n->stylemask;
}

Expand Down Expand Up @@ -1609,7 +1609,7 @@ int ncdirectf_geom(ncdirect* n, ncdirectf* frame,
return r;
}

unsigned ncdirect_supported_styles(const ncdirect* nc){
uint16_t ncdirect_supported_styles(const ncdirect* nc){
return term_supported_styles(&nc->tcache);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/notcurses.c
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ int ncplane_cursor_at(const ncplane* n, nccell* c, char** gclust){
return 0;
}

unsigned notcurses_supported_styles(const notcurses* nc){
uint16_t notcurses_supported_styles(const notcurses* nc){
return term_supported_styles(&nc->tcache);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/termdesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ get_escape(const tinfo* tdesc, escape_e e){
return NULL;
}

static inline int
static inline uint16_t
term_supported_styles(const tinfo* ti){
return ti->supported_styles;
}
Expand Down

0 comments on commit 041b8bd

Please sign in to comment.