mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 01:04:10 +08:00
Make a few methods const
This helps on netbsd, because enter_standout_mode et al are const there. These methods don't alter their argument, so they should have been const to begin with.
This commit is contained in:
parent
c5f9f59555
commit
58ceb00781
@ -63,7 +63,7 @@ unsigned char index_for_color(rgb_color_t c) {
|
||||
return c.to_term256_index();
|
||||
}
|
||||
|
||||
static bool write_color_escape(char *todo, unsigned char idx, bool is_fg) {
|
||||
static bool write_color_escape(const char *todo, unsigned char idx, bool is_fg) {
|
||||
if (term_supports_color_natively(idx)) {
|
||||
// Use tparm to emit color escape.
|
||||
writembs(tparm((char *)todo, idx));
|
||||
@ -550,7 +550,7 @@ rgb_color_t parse_color(const env_var_t &var, bool is_background) {
|
||||
}
|
||||
|
||||
/// Write specified multibyte string.
|
||||
void writembs_check(char *mbs, const char *mbs_name, bool critical, const char *file, long line) {
|
||||
void writembs_check(const char *mbs, const char *mbs_name, bool critical, const char *file, long line) {
|
||||
if (mbs != NULL) {
|
||||
tputs(mbs, 1, &writeb);
|
||||
} else if (critical) {
|
||||
|
@ -30,7 +30,7 @@ enum {
|
||||
|
||||
void set_color(rgb_color_t c, rgb_color_t c2);
|
||||
|
||||
void writembs_check(char *mbs, const char *mbs_name, bool critical, const char *file, long line);
|
||||
void writembs_check(const char *mbs, const char *mbs_name, bool critical, const char *file, long line);
|
||||
#define writembs(mbs) writembs_check((mbs), #mbs, true, __FILE__, __LINE__)
|
||||
#define writembs_nofail(mbs) writembs_check((mbs), #mbs, false, __FILE__, __LINE__)
|
||||
|
||||
|
@ -566,7 +566,7 @@ static void s_write_char(screen_t *s, data_buffer_t *b, wchar_t c) {
|
||||
}
|
||||
|
||||
/// Send the specified string through tputs and append the output to the specified buffer.
|
||||
static void s_write_mbs(data_buffer_t *b, char *s) {
|
||||
static void s_write_mbs(data_buffer_t *b, const char *s) {
|
||||
scoped_buffer_t scoped_buffer(b);
|
||||
writembs(s);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user