Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_printf | ||
4 | ** File description: | ||
5 | ** The functions for apply format to an int | ||
6 | */ | ||
7 | /** | ||
8 | * @file format_it_int.c | ||
9 | * @brief The file containing the format_it_int function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "myprintf.h" | ||
14 | |||
15 | 135 | void format_it_int(char *str_finale, formating_t *formating, size_t nb) | |
16 | { | ||
17 | 135 | void (*format[])(char *, formating_t *, size_t) = | |
18 | {&format_moins_int, &format_plus_int, | ||
19 | &format_esp_int, &format_hash_int, &format_zero_int}; | ||
20 | |||
21 |
4/4✓ Branch 0 taken 122 times.
✓ Branch 1 taken 13 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 120 times.
|
135 | if (formating->id_ft == -1 && formating->id_wd != -1) { |
22 | 2 | format[2](str_finale, formating, nb); | |
23 | } | ||
24 |
2/2✓ Branch 0 taken 675 times.
✓ Branch 1 taken 135 times.
|
810 | for (int i = 0; i < 5; i++) { |
25 |
2/2✓ Branch 0 taken 13 times.
✓ Branch 1 taken 662 times.
|
675 | if (formating->id_ft == i) { |
26 | 13 | format[i](str_finale, formating, nb); | |
27 | } | ||
28 | } | ||
29 | 135 | return; | |
30 | } | ||
31 |