comparison src/if_cscope.c @ 15543:dd725a8ab112 v8.1.0779

patch 8.1.0779: argument for message functions is inconsistent commit https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 19 17:43:09 2019 +0100 patch 8.1.0779: argument for message functions is inconsistent Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *".
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Jan 2019 17:45:07 +0100
parents 98c35d312987
children 7fad90423bd2
comparison
equal deleted inserted replaced
15542:5baedae7ca7a 15543:dd725a8ab112
210 210
211 if (make_split) 211 if (make_split)
212 { 212 {
213 if (!cmdp->cansplit) 213 if (!cmdp->cansplit)
214 { 214 {
215 (void)MSG_PUTS(_("This cscope command does not support splitting the window.\n")); 215 (void)msg_puts(_("This cscope command does not support splitting the window.\n"));
216 return; 216 return;
217 } 217 }
218 postponed_split = -1; 218 postponed_split = -1;
219 postponed_split_flags = cmdmod.split; 219 postponed_split_flags = cmdmod.split;
220 postponed_split_tab = cmdmod.tab; 220 postponed_split_tab = cmdmod.tab;
1278 static int 1278 static int
1279 cs_help(exarg_T *eap UNUSED) 1279 cs_help(exarg_T *eap UNUSED)
1280 { 1280 {
1281 cscmd_T *cmdp = cs_cmds; 1281 cscmd_T *cmdp = cs_cmds;
1282 1282
1283 (void)MSG_PUTS(_("cscope commands:\n")); 1283 (void)msg_puts(_("cscope commands:\n"));
1284 while (cmdp->name != NULL) 1284 while (cmdp->name != NULL)
1285 { 1285 {
1286 char *help = _(cmdp->help); 1286 char *help = _(cmdp->help);
1287 int space_cnt = 30 - vim_strsize((char_u *)help); 1287 int space_cnt = 30 - vim_strsize((char_u *)help);
1288 1288
1292 (void)smsg(_("%-5s: %s%*s (Usage: %s)"), 1292 (void)smsg(_("%-5s: %s%*s (Usage: %s)"),
1293 cmdp->name, 1293 cmdp->name,
1294 help, space_cnt, " ", 1294 help, space_cnt, " ",
1295 cmdp->usage); 1295 cmdp->usage);
1296 if (strcmp(cmdp->name, "find") == 0) 1296 if (strcmp(cmdp->name, "find") == 0)
1297 MSG_PUTS(_("\n" 1297 msg_puts(_("\n"
1298 " a: Find assignments to this symbol\n" 1298 " a: Find assignments to this symbol\n"
1299 " c: Find functions calling this function\n" 1299 " c: Find functions calling this function\n"
1300 " d: Find functions called by this function\n" 1300 " d: Find functions called by this function\n"
1301 " e: Find this egrep pattern\n" 1301 " e: Find this egrep pattern\n"
1302 " f: Find this file\n" 1302 " f: Find this file\n"
1990 buf = (char *)alloc(newsize); 1990 buf = (char *)alloc(newsize);
1991 if (buf != NULL) 1991 if (buf != NULL)
1992 { 1992 {
1993 bufsize = newsize; 1993 bufsize = newsize;
1994 (void)sprintf(buf, cstag_msg, ptag); 1994 (void)sprintf(buf, cstag_msg, ptag);
1995 MSG_PUTS_ATTR(buf, HL_ATTR(HLF_T)); 1995 msg_puts_attr(buf, HL_ATTR(HLF_T));
1996 } 1996 }
1997 1997
1998 vim_free(tbuf); 1998 vim_free(tbuf);
1999 1999
2000 MSG_PUTS_ATTR(_("\n # line"), HL_ATTR(HLF_T)); /* strlen is 7 */ 2000 msg_puts_attr(_("\n # line"), HL_ATTR(HLF_T)); /* strlen is 7 */
2001 msg_advance(msg_col + 2); 2001 msg_advance(msg_col + 2);
2002 MSG_PUTS_ATTR(_("filename / context / line\n"), HL_ATTR(HLF_T)); 2002 msg_puts_attr(_("filename / context / line\n"), HL_ATTR(HLF_T));
2003 2003
2004 num = 1; 2004 num = 1;
2005 for (i = 0; i < num_matches; i++) 2005 for (i = 0; i < num_matches; i++)
2006 { 2006 {
2007 idx = i; 2007 idx = i;
2041 } 2041 }
2042 if (buf != NULL) 2042 if (buf != NULL)
2043 { 2043 {
2044 /* csfmt_str = "%4d %6s "; */ 2044 /* csfmt_str = "%4d %6s "; */
2045 (void)sprintf(buf, csfmt_str, num, lno); 2045 (void)sprintf(buf, csfmt_str, num, lno);
2046 MSG_PUTS_ATTR(buf, HL_ATTR(HLF_CM)); 2046 msg_puts_attr(buf, HL_ATTR(HLF_CM));
2047 } 2047 }
2048 MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), HL_ATTR(HLF_CM)); 2048 msg_outtrans_long_attr((char_u *)cs_pathcomponents(fname),
2049 HL_ATTR(HLF_CM));
2049 2050
2050 /* compute the required space for the context */ 2051 /* compute the required space for the context */
2051 if (cntxts[idx] != NULL) 2052 if (cntxts[idx] != NULL)
2052 context = cntxts[idx]; 2053 context = cntxts[idx];
2053 else 2054 else
2072 2073
2073 /* print the context only if it fits on the same line */ 2074 /* print the context only if it fits on the same line */
2074 if (msg_col + (int)strlen(buf) >= (int)Columns) 2075 if (msg_col + (int)strlen(buf) >= (int)Columns)
2075 msg_putchar('\n'); 2076 msg_putchar('\n');
2076 msg_advance(12); 2077 msg_advance(12);
2077 MSG_PUTS_LONG(buf); 2078 msg_outtrans_long_attr((char_u *)buf, 0);
2078 msg_putchar('\n'); 2079 msg_putchar('\n');
2079 } 2080 }
2080 if (extra != NULL) 2081 if (extra != NULL)
2081 { 2082 {
2082 msg_advance(13); 2083 msg_advance(13);
2083 MSG_PUTS_LONG(extra); 2084 msg_outtrans_long_attr((char_u *)extra, 0);
2084 } 2085 }
2085 2086
2086 vim_free(tbuf); /* only after printing extra due to strtok use */ 2087 vim_free(tbuf); /* only after printing extra due to strtok use */
2087 2088
2088 if (msg_col) 2089 if (msg_col)
2369 /* don't use smsg_attr() because we want to display the 2370 /* don't use smsg_attr() because we want to display the
2370 * connection number in the same line as 2371 * connection number in the same line as
2371 * "Added cscope database..." 2372 * "Added cscope database..."
2372 */ 2373 */
2373 sprintf(buf, " (#%d)", i); 2374 sprintf(buf, " (#%d)", i);
2374 MSG_PUTS_ATTR(buf, HL_ATTR(HLF_R)); 2375 msg_puts_attr(buf, HL_ATTR(HLF_R));
2375 } 2376 }
2376 } 2377 }
2377 vim_free(dblist[i]); 2378 vim_free(dblist[i]);
2378 vim_free(pplist[i]); 2379 vim_free(pplist[i]);
2379 vim_free(fllist[i]); 2380 vim_free(fllist[i]);
2381 vim_free(dblist); 2382 vim_free(dblist);
2382 vim_free(pplist); 2383 vim_free(pplist);
2383 vim_free(fllist); 2384 vim_free(fllist);
2384 2385
2385 if (p_csverbose) 2386 if (p_csverbose)
2386 MSG_ATTR(_("All cscope databases reset"), HL_ATTR(HLF_R) | MSG_HIST); 2387 msg_attr(_("All cscope databases reset"), HL_ATTR(HLF_R) | MSG_HIST);
2387 return CSCOPE_SUCCESS; 2388 return CSCOPE_SUCCESS;
2388 } /* cs_reset */ 2389 } /* cs_reset */
2389 2390
2390 2391
2391 /* 2392 /*
2462 static int 2463 static int
2463 cs_show(exarg_T *eap UNUSED) 2464 cs_show(exarg_T *eap UNUSED)
2464 { 2465 {
2465 short i; 2466 short i;
2466 if (cs_cnt_connections() == 0) 2467 if (cs_cnt_connections() == 0)
2467 MSG_PUTS(_("no cscope connections\n")); 2468 msg_puts(_("no cscope connections\n"));
2468 else 2469 else
2469 { 2470 {
2470 MSG_PUTS_ATTR( 2471 msg_puts_attr(
2471 _(" # pid database name prepend path\n"), 2472 _(" # pid database name prepend path\n"),
2472 HL_ATTR(HLF_T)); 2473 HL_ATTR(HLF_T));
2473 for (i = 0; i < csinfo_size; i++) 2474 for (i = 0; i < csinfo_size; i++)
2474 { 2475 {
2475 if (csinfo[i].fname == NULL) 2476 if (csinfo[i].fname == NULL)