Function report |
Source Code:lib\vsprintf.c |
Create Date:2022-07-28 06:12:00 |
| Last Modify:2022-05-21 09:47:42 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:number
Proto:static __attribute__((__noinline__)) char *number(char *buf, char *end, unsigned long long num, struct printf_spec spec)
Type:char
Parameter:
| Type | Parameter | Name |
|---|---|---|
| char * | buf | |
| char * | end | |
| unsigned long long | num | |
| struct printf_spec | spec |
| 425 | need_pfx = flags to number() & prefix hex with "0x", octal with "0" && number base, 8, 10 or 16 only != 10 |
| 429 | precision = # of digits/chars |
| 434 | If flags to number() & left justified Then flags to number() &= ~pad with zero, must be 16 == '0' - ' ' |
| 436 | sign = 0 |
| 437 | If flags to number() & unsigned/signed, must be 1 Then |
| 438 | If num < 0 Then |
| 442 | Else if flags to number() & show plus Then |
| 443 | sign = '+' |
| 444 | field_width-- |
| 445 | Else if flags to number() & space if plus Then |
| 446 | sign = ' ' |
| 447 | field_width-- |
| 450 | If need_pfx Then |
| 451 | If number base, 8, 10 or 16 only == 16 Then field_width -= 2 |
| 453 | Else if Not is_zero Then field_width-- |
| 458 | i = 0 |
| 459 | If num < number base, 8, 10 or 16 only Then tmp[i++] = hex_asc_upper[num] | locase |
| 461 | Else if number base, 8, 10 or 16 only != 10 Then |
| 462 | mask = number base, 8, 10 or 16 only - 1 |
| 463 | shift = 3 |
| 465 | If number base, 8, 10 or 16 only == 16 Then shift = 4 |
| 467 | Do |
| 471 | Else |
| 479 | field_width -= precision |
| 480 | If Not ( flags to number() & (pad with zero, must be 16 == '0' - ' ' | left justified )) Then |
| 488 | If sign Then |
| 494 | If need_pfx Then |
| 495 | If number base, 8, 10 or 16 only == 16 || Not is_zero Then |
| 500 | If number base, 8, 10 or 16 only == 16 Then |
| 507 | If Not ( flags to number() & left justified ) Then |
| 508 | c = ' ' + ( flags to number() & pad with zero, must be 16 == '0' - ' ' ) |
| 509 | BUILD_BUG_ON - break compile if a condition is true(' ' + pad with zero, must be 16 == '0' - ' ' != '0') |
| 510 | When --field_width >= 0 cycle |
| 529 | When --field_width >= 0 cycle |
| 535 | Return buf |
| Name | Describe |
|---|---|
| special_hex_number | |
| err_ptr | |
| pointer_string | |
| bdev_name | |
| resource_string | |
| bitmap_string | |
| bitmap_list_string | |
| ip6_addr_string_sa | |
| ip4_addr_string_sa | |
| date_str | |
| time_str | |
| format_flags | |
| device_node_string | |
| vsnprintf | vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |