diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fileio.c | 21 | ||||
-rw-r--r-- | src/hangulin.c | 4 | ||||
-rw-r--r-- | src/regexp.c | 6 | ||||
-rw-r--r-- | src/term.c | 8 |
4 files changed, 22 insertions, 17 deletions
diff --git a/src/fileio.c b/src/fileio.c index 4e0f68af7e..3efddfe66d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4209,15 +4209,14 @@ void msg_add_lines(int insert_space, long lnum, off_t nchars) if (insert_space) *p++ = ' '; - if (shortmess(SHM_LINES)) - sprintf((char *)p, + if (shortmess(SHM_LINES)) { #ifdef LONG_LONG_OFF_T - "%ldL, %lldC", lnum, nchars + sprintf((char *)p, "%ldL, %lldC", lnum, nchars); #else - /* Explicit typecast avoids warning on Mac OS X 10.6 */ - "%ldL, %ldC", lnum, (long)nchars + /* Explicit typecast avoids warning on Mac OS X 10.6 */ + sprintf((char *)p, "%ldL, %ldC", lnum, (long)nchars); #endif - ); + } else { if (lnum == 1) STRCPY(p, _("1 line, ")); @@ -4226,15 +4225,13 @@ void msg_add_lines(int insert_space, long lnum, off_t nchars) p += STRLEN(p); if (nchars == 1) STRCPY(p, _("1 character")); - else - sprintf((char *)p, + else { #ifdef LONG_LONG_OFF_T - _("%lld characters"), nchars + sprintf((char *)p, _("%lld characters"), nchars); #else - /* Explicit typecast avoids warning on Mac OS X 10.6 */ - _("%ld characters"), (long)nchars + sprintf((char *)p, _("%ld characters"), (long)nchars); #endif - ); + } } } diff --git a/src/hangulin.c b/src/hangulin.c index 185bf0a5bd..f7619ef0b3 100644 --- a/src/hangulin.c +++ b/src/hangulin.c @@ -1407,9 +1407,9 @@ static void convert_ks_to_3(const char_u *src, int *fp, int *mp, int *lp) int low = *(src + 1); int c; int i; + const ssize_t tablesize = sizeof(ks_table1) / sizeof(ks_table1[0]); - if ((i = han_index(h, low)) >= 0 - && i < sizeof(ks_table1)/sizeof(ks_table1[0])) { + if ((i = han_index(h, low)) >= 0 && i < tablesize) { *fp = ks_table1[i][0]; *mp = ks_table1[i][1]; *lp = ks_table1[i][2]; diff --git a/src/regexp.c b/src/regexp.c index 54fe5940a7..7bcc69593c 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -6932,6 +6932,9 @@ static regengine_T bt_regengine = #ifdef REGEXP_DEBUG ,(char_u *)"" #endif +#ifdef DEBUG + ,NULL +#endif }; @@ -6950,6 +6953,9 @@ static regengine_T nfa_regengine = #ifdef REGEXP_DEBUG ,(char_u *)"" #endif +#ifdef DEBUG + , NULL +#endif }; /* Which regexp engine to use? Needed for vim_regcomp(). diff --git a/src/term.c b/src/term.c index 5ce3e3ee96..fad1401c0e 100644 --- a/src/term.c +++ b/src/term.c @@ -2225,12 +2225,14 @@ static void term_color(char_u *s, int n) && (STRCMP(s + i + 1, "%p1%dm") == 0 || STRCMP(s + i + 1, "%dm") == 0) && (s[i] == '3' || s[i] == '4')) { - sprintf(buf, + const char *fmt = #ifdef TERMINFO - "%s%s%%p1%%dm", + "%s%s%%p1%%dm"; #else - "%s%s%%dm", + "%s%s%%dm"; #endif + sprintf(buf, + fmt, i == 2 ? IF_EB("\033[", ESC_STR "[") : "\233", s[i] == '3' ? (n >= 16 ? "38;5;" : "9") : (n >= 16 ? "48;5;" : "10")); |