diff options
author | Petter Wahlman <pwahlman@cisco.com> | 2014-03-16 08:20:00 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-19 07:53:16 -0300 |
commit | edabc6f4c7277262568801ff870808170ac32327 (patch) | |
tree | 9e34374d5d6a2816a0bc432bab84e540be9d3f18 /src/message.c | |
parent | 59f2430a8d543fc57a31d489a649ec87a6ca9715 (diff) | |
download | rneovim-edabc6f4c7277262568801ff870808170ac32327.tar.gz rneovim-edabc6f4c7277262568801ff870808170ac32327.tar.bz2 rneovim-edabc6f4c7277262568801ff870808170ac32327.zip |
adapt to the style guildelines
semi-automated harvest of low hanging fruit:
change the unorthodox use of whitespace.
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 217 |
1 files changed, 127 insertions, 90 deletions
diff --git a/src/message.c b/src/message.c index c04fb246cc..6a12517ba8 100644 --- a/src/message.c +++ b/src/message.c @@ -290,7 +290,7 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen) n -= ptr2cells(s + i); i += (*mb_ptr2len)(s + i); } - } else if (enc_utf8) { + } else if (enc_utf8) { /* For UTF-8 we can go backwards easily. */ half = i = (int)STRLEN(s); for (;; ) { @@ -303,7 +303,7 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen) len += n; i = half; } - } else { + } else { for (i = (int)STRLEN(s); len + (n = ptr2cells(s + i - 1)) <= room; --i) len += n; } @@ -316,7 +316,7 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen) len = buflen - e - 3 - 1; mch_memmove(buf + e + 3, s + i, len); buf[e + 3 + len - 1] = NUL; - } else { + } else { buf[e - 1] = NUL; /* make sure it is truncated */ } } @@ -362,7 +362,8 @@ int smsg_attr(int attr, char_u *s, long a1, long a2, long a3, long a4, long a5, int vim_snprintf(char *str, size_t str_m, char *fmt, ...); -int smsg(char_u *s, ...) { +int smsg(char_u *s, ...) +{ va_list arglist; va_start(arglist, s); @@ -371,7 +372,8 @@ int smsg(char_u *s, ...) { return msg(IObuff); } -int smsg_attr(int attr, char_u *s, ...) { +int smsg_attr(int attr, char_u *s, ...) +{ va_list arglist; va_start(arglist, s); @@ -393,7 +395,8 @@ static char_u *last_sourcing_name = NULL; * Reset the last used sourcing name/lnum. Makes sure it is displayed again * for the next error message; */ -void reset_last_sourcing(void) { +void reset_last_sourcing(void) +{ vim_free(last_sourcing_name); last_sourcing_name = NULL; last_sourcing_lnum = 0; @@ -402,7 +405,8 @@ void reset_last_sourcing(void) { /* * Return TRUE if "sourcing_name" differs from "last_sourcing_name". */ -static int other_sourcing_name(void) { +static int other_sourcing_name(void) +{ if (sourcing_name != NULL) { if (last_sourcing_name != NULL) return STRCMP(sourcing_name, last_sourcing_name) != 0; @@ -416,7 +420,8 @@ static int other_sourcing_name(void) { * Returns an allocated string with room for one more character. * Returns NULL when no message is to be given. */ -static char_u *get_emsg_source(void) { +static char_u *get_emsg_source(void) +{ char_u *Buf, *p; if (sourcing_name != NULL && other_sourcing_name()) { @@ -434,7 +439,8 @@ static char_u *get_emsg_source(void) { * Returns an allocated string with room for one more character. * Returns NULL when no message is to be given. */ -static char_u *get_emsg_lnum(void) { +static char_u *get_emsg_lnum(void) +{ char_u *Buf, *p; /* lnum is 0 when executing a command from the command line @@ -490,7 +496,8 @@ void msg_source(int attr) * If "msg" is in 'debug': do error message but without side effects. * If "emsg_skip" is set: never do error messages. */ -int emsg_not_now(void) { +int emsg_not_now(void) +{ if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL && vim_strchr(p_debug, 't') == NULL) || emsg_skip > 0 @@ -717,7 +724,8 @@ add_msg_hist ( * Delete the first (oldest) message from the history. * Returns FAIL if there are no messages. */ -int delete_first_msg(void) { +int delete_first_msg(void) +{ struct msg_hist *p; if (msg_hist_len <= 0) @@ -759,7 +767,8 @@ void ex_messages(exarg_T *eap) * Call this after prompting the user. This will avoid a hit-return message * and a delay. */ -void msg_end_prompt(void) { +void msg_end_prompt(void) +{ need_wait_return = FALSE; emsg_on_display = FALSE; cmdline_row = msg_row; @@ -812,11 +821,11 @@ void wait_return(int redraw) c = CAR; /* just pretend CR was hit */ quit_more = FALSE; got_int = FALSE; - } else if (exmode_active) { + } else if (exmode_active) { MSG_PUTS(" "); /* make sure the cursor is on the right line */ c = CAR; /* no need for a return in ex mode */ got_int = FALSE; - } else { + } else { /* Make sure the hit-return prompt is on screen when 'guioptions' was * just changed. */ screenalloc(FALSE); @@ -883,7 +892,7 @@ void wait_return(int redraw) c = CAR; /* just pretend CR was hit */ quit_more = FALSE; got_int = FALSE; - } else if (c != K_IGNORE) { + } else if (c != K_IGNORE) { c = K_IGNORE; hit_return_msg(); } @@ -914,7 +923,7 @@ void wait_return(int redraw) if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE || c == K_X1MOUSE || c == K_X2MOUSE) (void)jump_to_mouse(MOUSE_SETPOS, NULL, 0); - else if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C) { + else if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C) { /* Put the character back in the typeahead buffer. Don't use the * stuff buffer, because lmaps wouldn't work. */ ins_char_typebuf(c); @@ -977,7 +986,8 @@ void wait_return(int redraw) /* * Write the hit-return prompt. */ -static void hit_return_msg(void) { +static void hit_return_msg(void) +{ int save_p_more = p_more; p_more = FALSE; /* don't want see this message when scrolling back */ @@ -1010,7 +1020,8 @@ void set_keep_msg(char_u *s, int attr) * If there currently is a message being displayed, set "keep_msg" to it, so * that it will be displayed again after redraw. */ -void set_keep_msg_from_hist(void) { +void set_keep_msg_from_hist(void) +{ if (keep_msg == NULL && last_msg_hist != NULL && msg_scrolled == 0 && (State & NORMAL)) set_keep_msg(last_msg_hist->msg, last_msg_hist->attr); @@ -1019,7 +1030,8 @@ void set_keep_msg_from_hist(void) { /* * Prepare for outputting characters in the command line. */ -void msg_start(void) { +void msg_start(void) +{ int did_return = FALSE; if (!msg_silent) { @@ -1039,7 +1051,7 @@ void msg_start(void) { msg_col = cmdmsg_rl ? Columns - 1 : 0; - } else if (msg_didout) { /* start message on next line */ + } else if (msg_didout) { /* start message on next line */ msg_putchar('\n'); did_return = TRUE; if (exmode_active != EXMODE_NORMAL) @@ -1060,7 +1072,8 @@ void msg_start(void) { /* * Note that the current msg position is where messages start. */ -void msg_starthere(void) { +void msg_starthere(void) +{ lines_left = cmdline_row; msg_didany = FALSE; } @@ -1079,7 +1092,7 @@ void msg_putchar_attr(int c, int attr) buf[1] = K_SECOND(c); buf[2] = K_THIRD(c); buf[3] = NUL; - } else { + } else { buf[(*mb_char2bytes)(c, buf)] = NUL; } msg_puts_attr(buf, attr); @@ -1199,7 +1212,7 @@ int msg_outtrans_len_attr(char_u *msgstr, int len, int attr) } len -= mb_l - 1; str += mb_l; - } else { + } else { s = transchar_byte(*str); if (s[1] != NUL) { /* unprintable char: print the printable chars so far and the @@ -1425,19 +1438,19 @@ void msg_prt_line(char_u *s, int list) c = c_extra; else c = *p_extra++; - } else if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1) { + } else if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1) { col += (*mb_ptr2cells)(s); if (lcs_nbsp != NUL && list && mb_ptr2char(s) == 160) { mb_char2bytes(lcs_nbsp, buf); buf[(*mb_ptr2len)(buf)] = NUL; - } else { + } else { mch_memmove(buf, s, (size_t)l); buf[l] = NUL; } msg_puts(buf); s += l; continue; - } else { + } else { attr = 0; c = *s++; if (c == TAB && (!list || lcs_tab1)) { @@ -1446,22 +1459,22 @@ void msg_prt_line(char_u *s, int list) if (!list) { c = ' '; c_extra = ' '; - } else { + } else { c = lcs_tab1; c_extra = lcs_tab2; attr = hl_attr(HLF_8); } - } else if (c == 160 && list && lcs_nbsp != NUL) { + } else if (c == 160 && list && lcs_nbsp != NUL) { c = lcs_nbsp; attr = hl_attr(HLF_8); - } else if (c == NUL && list && lcs_eol != NUL) { + } else if (c == NUL && list && lcs_eol != NUL) { p_extra = (char_u *)""; c_extra = NUL; n_extra = 1; c = lcs_eol; attr = hl_attr(HLF_AT); --s; - } else if (c != NUL && (n = byte2cells(c)) > 1) { + } else if (c != NUL && (n = byte2cells(c)) > 1) { n_extra = n - 1; p_extra = transchar_byte(c); c_extra = NUL; @@ -1469,7 +1482,7 @@ void msg_prt_line(char_u *s, int list) /* Use special coloring to be able to distinguish <hex> from * the same in plain text. */ attr = hl_attr(HLF_8); - } else if (c == ' ' && trail != NULL && s > trail) { + } else if (c == ' ' && trail != NULL && s > trail) { c = lcs_trail; attr = hl_attr(HLF_8); } @@ -1509,7 +1522,7 @@ static char_u *screen_puts_mbyte(char_u *s, int l, int attr) msg_col = Columns; ++msg_row; } - } else { + } else { msg_col += cw; if (msg_col >= Columns) { msg_col = 0; @@ -1744,12 +1757,12 @@ static void msg_puts_display(char_u *str, int maxlen, int attr, int recurse) msg_col = 0; if (++msg_row >= Rows) /* safety check */ msg_row = Rows - 1; - } else if (*s == '\r') { /* go to column 0 */ + } else if (*s == '\r') { /* go to column 0 */ msg_col = 0; - } else if (*s == '\b') { /* go to previous char */ + } else if (*s == '\b') { /* go to previous char */ if (msg_col) --msg_col; - } else if (*s == TAB) { /* translate Tab into spaces */ + } else if (*s == TAB) { /* translate Tab into spaces */ do msg_screen_putchar(' ', attr); while (msg_col & 7); @@ -1763,7 +1776,7 @@ static void msg_puts_display(char_u *str, int maxlen, int attr, int recurse) l = utfc_ptr2len_len(s, (int)((str + maxlen) - s)); else l = (*mb_ptr2len)(s); - } else { + } else { cw = 1; l = 1; } @@ -1779,7 +1792,7 @@ static void msg_puts_display(char_u *str, int maxlen, int attr, int recurse) s = screen_puts_mbyte(s, l, attr) - 1; else msg_screen_putchar(*s, attr); - } else { + } else { /* postpone this character until later */ if (t_col == 0) t_s = s; @@ -1802,7 +1815,8 @@ static void msg_puts_display(char_u *str, int maxlen, int attr, int recurse) /* * Scroll the screen up one line for displaying the next message line. */ -static void msg_scroll_up(void) { +static void msg_scroll_up(void) +{ /* scrolling up always works */ screen_del_lines(0, 0, 1, (int)Rows, TRUE, NULL); @@ -1823,7 +1837,8 @@ static void msg_scroll_up(void) { /* * Increment "msg_scrolled". */ -static void inc_msg_scrolled(void) { +static void inc_msg_scrolled(void) +{ if (*get_vim_var_str(VV_SCROLLSTART) == NUL) { char_u *p = sourcing_name; char_u *tofree = NULL; @@ -1899,7 +1914,7 @@ store_sb_text ( if (last_msgchunk == NULL) { last_msgchunk = mp; mp->sb_prev = NULL; - } else { + } else { mp->sb_prev = last_msgchunk; last_msgchunk->sb_next = mp; last_msgchunk = mp; @@ -1916,7 +1931,8 @@ store_sb_text ( /* * Finished showing messages, clear the scroll-back text on the next message. */ -void may_clear_sb_text(void) { +void may_clear_sb_text(void) +{ do_clear_sb_text = TRUE; } @@ -1924,7 +1940,8 @@ void may_clear_sb_text(void) { * Clear any text remembered for scrolling back. * Called when redrawing the screen. */ -void clear_sb_text(void) { +void clear_sb_text(void) +{ msgchunk_T *mp; while (last_msgchunk != NULL) { @@ -1937,7 +1954,8 @@ void clear_sb_text(void) { /* * "g<" command. */ -void show_sb_text(void) { +void show_sb_text(void) +{ msgchunk_T *mp; /* Only show something if there is more than one line, otherwise it looks @@ -1966,7 +1984,8 @@ static msgchunk_T *msg_sb_start(msgchunk_T *mps) /* * Mark the last message chunk as finishing the line. */ -void msg_sb_eol(void) { +void msg_sb_eol(void) +{ if (last_msgchunk != NULL) last_msgchunk->sb_eol = TRUE; } @@ -2022,7 +2041,8 @@ static void t_puts(int *t_col, char_u *t_s, char_u *s, int attr) * different, e.g. for Win32 console) or we just don't know where the * cursor is. */ -int msg_use_printf(void) { +int msg_use_printf(void) +{ return !msg_check_screen() || (swapping_screen() && !termcap_active) ; @@ -2061,7 +2081,7 @@ static void msg_puts_printf(char_u *str, int maxlen) msg_col = Columns - 1; else --msg_col; - } else { + } else { if (*s == '\r' || *s == '\n') msg_col = 0; else @@ -2175,7 +2195,7 @@ static int do_more_prompt(int typed_char) if (confirm_msg_used) { /* Jump to the choices of the dialog. */ retval = TRUE; - } else { + } else { got_int = TRUE; quit_more = TRUE; } @@ -2220,7 +2240,7 @@ static int do_more_prompt(int typed_char) (int)Rows, NULL) == OK) { /* display line at top */ (void)disp_sb_line(0, mp); - } else { + } else { /* redisplay all lines */ screenclear(); for (i = 0; mp != NULL && i < Rows - 1; ++i) { @@ -2230,7 +2250,7 @@ static int do_more_prompt(int typed_char) } toscroll = 0; } - } else { + } else { /* First display any text that we scrolled back. */ while (toscroll > 0 && mp_last != NULL) { /* scroll up, display line at bottom */ @@ -2371,7 +2391,7 @@ static void msg_screen_putchar(int c, int attr) msg_col = Columns; ++msg_row; } - } else { + } else { if (++msg_col >= Columns) { msg_col = 0; ++msg_row; @@ -2396,16 +2416,17 @@ void msg_moremsg(int full) * Repeat the message for the current mode: ASKMORE, EXTERNCMD, CONFIRM or * exmode_active. */ -void repeat_message(void) { +void repeat_message(void) +{ if (State == ASKMORE) { msg_moremsg(TRUE); /* display --more-- message again */ msg_row = Rows - 1; - } else if (State == CONFIRM) { + } else if (State == CONFIRM) { display_confirm_msg(); /* display ":confirm" message again */ msg_row = Rows - 1; - } else if (State == EXTERNCMD) { + } else if (State == EXTERNCMD) { windgoto(msg_row, msg_col); /* put cursor back */ - } else if (State == HITRETURN || State == SETWSIZE) { + } else if (State == HITRETURN || State == SETWSIZE) { if (msg_row == Rows - 1) { /* Avoid drawing the "hit-enter" prompt below the previous one, * overwrite it. Esp. useful when regaining focus and a @@ -2425,7 +2446,8 @@ void repeat_message(void) { * While starting the GUI the terminal codes will be set for the GUI, but the * output goes to the terminal. Don't use the terminal codes then. */ -static int msg_check_screen(void) { +static int msg_check_screen(void) +{ if (!full_screen || !screen_valid(FALSE)) return FALSE; @@ -2440,7 +2462,8 @@ static int msg_check_screen(void) { * Clear from current message position to end of screen. * Skip this when ":silent" was used, no need to clear for redirection. */ -void msg_clr_eos(void) { +void msg_clr_eos(void) +{ if (msg_silent == 0) msg_clr_eos_force(); } @@ -2450,7 +2473,8 @@ void msg_clr_eos(void) { * Note: msg_col is not updated, so we remember the end of the message * for msg_check(). */ -void msg_clr_eos_force(void) { +void msg_clr_eos_force(void) +{ if (msg_use_printf()) { if (full_screen) { /* only when termcap codes are valid */ if (*T_CD) @@ -2458,11 +2482,11 @@ void msg_clr_eos_force(void) { else if (*T_CE) out_str(T_CE); /* clear to end of line */ } - } else { + } else { if (cmdmsg_rl) { screen_fill(msg_row, msg_row + 1, 0, msg_col + 1, ' ', ' ', 0); screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); - } else { + } else { screen_fill(msg_row, msg_row + 1, msg_col, (int)Columns, ' ', ' ', 0); screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); @@ -2473,7 +2497,8 @@ void msg_clr_eos_force(void) { /* * Clear the command line. */ -void msg_clr_cmdline(void) { +void msg_clr_cmdline(void) +{ msg_row = cmdline_row; msg_col = 0; msg_clr_eos_force(); @@ -2484,7 +2509,8 @@ void msg_clr_cmdline(void) { * call wait_return if the message does not fit in the available space * return TRUE if wait_return not called. */ -int msg_end(void) { +int msg_end(void) +{ /* * If the string is larger than the window, * or the ruler option is set and we run into it, @@ -2503,7 +2529,8 @@ int msg_end(void) { * If the written message runs into the shown command or ruler, we have to * wait for hit-return and redraw the window later. */ -void msg_check(void) { +void msg_check(void) +{ if (msg_row == Rows - 1 && msg_col >= sc_col) { need_wait_return = TRUE; redraw_cmdline = TRUE; @@ -2569,7 +2596,8 @@ static void redir_write(char_u *str, int maxlen) } } -int redirecting(void) { +int redirecting(void) +{ return redir_fd != NULL || *p_vfile != NUL || redir_reg || redir_vname ; @@ -2579,7 +2607,8 @@ int redirecting(void) { * Before giving verbose message. * Must always be called paired with verbose_leave()! */ -void verbose_enter(void) { +void verbose_enter(void) +{ if (*p_vfile != NUL) ++msg_silent; } @@ -2588,7 +2617,8 @@ void verbose_enter(void) { * After giving verbose message. * Must always be called paired with verbose_enter()! */ -void verbose_leave(void) { +void verbose_leave(void) +{ if (*p_vfile != NUL) if (--msg_silent < 0) msg_silent = 0; @@ -2597,7 +2627,8 @@ void verbose_leave(void) { /* * Like verbose_enter() and set msg_scroll when displaying the message. */ -void verbose_enter_scroll(void) { +void verbose_enter_scroll(void) +{ if (*p_vfile != NUL) ++msg_silent; else @@ -2608,7 +2639,8 @@ void verbose_enter_scroll(void) { /* * Like verbose_leave() and set cmdline_row when displaying the message. */ -void verbose_leave_scroll(void) { +void verbose_leave_scroll(void) +{ if (*p_vfile != NUL) { if (--msg_silent < 0) msg_silent = 0; @@ -2619,7 +2651,8 @@ void verbose_leave_scroll(void) { /* * Called when 'verbosefile' is set: stop writing to the file. */ -void verbose_stop(void) { +void verbose_stop(void) +{ if (verbose_fd != NULL) { fclose(verbose_fd); verbose_fd = NULL; @@ -2631,7 +2664,8 @@ void verbose_stop(void) { * Open the file 'verbosefile'. * Return FAIL or OK. */ -int verbose_open(void) { +int verbose_open(void) +{ if (verbose_fd == NULL && !verbose_did_open) { /* Only give the error message once. */ verbose_did_open = TRUE; @@ -2821,12 +2855,12 @@ copy_char ( if (lowercase) { c = MB_TOLOWER((*mb_ptr2char)(from)); return (*mb_char2bytes)(c, to); - } else { + } else { len = (*mb_ptr2len)(from); mch_memmove(to, from, (size_t)len); return len; } - } else { + } else { if (lowercase) *to = (char_u)TOLOWER_LOC(*from); else @@ -2886,13 +2920,13 @@ static char_u *msg_show_console_dialog(char_u *message, char_u *buttons, int dfl /* If no hotkey is specified first char is used. */ if (idx < HAS_HOTKEY_LEN - 1 && !has_hotkey[++idx]) first_hotkey = TRUE; - } else { + } else { len += 3; /* '\n' -> ', '; 'x' -> '(x)' */ lenhotkey += HOTK_LEN; /* each button needs a hotkey */ if (idx < HAS_HOTKEY_LEN - 1) has_hotkey[++idx] = FALSE; } - } else if (*r == DLG_HOTKEY_CHAR || first_hotkey) { + } else if (*r == DLG_HOTKEY_CHAR || first_hotkey) { if (*r == DLG_HOTKEY_CHAR) ++r; first_hotkey = FALSE; @@ -2908,12 +2942,12 @@ static char_u *msg_show_console_dialog(char_u *message, char_u *buttons, int dfl /* redefine hotkey */ hotkp[copy_char(r, hotkp, TRUE)] = NUL; } - } else { + } else { ++len; /* '&a' -> '[a]' */ if (idx < HAS_HOTKEY_LEN - 1) has_hotkey[idx] = TRUE; } - } else { + } else { /* everything else copy literally */ if (copy) msgp += copy_char(r, msgp, FALSE); @@ -2927,7 +2961,7 @@ static char_u *msg_show_console_dialog(char_u *message, char_u *buttons, int dfl *msgp++ = ':'; *msgp++ = ' '; *msgp = NUL; - } else { + } else { len += (int)(STRLEN(message) + 2 /* for the NL's */ + STRLEN(buttons) @@ -2976,7 +3010,8 @@ static char_u *msg_show_console_dialog(char_u *message, char_u *buttons, int dfl /* * Display the ":confirm" message. Also called when screen resized. */ -void display_confirm_msg(void) { +void display_confirm_msg(void) +{ /* avoid that 'q' at the more prompt truncates the message here */ ++confirm_msg_used; if (confirm_msg != NULL) @@ -3138,7 +3173,8 @@ static double tv_float(typval_T *tvs, int *idxp) # ifdef HAVE_STDARG_H /* Like vim_vsnprintf() but append to the string. */ -int vim_snprintf_add(char *str, size_t str_m, char *fmt, ...) { +int vim_snprintf_add(char *str, size_t str_m, char *fmt, ...) +{ va_list ap; int str_l; size_t len = STRLEN(str); @@ -3171,7 +3207,8 @@ int vim_snprintf_add(char *str, size_t str_m, char *fmt, long a1, long a2, long # endif # ifdef HAVE_STDARG_H -int vim_snprintf(char *str, size_t str_m, char *fmt, ...) { +int vim_snprintf(char *str, size_t str_m, char *fmt, ...) +{ va_list ap; int str_l; @@ -3221,7 +3258,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; } p += n; str_l += n; - } else { + } else { size_t min_field_width = 0, precision = 0; int zero_padding = 0, precision_specified = 0, justify_left = 0; int alternate_form = 0, force_sign = 0; @@ -3300,7 +3337,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; min_field_width = -j; justify_left = 1; } - } else if (VIM_ISDIGIT((int)(*p))) { + } else if (VIM_ISDIGIT((int)(*p))) { /* size_t could be wider than unsigned int; make sure we treat * argument like common implementations do */ unsigned int uj = *p++ - '0'; @@ -3331,7 +3368,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; precision_specified = 0; precision = 0; } - } else if (VIM_ISDIGIT((int)(*p))) { + } else if (VIM_ISDIGIT((int)(*p))) { /* size_t could be wider than unsigned int; make sure we * treat argument like common implementations do */ unsigned int uj = *p++ - '0'; @@ -3487,7 +3524,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; #endif if (ptr_arg != NULL) arg_sign = 1; - } else if (fmt_spec == 'd') { + } else if (fmt_spec == 'd') { /* signed */ switch (length_modifier) { case '\0': @@ -3519,7 +3556,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; arg_sign = -1; break; } - } else { + } else { /* unsigned */ switch (length_modifier) { case '\0': @@ -3566,7 +3603,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; tmp[str_arg_l++] = space_for_positive ? ' ' : '+'; /* leave negative numbers for sprintf to handle, to * avoid handling tricky cases like (short int)-32768 */ - } else if (alternate_form) { + } else if (alternate_form) { if (arg_sign != 0 && (fmt_spec == 'x' || fmt_spec == 'X') ) { tmp[str_arg_l++] = '0'; @@ -3583,7 +3620,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; /* When zero value is formatted with an explicit * precision 0, the resulting formatted string is * empty (d, i, u, o, x, X, p). */ - } else { + } else { char f[5]; int f_l = 0; @@ -3612,7 +3649,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; tmp + str_arg_l, f, long_arg); break; } - } else { + } else { /* unsigned */ switch (length_modifier) { case '\0': @@ -3716,7 +3753,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; /* Avoid a buffer overflow */ strcpy(tmp, "inf"); str_arg_l = 3; - } else { + } else { format[0] = '%'; l = 1; if (precision_specified) { @@ -3771,7 +3808,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; --tp; --str_arg_l; } - } else { + } else { char *tp; /* Be consistent: some printf("%e") use 1.0e+12 @@ -3838,7 +3875,7 @@ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; /* will not copy first part of numeric right now, * * force it to be copied later in its entirety */ zero_padding_insertion_ind = 0; - } else { + } else { /* insert first part of numerics (sign or '0x') before zero * padding */ int zn = (int)zero_padding_insertion_ind; |