Mercurial > vim
comparison src/ops.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 | 2ad5f0ffaa2e |
children | d89c5b339c2a |
comparison
equal
deleted
inserted
replaced
15542:5baedae7ca7a | 15543:dd725a8ab112 |
---|---|
300 msg_line_plural = NGETTEXT("%ld lines %sed %d time", | 300 msg_line_plural = NGETTEXT("%ld lines %sed %d time", |
301 "%ld lines %sed %d times", amount); | 301 "%ld lines %sed %d times", amount); |
302 vim_snprintf((char *)IObuff, IOSIZE, | 302 vim_snprintf((char *)IObuff, IOSIZE, |
303 NGETTEXT(msg_line_single, msg_line_plural, oap->line_count), | 303 NGETTEXT(msg_line_single, msg_line_plural, oap->line_count), |
304 oap->line_count, op, amount); | 304 oap->line_count, op, amount); |
305 msg(IObuff); | 305 msg((char *)IObuff); |
306 } | 306 } |
307 | 307 |
308 /* | 308 /* |
309 * Set "'[" and "']" marks. | 309 * Set "'[" and "']" marks. |
310 */ | 310 */ |
1110 * Get the recorded key hits. K_SPECIAL and CSI will be escaped, this | 1110 * Get the recorded key hits. K_SPECIAL and CSI will be escaped, this |
1111 * needs to be removed again to put it in a register. exec_reg then | 1111 * needs to be removed again to put it in a register. exec_reg then |
1112 * adds the escaping back later. | 1112 * adds the escaping back later. |
1113 */ | 1113 */ |
1114 reg_recording = 0; | 1114 reg_recording = 0; |
1115 MSG(""); | 1115 msg(""); |
1116 p = get_recorded(); | 1116 p = get_recorded(); |
1117 if (p == NULL) | 1117 if (p == NULL) |
1118 retval = FAIL; | 1118 retval = FAIL; |
1119 else | 1119 else |
1120 { | 1120 { |
3047 vim_free(y_current->y_array[i]); | 3047 vim_free(y_current->y_array[i]); |
3048 } | 3048 } |
3049 VIM_CLEAR(y_current->y_array); | 3049 VIM_CLEAR(y_current->y_array); |
3050 #ifdef AMIGA | 3050 #ifdef AMIGA |
3051 if (n >= 1000) | 3051 if (n >= 1000) |
3052 MSG(""); | 3052 msg(""); |
3053 #endif | 3053 #endif |
3054 } | 3054 } |
3055 } | 3055 } |
3056 | 3056 |
3057 static void | 3057 static void |
4283 if (arg != NULL && *arg == NUL) | 4283 if (arg != NULL && *arg == NUL) |
4284 arg = NULL; | 4284 arg = NULL; |
4285 attr = HL_ATTR(HLF_8); | 4285 attr = HL_ATTR(HLF_8); |
4286 | 4286 |
4287 /* Highlight title */ | 4287 /* Highlight title */ |
4288 MSG_PUTS_TITLE(_("\n--- Registers ---")); | 4288 msg_puts_title(_("\n--- Registers ---")); |
4289 for (i = -1; i < NUM_REGISTERS && !got_int; ++i) | 4289 for (i = -1; i < NUM_REGISTERS && !got_int; ++i) |
4290 { | 4290 { |
4291 name = get_register_name(i); | 4291 name = get_register_name(i); |
4292 if (arg != NULL && vim_strchr(arg, name) == NULL | 4292 if (arg != NULL && vim_strchr(arg, name) == NULL |
4293 #ifdef ONE_CLIPBOARD | 4293 #ifdef ONE_CLIPBOARD |
4325 if (yb->y_array != NULL) | 4325 if (yb->y_array != NULL) |
4326 { | 4326 { |
4327 msg_putchar('\n'); | 4327 msg_putchar('\n'); |
4328 msg_putchar('"'); | 4328 msg_putchar('"'); |
4329 msg_putchar(name); | 4329 msg_putchar(name); |
4330 MSG_PUTS(" "); | 4330 msg_puts(" "); |
4331 | 4331 |
4332 n = (int)Columns - 6; | 4332 n = (int)Columns - 6; |
4333 for (j = 0; j < yb->y_size && n > 1; ++j) | 4333 for (j = 0; j < yb->y_size && n > 1; ++j) |
4334 { | 4334 { |
4335 if (j) | 4335 if (j) |
4336 { | 4336 { |
4337 MSG_PUTS_ATTR("^J", attr); | 4337 msg_puts_attr("^J", attr); |
4338 n -= 2; | 4338 n -= 2; |
4339 } | 4339 } |
4340 for (p = yb->y_array[j]; *p && (n -= ptr2cells(p)) >= 0; ++p) | 4340 for (p = yb->y_array[j]; *p && (n -= ptr2cells(p)) >= 0; ++p) |
4341 { | 4341 { |
4342 #ifdef FEAT_MBYTE | 4342 #ifdef FEAT_MBYTE |
4347 p += clen - 1; | 4347 p += clen - 1; |
4348 #endif | 4348 #endif |
4349 } | 4349 } |
4350 } | 4350 } |
4351 if (n > 1 && yb->y_type == MLINE) | 4351 if (n > 1 && yb->y_type == MLINE) |
4352 MSG_PUTS_ATTR("^J", attr); | 4352 msg_puts_attr("^J", attr); |
4353 out_flush(); /* show one line at a time */ | 4353 out_flush(); /* show one line at a time */ |
4354 } | 4354 } |
4355 ui_breakcheck(); | 4355 ui_breakcheck(); |
4356 } | 4356 } |
4357 | 4357 |
4359 * display last inserted text | 4359 * display last inserted text |
4360 */ | 4360 */ |
4361 if ((p = get_last_insert()) != NULL | 4361 if ((p = get_last_insert()) != NULL |
4362 && (arg == NULL || vim_strchr(arg, '.') != NULL) && !got_int) | 4362 && (arg == NULL || vim_strchr(arg, '.') != NULL) && !got_int) |
4363 { | 4363 { |
4364 MSG_PUTS("\n\". "); | 4364 msg_puts("\n\". "); |
4365 dis_msg(p, TRUE); | 4365 dis_msg(p, TRUE); |
4366 } | 4366 } |
4367 | 4367 |
4368 /* | 4368 /* |
4369 * display last command line | 4369 * display last command line |
4370 */ | 4370 */ |
4371 if (last_cmdline != NULL && (arg == NULL || vim_strchr(arg, ':') != NULL) | 4371 if (last_cmdline != NULL && (arg == NULL || vim_strchr(arg, ':') != NULL) |
4372 && !got_int) | 4372 && !got_int) |
4373 { | 4373 { |
4374 MSG_PUTS("\n\": "); | 4374 msg_puts("\n\": "); |
4375 dis_msg(last_cmdline, FALSE); | 4375 dis_msg(last_cmdline, FALSE); |
4376 } | 4376 } |
4377 | 4377 |
4378 /* | 4378 /* |
4379 * display current file name | 4379 * display current file name |
4380 */ | 4380 */ |
4381 if (curbuf->b_fname != NULL | 4381 if (curbuf->b_fname != NULL |
4382 && (arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int) | 4382 && (arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int) |
4383 { | 4383 { |
4384 MSG_PUTS("\n\"% "); | 4384 msg_puts("\n\"% "); |
4385 dis_msg(curbuf->b_fname, FALSE); | 4385 dis_msg(curbuf->b_fname, FALSE); |
4386 } | 4386 } |
4387 | 4387 |
4388 /* | 4388 /* |
4389 * display alternate file name | 4389 * display alternate file name |
4393 char_u *fname; | 4393 char_u *fname; |
4394 linenr_T dummy; | 4394 linenr_T dummy; |
4395 | 4395 |
4396 if (buflist_name_nr(0, &fname, &dummy) != FAIL) | 4396 if (buflist_name_nr(0, &fname, &dummy) != FAIL) |
4397 { | 4397 { |
4398 MSG_PUTS("\n\"# "); | 4398 msg_puts("\n\"# "); |
4399 dis_msg(fname, FALSE); | 4399 dis_msg(fname, FALSE); |
4400 } | 4400 } |
4401 } | 4401 } |
4402 | 4402 |
4403 /* | 4403 /* |
4404 * display last search pattern | 4404 * display last search pattern |
4405 */ | 4405 */ |
4406 if (last_search_pat() != NULL | 4406 if (last_search_pat() != NULL |
4407 && (arg == NULL || vim_strchr(arg, '/') != NULL) && !got_int) | 4407 && (arg == NULL || vim_strchr(arg, '/') != NULL) && !got_int) |
4408 { | 4408 { |
4409 MSG_PUTS("\n\"/ "); | 4409 msg_puts("\n\"/ "); |
4410 dis_msg(last_search_pat(), FALSE); | 4410 dis_msg(last_search_pat(), FALSE); |
4411 } | 4411 } |
4412 | 4412 |
4413 #ifdef FEAT_EVAL | 4413 #ifdef FEAT_EVAL |
4414 /* | 4414 /* |
4415 * display last used expression | 4415 * display last used expression |
4416 */ | 4416 */ |
4417 if (expr_line != NULL && (arg == NULL || vim_strchr(arg, '=') != NULL) | 4417 if (expr_line != NULL && (arg == NULL || vim_strchr(arg, '=') != NULL) |
4418 && !got_int) | 4418 && !got_int) |
4419 { | 4419 { |
4420 MSG_PUTS("\n\"= "); | 4420 msg_puts("\n\"= "); |
4421 dis_msg(expr_line, FALSE); | 4421 dis_msg(expr_line, FALSE); |
4422 } | 4422 } |
4423 #endif | 4423 #endif |
4424 } | 4424 } |
4425 | 4425 |
7399 */ | 7399 */ |
7400 if (curbuf->b_ml.ml_flags & ML_EMPTY) | 7400 if (curbuf->b_ml.ml_flags & ML_EMPTY) |
7401 { | 7401 { |
7402 if (dict == NULL) | 7402 if (dict == NULL) |
7403 { | 7403 { |
7404 MSG(_(no_lines_msg)); | 7404 msg(_(no_lines_msg)); |
7405 return; | 7405 return; |
7406 } | 7406 } |
7407 } | 7407 } |
7408 else | 7408 else |
7409 { | 7409 { |
7613 if (dict == NULL) | 7613 if (dict == NULL) |
7614 { | 7614 { |
7615 /* Don't shorten this message, the user asked for it. */ | 7615 /* Don't shorten this message, the user asked for it. */ |
7616 p = p_shm; | 7616 p = p_shm; |
7617 p_shm = (char_u *)""; | 7617 p_shm = (char_u *)""; |
7618 msg(IObuff); | 7618 msg((char *)IObuff); |
7619 p_shm = p; | 7619 p_shm = p; |
7620 } | 7620 } |
7621 } | 7621 } |
7622 #if defined(FEAT_EVAL) | 7622 #if defined(FEAT_EVAL) |
7623 if (dict != NULL) | 7623 if (dict != NULL) |