comparison src/message.c @ 835:8bebcabccc2c v7.0e01

updated for version 7.0e01
author vimboss
date Mon, 17 Apr 2006 22:14:47 +0000
parents 45fad0f590d0
children 1f3b1021f002
comparison
equal deleted inserted replaced
834:5117153003bd 835:8bebcabccc2c
2100 * number */ 2100 * number */
2101 if (p == NULL) 2101 if (p == NULL)
2102 p = (char_u *)_("Unknown"); 2102 p = (char_u *)_("Unknown");
2103 else 2103 else
2104 { 2104 {
2105 len = STRLEN(p) + 40; 2105 len = (int)STRLEN(p) + 40;
2106 tofree = alloc(len); 2106 tofree = alloc(len);
2107 if (tofree != NULL) 2107 if (tofree != NULL)
2108 { 2108 {
2109 vim_snprintf((char *)tofree, len, _("%s line %ld"), 2109 vim_snprintf((char *)tofree, len, _("%s line %ld"),
2110 p, (long)sourcing_lnum); 2110 p, (long)sourcing_lnum);
3509 mb_ptr_adv(hotkp); 3509 mb_ptr_adv(hotkp);
3510 *hotkp = NUL; 3510 *hotkp = NUL;
3511 } 3511 }
3512 else 3512 else
3513 { 3513 {
3514 len += STRLEN(message) 3514 len += (int)(STRLEN(message)
3515 + 2 /* for the NL's */ 3515 + 2 /* for the NL's */
3516 + STRLEN(buttons) 3516 + STRLEN(buttons)
3517 + 3; /* for the ": " and NUL */ 3517 + 3); /* for the ": " and NUL */
3518 lenhotkey++; /* for the NUL */ 3518 lenhotkey++; /* for the NUL */
3519 3519
3520 /* If no hotkey is specified first char is used. */ 3520 /* If no hotkey is specified first char is used. */
3521 if (!has_hotkey[0]) 3521 if (!has_hotkey[0])
3522 { 3522 {
3523 first_hotkey = TRUE; 3523 first_hotkey = TRUE;
4427 number_of_zeros_to_pad = precision - num_of_digits; 4427 number_of_zeros_to_pad = precision - num_of_digits;
4428 } 4428 }
4429 /* zero padding to specified minimal field width? */ 4429 /* zero padding to specified minimal field width? */
4430 if (!justify_left && zero_padding) 4430 if (!justify_left && zero_padding)
4431 { 4431 {
4432 int n = min_field_width - (str_arg_l 4432 int n = (int)(min_field_width - (str_arg_l
4433 + number_of_zeros_to_pad); 4433 + number_of_zeros_to_pad));
4434 if (n > 0) 4434 if (n > 0)
4435 number_of_zeros_to_pad += n; 4435 number_of_zeros_to_pad += n;
4436 } 4436 }
4437 break; 4437 break;
4438 } 4438 }
4462 * this does not include the zero padding in case of numerical 4462 * this does not include the zero padding in case of numerical
4463 * conversions*/ 4463 * conversions*/
4464 if (!justify_left) 4464 if (!justify_left)
4465 { 4465 {
4466 /* left padding with blank or zero */ 4466 /* left padding with blank or zero */
4467 int pn = min_field_width - (str_arg_l + number_of_zeros_to_pad); 4467 int pn = (int)(min_field_width - (str_arg_l + number_of_zeros_to_pad));
4468 4468
4469 if (pn > 0) 4469 if (pn > 0)
4470 { 4470 {
4471 if (str_l < str_m) 4471 if (str_l < str_m)
4472 { 4472 {
4489 } 4489 }
4490 else 4490 else
4491 { 4491 {
4492 /* insert first part of numerics (sign or '0x') before zero 4492 /* insert first part of numerics (sign or '0x') before zero
4493 * padding */ 4493 * padding */
4494 int zn = zero_padding_insertion_ind; 4494 int zn = (int)zero_padding_insertion_ind;
4495 4495
4496 if (zn > 0) 4496 if (zn > 0)
4497 { 4497 {
4498 if (str_l < str_m) 4498 if (str_l < str_m)
4499 { 4499 {
4505 str_l += zn; 4505 str_l += zn;
4506 } 4506 }
4507 4507
4508 /* insert zero padding as requested by the precision or min 4508 /* insert zero padding as requested by the precision or min
4509 * field width */ 4509 * field width */
4510 zn = number_of_zeros_to_pad; 4510 zn = (int)number_of_zeros_to_pad;
4511 if (zn > 0) 4511 if (zn > 0)
4512 { 4512 {
4513 if (str_l < str_m) 4513 if (str_l < str_m)
4514 { 4514 {
4515 size_t avail = str_m-str_l; 4515 size_t avail = str_m-str_l;
4522 } 4522 }
4523 4523
4524 /* insert formatted string 4524 /* insert formatted string
4525 * (or as-is conversion specifier for unknown conversions) */ 4525 * (or as-is conversion specifier for unknown conversions) */
4526 { 4526 {
4527 int sn = str_arg_l - zero_padding_insertion_ind; 4527 int sn = (int)(str_arg_l - zero_padding_insertion_ind);
4528 4528
4529 if (sn > 0) 4529 if (sn > 0)
4530 { 4530 {
4531 if (str_l < str_m) 4531 if (str_l < str_m)
4532 { 4532 {
4542 4542
4543 /* insert right padding */ 4543 /* insert right padding */
4544 if (justify_left) 4544 if (justify_left)
4545 { 4545 {
4546 /* right blank padding to the field width */ 4546 /* right blank padding to the field width */
4547 int pn = min_field_width - (str_arg_l + number_of_zeros_to_pad); 4547 int pn = (int)(min_field_width - (str_arg_l + number_of_zeros_to_pad));
4548 4548
4549 if (pn > 0) 4549 if (pn > 0)
4550 { 4550 {
4551 if (str_l < str_m) 4551 if (str_l < str_m)
4552 { 4552 {