OpenCoverage

fmt.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/fmt.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6typedef long int COST;-
7typedef struct Word WORD;-
8-
9struct Word-
10 {-
11-
12-
13-
14 const char *text;-
15 int length;-
16 int space;-
17 unsigned int paren:1;-
18 unsigned int period:1;-
19 unsigned int punct:1;-
20 unsigned int final:1;-
21-
22-
23-
24 int line_length;-
25 COST best_cost;-
26 WORD *next_break;-
27 };-
28-
29-
30-
31static void set_prefix (char *p);-
32static void fmt (FILE *f);-
33static -
34 _Bool -
35 get_paragraph (FILE *f);-
36static int get_line (FILE *f, int c);-
37static int get_prefix (FILE *f);-
38static int get_space (FILE *f, int c);-
39static int copy_rest (FILE *f, int c);-
40static -
41 _Bool -
42 same_para (int c);-
43static void flush_paragraph (void);-
44static void fmt_paragraph (void);-
45static void check_punctuation (WORD *w);-
46static COST base_cost (WORD *this);-
47static COST line_cost (WORD *next, int len);-
48static void put_paragraph (WORD *finish);-
49static void put_line (WORD *w, int indent);-
50static void put_word (WORD *w);-
51static void put_space (int space);-
52-
53-
54-
55-
56static -
57 _Bool -
58 crown;-
59-
60-
61static -
62 _Bool -
63 tagged;-
64-
65-
66static -
67 _Bool -
68 split;-
69-
70-
71static -
72 _Bool -
73 uniform;-
74-
75-
76static const char *prefix;-
77-
78-
79-
80static int max_width;-
81-
82-
83-
84-
85static int prefix_full_length;-
86-
87-
88static int prefix_lead_space;-
89-
90-
91static int prefix_length;-
92-
93-
94static int goal_width;-
95-
96-
97-
98-
99static int in_column;-
100-
101-
102static int out_column;-
103-
104-
105-
106static char parabuf[5000];-
107-
108-
109static char *wptr;-
110-
111-
112-
113static WORD unused_word_type[1000];-
114-
115-
116-
117-
118static WORD *word_limit;-
119-
120-
121-
122static -
123 _Bool -
124 tabs;-
125-
126-
127static int prefix_indent;-
128-
129-
130static int first_indent;-
131-
132-
133static int other_indent;-
134static int next_char;-
135-
136-
137-
138static int next_prefix_indent;-
139-
140-
141-
142-
143static int last_line_length;-
144-
145void-
146usage (int status)-
147{-
148 if (status !=
status != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 17 times by 1 test
Evaluated by:
  • fmt
4-17
149 0
status != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 17 times by 1 test
Evaluated by:
  • fmt
4-17
150 )-
151 do { fprintf (-
152 stderr-
153 , -
154 dcgettext (((void *)0), -
155 "Try '%s --help' for more information.\n"-
156 , 5)-
157 , program_name); }
executed 4 times by 1 test: end of block
Executed by:
  • fmt
while (0);
4
158 else-
159 {-
160 printf (-
161 dcgettext (((void *)0), -
162 "Usage: %s [-WIDTH] [OPTION]... [FILE]...\n"-
163 , 5)-
164 , program_name);-
165 fputs_unlocked (-
166 dcgettext (((void *)0), -
167 "Reformat each paragraph in the FILE(s), writing to standard output.\nThe option -WIDTH is an abbreviated form of --width=DIGITS.\n"-
168 , 5)-
169 ,-
170 stdout-
171 )-
172-
173-
174 ;-
175-
176 emit_stdin_note ();-
177 emit_mandatory_arg_note ();-
178-
179 fputs_unlocked (-
180 dcgettext (((void *)0), -
181 " -c, --crown-margin preserve indentation of first two lines\n -p, --prefix=STRING reformat only lines beginning with STRING,\n reattaching the prefix to reformatted lines\n -s, --split-only split long lines, but do not refill\n"-
182 , 5)-
183 ,-
184 stdout-
185 )-
186-
187-
188-
189-
190-
191 ;-
192-
193-
194 fputs_unlocked (-
195 dcgettext (((void *)0), -
196 " -t, --tagged-paragraph indentation of first line different from second\n -u, --uniform-spacing one space between words, two after sentences\n -w, --width=WIDTH maximum line width (default of 75 columns)\n -g, --goal=WIDTH goal width (default of 93% of width)\n"-
197 , 5)-
198 ,-
199 stdout-
200 )-
201-
202-
203-
204-
205 ;-
206 fputs_unlocked (-
207 dcgettext (((void *)0), -
208 " --help display this help and exit\n"-
209 , 5)-
210 ,-
211 stdout-
212 );-
213 fputs_unlocked (-
214 dcgettext (((void *)0), -
215 " --version output version information and exit\n"-
216 , 5)-
217 ,-
218 stdout-
219 );-
220 emit_ancillary_info ("fmt");-
221 }
executed 17 times by 1 test: end of block
Executed by:
  • fmt
17
222 exit (status);
executed 21 times by 1 test: exit (status);
Executed by:
  • fmt
21
223}-
224-
225-
226-
227static struct option const long_options[] =-
228{-
229 {"crown-margin", -
230 0-
231 , -
232 ((void *)0)-
233 , 'c'},-
234 {"prefix", -
235 1-
236 , -
237 ((void *)0)-
238 , 'p'},-
239 {"split-only", -
240 0-
241 , -
242 ((void *)0)-
243 , 's'},-
244 {"tagged-paragraph", -
245 0-
246 , -
247 ((void *)0)-
248 , 't'},-
249 {"uniform-spacing", -
250 0-
251 , -
252 ((void *)0)-
253 , 'u'},-
254 {"width", -
255 1-
256 , -
257 ((void *)0)-
258 , 'w'},-
259 {"goal", -
260 1-
261 , -
262 ((void *)0)-
263 , 'g'},-
264 {"help", -
265 0-
266 , -
267 ((void *)0)-
268 , GETOPT_HELP_CHAR},-
269 {"version", -
270 0-
271 , -
272 ((void *)0)-
273 , GETOPT_VERSION_CHAR},-
274 {-
275 ((void *)0)-
276 , 0, -
277 ((void *)0)-
278 , 0},-
279};-
280-
281int-
282main (int argc, char **argv)-
283{-
284 int optchar;-
285 -
286 _Bool -
287 ok = -
288 1-
289 ;-
290 char const *max_width_option = -
291 ((void *)0)-
292 ;-
293 char const *goal_width_option = -
294 ((void *)0)-
295 ;-
296-
297 ;-
298 set_program_name (argv[0]);-
299 setlocale (-
300 6-
301 , "");-
302 bindtextdomain ("coreutils", "/usr/local/share/locale");-
303 textdomain ("coreutils");-
304-
305 atexit (close_stdout);-
306-
307 crown = tagged = split = uniform = -
308 0-
309 ;-
310 max_width = 75;-
311 prefix = "";-
312 prefix_length = prefix_lead_space = prefix_full_length = 0;-
313-
314 if (argc > 1
argc > 1Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 3 times by 1 test
Evaluated by:
  • fmt
&& argv[1][0] == '-'
argv[1][0] == '-'Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
&& ((
((unsigned int...]) - '0' <= 9)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 35 times by 1 test
Evaluated by:
  • fmt
unsigned int) (argv[1][1]) - '0' <= 9)
((unsigned int...]) - '0' <= 9)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 35 times by 1 test
Evaluated by:
  • fmt
)
1-37
315 {-
316-
317 max_width_option = argv[1] + 1;-
318-
319-
320 argv[1] = argv[0];-
321 argv++;-
322 argc--;-
323 }
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
324-
325 while ((
(optchar = get... *)0) )) != -1Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 13 times by 1 test
Evaluated by:
  • fmt
optchar = getopt_long (argc, argv, "0123456789cstuw:p:g:",
(optchar = get... *)0) )) != -1Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 13 times by 1 test
Evaluated by:
  • fmt
13-51
326 long_options,
(optchar = get... *)0) )) != -1Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 13 times by 1 test
Evaluated by:
  • fmt
13-51
327 ((void *)0)
(optchar = get... *)0) )) != -1Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 13 times by 1 test
Evaluated by:
  • fmt
13-51
328 ))
(optchar = get... *)0) )) != -1Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 13 times by 1 test
Evaluated by:
  • fmt
13-51
329 != -1
(optchar = get... *)0) )) != -1Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 13 times by 1 test
Evaluated by:
  • fmt
)
13-51
330 switch (optchar)-
331 {-
332 default
executed 4 times by 1 test: default:
Executed by:
  • fmt
:
executed 4 times by 1 test: default:
Executed by:
  • fmt
4
333 if (((
((unsigned int...r) - '0' <= 9)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 3 times by 1 test
Evaluated by:
  • fmt
unsigned int) (optchar) - '0' <= 9)
((unsigned int...r) - '0' <= 9)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 3 times by 1 test
Evaluated by:
  • fmt
)
1-3
334 error (0, 0,
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
335 dcgettext (((void *)0),
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
336 "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead"
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
337 , 5)
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
338
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
339 ,
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
340 optchar);
executed 1 time by 1 test: error (0, 0, dcgettext (((void *)0), "invalid option -- %c; -WIDTH is recognized only when it is the first\noption; use -w N instead" , 5) , optchar);
Executed by:
  • fmt
1
341 usage (-
342 1-
343 );-
344-
345 case
executed 3 times by 1 test: case 'c':
Executed by:
  • fmt
code before this statement never executed: case 'c':
executed 3 times by 1 test: case 'c':
Executed by:
  • fmt
'c':
code before this statement never executed: case 'c':
executed 3 times by 1 test: case 'c':
Executed by:
  • fmt
0-3
346 crown = -
347 1-
348 ;-
349 break;
executed 3 times by 1 test: break;
Executed by:
  • fmt
3
350-
351 case
executed 3 times by 1 test: case 's':
Executed by:
  • fmt
's':
executed 3 times by 1 test: case 's':
Executed by:
  • fmt
3
352 split = -
353 1-
354 ;-
355 break;
executed 3 times by 1 test: break;
Executed by:
  • fmt
3
356-
357 case
executed 2 times by 1 test: case 't':
Executed by:
  • fmt
't':
executed 2 times by 1 test: case 't':
Executed by:
  • fmt
2
358 tagged = -
359 1-
360 ;-
361 break;
executed 2 times by 1 test: break;
Executed by:
  • fmt
2
362-
363 case
executed 2 times by 1 test: case 'u':
Executed by:
  • fmt
'u':
executed 2 times by 1 test: case 'u':
Executed by:
  • fmt
2
364 uniform = -
365 1-
366 ;-
367 break;
executed 2 times by 1 test: break;
Executed by:
  • fmt
2
368-
369 case
executed 5 times by 1 test: case 'w':
Executed by:
  • fmt
'w':
executed 5 times by 1 test: case 'w':
Executed by:
  • fmt
5
370 max_width_option = optarg;-
371 break;
executed 5 times by 1 test: break;
Executed by:
  • fmt
5
372-
373 case
executed 3 times by 1 test: case 'g':
Executed by:
  • fmt
'g':
executed 3 times by 1 test: case 'g':
Executed by:
  • fmt
3
374 goal_width_option = optarg;-
375 break;
executed 3 times by 1 test: break;
Executed by:
  • fmt
3
376-
377 case
executed 6 times by 1 test: case 'p':
Executed by:
  • fmt
'p':
executed 6 times by 1 test: case 'p':
Executed by:
  • fmt
6
378 set_prefix (optarg);-
379 break;
executed 6 times by 1 test: break;
Executed by:
  • fmt
6
380-
381 case
executed 17 times by 1 test: case GETOPT_HELP_CHAR:
Executed by:
  • fmt
GETOPT_HELP_CHAR:
executed 17 times by 1 test: case GETOPT_HELP_CHAR:
Executed by:
  • fmt
usage (
17
382 0-
383 ); break;
never executed: break;
;
0
384-
385 case
executed 6 times by 1 test: case GETOPT_VERSION_CHAR:
Executed by:
  • fmt
GETOPT_VERSION_CHAR:
executed 6 times by 1 test: case GETOPT_VERSION_CHAR:
Executed by:
  • fmt
version_etc (
6
386 stdout-
387 , "fmt", "GNU coreutils", Version, ("Ross Paterson"), (char *) -
388 ((void *)0)-
389 ); exit (
executed 6 times by 1 test: exit ( 0 );
Executed by:
  • fmt
6
390 0
executed 6 times by 1 test: exit ( 0 );
Executed by:
  • fmt
6
391 );
executed 6 times by 1 test: exit ( 0 );
Executed by:
  • fmt
break;
never executed: break;
;
0-6
392-
393 }-
394-
395 if (max_width_option
max_width_optionDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
)
4-9
396 {-
397-
398-
399 max_width = xdectoumax (max_width_option, 0, 5000 / 2, "",-
400 -
401 dcgettext (((void *)0), -
402 "invalid width"-
403 , 5)-
404 , 0);-
405 }
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
406-
407 if (goal_width_option
goal_width_optionDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
)
1-9
408 {-
409-
410 goal_width = xdectoumax (goal_width_option, 0, max_width, "",-
411 -
412 dcgettext (((void *)0), -
413 "invalid width"-
414 , 5)-
415 , 0);-
416 if (max_width_option ==
max_width_opti...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
0-1
417 ((void *)0)
max_width_opti...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
0-1
418 )-
419 max_width = goal_width + 10;
never executed: max_width = goal_width + 10;
0
420 }
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
421 else-
422 {-
423 goal_width = max_width * (2 * (100 - 7) + 1) / 200;-
424 }
executed 9 times by 1 test: end of block
Executed by:
  • fmt
9
425-
426 if (optind == argc
optind == argcDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
)
3-7
427 fmt (
executed 3 times by 1 test: fmt ( stdin );
Executed by:
  • fmt
3
428 stdin
executed 3 times by 1 test: fmt ( stdin );
Executed by:
  • fmt
3
429 );
executed 3 times by 1 test: fmt ( stdin );
Executed by:
  • fmt
3
430 else-
431 {-
432 for (; optind < argc
optind < argcDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
; optind++)
7
433 {-
434 char *file = argv[optind];-
435 if ((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
436 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
437 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
438 ) && __builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
439 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
440 ) && (__s1_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
441 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
442 ), __s2_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
443 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
444 ), (!((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
445 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
446 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
447 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
448 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
449 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
450 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
451 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
452 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
453 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
454 ,
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
455 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
456 ) : (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
457 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
458 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
459 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
460 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
461 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
462 ) == 1) && (__s1_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
463 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
464 ), __s1_len < 4) ? (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
465 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
466 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
467 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
468 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
469 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
470 ) == 1) ? __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
471 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
472 ,
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
473 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
474 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
475 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
476 ); int __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
477 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
478 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
479 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
480 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
481 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
482 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
483 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]);
0-7
484 ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
485 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
486 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
487 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
488 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
489 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
490 ) == 1) && (__s2_len = __builtin_strlen (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
491 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
492 ), __s2_len < 4) ? (__builtin_constant_p (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
493 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
494 ) && ((size_t)(const void *)((
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
495 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
496 ) + 1) - (size_t)(const void *)(
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
497 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
498 ) == 1) ? __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
499 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
500 ,
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
501 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
502 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
503 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
504 ); int __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
505 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
506 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
507 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
508 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
509 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
510 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
511 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
0-7
512 ))[3] - __s2[3]);
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
}
never executed: end of block
}
never executed: end of block
__result; }))) : __builtin_strcmp (
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
513 file
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
514 ,
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
515 "-"
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
516 )))); })
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
0-7
517 == 0)
( __extension_...)))); }) == 0)Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
)
0-7
518 fmt (
never executed: fmt ( stdin );
0
519 stdin
never executed: fmt ( stdin );
0
520 );
never executed: fmt ( stdin );
0
521 else-
522 {-
523 FILE *in_stream;-
524 in_stream = fopen (file, "r");-
525 if (in_stream !=
in_stream != ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
1-6
526 ((void *)0)
in_stream != ((void *)0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
1-6
527 )-
528 {-
529 fmt (in_stream);-
530 if (-
531 rpl_fclose
rpl_fclose (in_stream) == (-1)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
0-6
532 (in_stream) ==
rpl_fclose (in_stream) == (-1)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
0-6
533 (-1)
rpl_fclose (in_stream) == (-1)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
0-6
534 )-
535 {-
536 error (0, -
537 (*__errno_location ())-
538 , "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file));-
539 ok = -
540 0-
541 ;-
542 }
never executed: end of block
0
543 }
executed 6 times by 1 test: end of block
Executed by:
  • fmt
6
544 else-
545 {-
546 error (0, -
547 (*__errno_location ())-
548 , -
549 dcgettext (((void *)0), -
550 "cannot open %s for reading"-
551 , 5)-
552 ,-
553 quotearg_style (shell_escape_always_quoting_style, file));-
554 ok = -
555 0-
556 ;-
557 }
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
558 }-
559 }-
560 }
executed 7 times by 1 test: end of block
Executed by:
  • fmt
7
561-
562 return
executed 10 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • fmt
ok ?
executed 10 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • fmt
10
563 0
executed 10 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • fmt
10
564 :
executed 10 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • fmt
10
565 1
executed 10 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • fmt
10
566 ;
executed 10 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • fmt
10
567}-
568-
569-
570-
571-
572static void-
573set_prefix (char *p)-
574{-
575 char *s;-
576-
577 prefix_lead_space = 0;-
578 while (*
*p == ' 'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
p == ' '
*p == ' 'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
0-6
579 {-
580 prefix_lead_space++;-
581 p++;-
582 }
never executed: end of block
0
583 prefix = p;-
584 prefix_full_length = strlen (p);-
585 s = p + prefix_full_length;-
586 while (s > p
s > pDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
&& s[-1] == ' '
s[-1] == ' 'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
0-6
587 s--;
never executed: s--;
0
588 *s = '\0';-
589 prefix_length = s - p;-
590}
executed 6 times by 1 test: end of block
Executed by:
  • fmt
6
591-
592-
593-
594static void-
595fmt (FILE *f)-
596{-
597 fadvise (f, FADVISE_SEQUENTIAL);-
598 tabs = -
599 0-
600 ;-
601 other_indent = 0;-
602 next_char = get_prefix (f);-
603 while (get_paragraph (f)
get_paragraph (f)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
)
7-9
604 {-
605 fmt_paragraph ();-
606 put_paragraph (word_limit);-
607 }
executed 7 times by 1 test: end of block
Executed by:
  • fmt
7
608}
executed 9 times by 1 test: end of block
Executed by:
  • fmt
9
609-
610-
611-
612-
613static void-
614set_other_indent (-
615 _Bool -
616 same_paragraph)-
617{-
618 if (split
splitDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
2-6
619 other_indent = first_indent;
executed 2 times by 1 test: other_indent = first_indent;
Executed by:
  • fmt
2
620 else if (crown
crownDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
0-6
621 {-
622 other_indent = (same_paragraph
same_paragraphDescription
TRUEnever evaluated
FALSEnever evaluated
? in_column : first_indent);
0
623 }
never executed: end of block
0
624 else if (tagged
taggedDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
0-6
625 {-
626 if (same_paragraph
same_paragraphDescription
TRUEnever evaluated
FALSEnever evaluated
&& in_column != first_indent
in_column != first_indentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
627 {-
628 other_indent = in_column;-
629 }
never executed: end of block
0
630-
631-
632-
633-
634-
635-
636 else if (other_indent == first_indent
other_indent == first_indentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
637 other_indent = first_indent == 0
first_indent == 0Description
TRUEnever evaluated
FALSEnever evaluated
? 3 : 0;
never executed: other_indent = first_indent == 0 ? 3 : 0;
0
638 }
never executed: end of block
0
639 else-
640 {-
641 other_indent = first_indent;-
642 }
executed 6 times by 1 test: end of block
Executed by:
  • fmt
6
643}-
644static -
645 _Bool-
646-
647get_paragraph (FILE *f)-
648{-
649 int c;-
650-
651 last_line_length = 0;-
652 c = next_char;-
653-
654-
655-
656 while (c == '\n'
c == '\n'Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 20 times by 1 test
Evaluated by:
  • fmt
|| c ==
c == (-1)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 11 times by 1 test
Evaluated by:
  • fmt
3-20
657 (-1)
c == (-1)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 11 times by 1 test
Evaluated by:
  • fmt
9-11
658 -
659 || next_prefix_indent < prefix_lead_space
next_prefix_in...fix_lead_spaceDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • fmt
0-11
660 || in_column < next_prefix_indent + prefix_full_length
in_column < ne...ix_full_lengthDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
)
4-7
661 {-
662 c = copy_rest (f, c);-
663 if (c ==
c == (-1)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
7-9
664 (-1)
c == (-1)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
7-9
665 )-
666 {-
667 next_char = -
668 (-1)-
669 ;-
670 return
executed 9 times by 1 test: return 0 ;
Executed by:
  • fmt
executed 9 times by 1 test: return 0 ;
Executed by:
  • fmt
9
671 0
executed 9 times by 1 test: return 0 ;
Executed by:
  • fmt
9
672 ;
executed 9 times by 1 test: return 0 ;
Executed by:
  • fmt
9
673 }-
674 putchar_unlocked ('\n');-
675 c = get_prefix (f);-
676 }
executed 7 times by 1 test: end of block
Executed by:
  • fmt
7
677-
678-
679-
680 prefix_indent = next_prefix_indent;-
681 first_indent = in_column;-
682 wptr = parabuf;-
683 word_limit = unused_word_type;-
684 c = get_line (f, c);-
685 set_other_indent (same_para (c));-
686-
687-
688-
689 if (split
splitDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
1-6
690 {-
691-
692 }
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
693 else if (crown
crownDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
0-6
694 {-
695 if (same_para (c)
same_para (c)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
696 {-
697 do-
698 {-
699 c = get_line (f, c);-
700 }
never executed: end of block
0
701 while (same_para (c)
same_para (c)Description
TRUEnever evaluated
FALSEnever evaluated
&& in_column == other_indent
in_column == other_indentDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
702 }
never executed: end of block
0
703 }
never executed: end of block
0
704 else if (tagged
taggedDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
)
0-6
705 {-
706 if (same_para (c)
same_para (c)Description
TRUEnever evaluated
FALSEnever evaluated
&& in_column != first_indent
in_column != first_indentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
707 {-
708 do-
709 {-
710 c = get_line (f, c);-
711 }
never executed: end of block
0
712 while (same_para (c)
same_para (c)Description
TRUEnever evaluated
FALSEnever evaluated
&& in_column == other_indent
in_column == other_indentDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
713 }
never executed: end of block
0
714 }
never executed: end of block
0
715 else-
716 {-
717 while (same_para (c)
same_para (c)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
&& in_column == other_indent
in_column == other_indentDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
)
0-16
718 c = get_line (f, c);
executed 16 times by 1 test: c = get_line (f, c);
Executed by:
  • fmt
16
719 }
executed 6 times by 1 test: end of block
Executed by:
  • fmt
6
720-
721-
722-
723 -
724 ((-
725 unused_word_type < word_limit-
726 ) ? (void) (0) : __assert_fail (-
727 "word < word_limit"-
728 , "src/fmt.c", 606, __PRETTY_FUNCTION__))-
729 ;-
730-
731 (word_limit - 1)->period = (word_limit - 1)->final = -
732 1-
733 ;-
734 next_char = c;-
735 return
executed 7 times by 1 test: return 1 ;
Executed by:
  • fmt
executed 7 times by 1 test: return 1 ;
Executed by:
  • fmt
7
736 1
executed 7 times by 1 test: return 1 ;
Executed by:
  • fmt
7
737 ;
executed 7 times by 1 test: return 1 ;
Executed by:
  • fmt
7
738}-
739-
740-
741-
742-
743-
744-
745static int-
746copy_rest (FILE *f, int c)-
747{-
748 const char *s;-
749-
750 out_column = 0;-
751 if (in_column > next_prefix_indent
in_column > next_prefix_indentDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 14 times by 1 test
Evaluated by:
  • fmt
|| (c != '\n'
c != '\n'Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
&& c !=
c != (-1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
1-14
752 (-1)
c != (-1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
4-9
753 ))-
754 {-
755 put_space (next_prefix_indent);-
756 for (s = prefix; out_column != in_column
out_column != in_columnDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
&& *
*sDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
s
*sDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
; out_column++)
0-6
757 putchar_unlocked (*s++);
executed 3 times by 1 test: putchar_unlocked (*s++);
Executed by:
  • fmt
3
758 if (c !=
c != (-1)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
0-6
759 (-1)
c != (-1)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
0-6
760 && c != '\n'
c != '\n'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • fmt
)
2-4
761 put_space (in_column - out_column);
executed 4 times by 1 test: put_space (in_column - out_column);
Executed by:
  • fmt
4
762 if (c ==
c == (-1)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
0-6
763 (-1)
c == (-1)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • fmt
0-6
764 && in_column >= next_prefix_indent + prefix_length
in_column >= n... prefix_lengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
765 putchar_unlocked ('\n');
never executed: putchar_unlocked ('\n');
0
766 }
executed 6 times by 1 test: end of block
Executed by:
  • fmt
6
767 while (c != '\n'
c != '\n'Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
&& c !=
c != (-1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
4-13
768 (-1)
c != (-1)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
4-9
769 )-
770 {-
771 putchar_unlocked (c);-
772 c = getc_unlocked (f);-
773 }
executed 4 times by 1 test: end of block
Executed by:
  • fmt
4
774 return
executed 16 times by 1 test: return c;
Executed by:
  • fmt
c;
executed 16 times by 1 test: return c;
Executed by:
  • fmt
16
775}-
776-
777-
778-
779-
780-
781static -
782 _Bool-
783-
784same_para (int c)-
785{-
786 return
executed 29 times by 1 test: return (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );
Executed by:
  • fmt
(next_prefix_indent == prefix_indent
executed 29 times by 1 test: return (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );
Executed by:
  • fmt
29
787 && in_column >= next_prefix_indent + prefix_full_length
executed 29 times by 1 test: return (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );
Executed by:
  • fmt
29
788 && c != '\n' && c !=
executed 29 times by 1 test: return (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );
Executed by:
  • fmt
29
789 (-1)
executed 29 times by 1 test: return (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );
Executed by:
  • fmt
29
790 );
executed 29 times by 1 test: return (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );
Executed by:
  • fmt
29
791}-
792static int-
793get_line (FILE *f, int c)-
794{-
795 int start;-
796 char *end_of_parabuf;-
797 WORD *end_of_word;-
798-
799 end_of_parabuf = &parabuf[5000];-
800 end_of_word = &unused_word_type[1000 - 2];-
801-
802 do-
803 {-
804-
805-
806-
807 word_limit->text = wptr;-
808 do-
809 {-
810 if (wptr == end_of_parabuf
wptr == end_of_parabufDescription
TRUEnever evaluated
FALSEevaluated 1586 times by 1 test
Evaluated by:
  • fmt
)
0-1586
811 {-
812 set_other_indent (-
813 1-
814 );-
815 flush_paragraph ();-
816 }
never executed: end of block
0
817 *wptr++ = c;-
818 c = getc_unlocked (f);-
819 }
executed 1586 times by 1 test: end of block
Executed by:
  • fmt
1586
820 while (c !=
c != (-1)Description
TRUEevaluated 1586 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
0-1586
821 (-1)
c != (-1)Description
TRUEevaluated 1586 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
0-1586
822 && !
! ((*__ctype_b...int) _ISspace)Description
TRUEevaluated 454 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
454-1132
823 ((*__ctype_b_loc ())[(int) ((
! ((*__ctype_b...int) _ISspace)Description
TRUEevaluated 454 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
454-1132
824 c
! ((*__ctype_b...int) _ISspace)Description
TRUEevaluated 454 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
454-1132
825 ))] & (unsigned short int) _ISspace)
! ((*__ctype_b...int) _ISspace)Description
TRUEevaluated 454 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
454-1132
826 );-
827 in_column += word_limit->length = wptr - word_limit->text;-
828 check_punctuation (word_limit);-
829-
830-
831-
832 start = in_column;-
833 c = get_space (f, c);-
834 word_limit->space = in_column - start;-
835 word_limit->final = (c ==
c == (-1)Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
0-1132
836 (-1)
c == (-1)Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
0-1132
837 -
838 || (word_limit->period
word_limit->periodDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1127 times by 1 test
Evaluated by:
  • fmt
5-1127
839 && (c == '\n'
c == '\n'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 4 times by 1 test
Evaluated by:
  • fmt
|| word_limit->space > 1
word_limit->space > 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • fmt
)));
1-4
840 if (c == '\n'
c == '\n'Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
|| c ==
c == (-1)Description
TRUEnever evaluated
FALSEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
0-1109
841 (-1)
c == (-1)Description
TRUEnever evaluated
FALSEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
0-1109
842 || uniform
uniformDescription
TRUEnever evaluated
FALSEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
)
0-1109
843 word_limit->space = word_limit->final
word_limit->finalDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 22 times by 1 test
Evaluated by:
  • fmt
? 2 : 1;
executed 23 times by 1 test: word_limit->space = word_limit->final ? 2 : 1;
Executed by:
  • fmt
1-23
844 if (word_limit == end_of_word
word_limit == end_of_wordDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1131 times by 1 test
Evaluated by:
  • fmt
)
1-1131
845 {-
846 set_other_indent (-
847 1-
848 );-
849 flush_paragraph ();-
850 }
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
851 word_limit++;-
852 }
executed 1132 times by 1 test: end of block
Executed by:
  • fmt
1132
853 while (c != '\n'
c != '\n'Description
TRUEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 23 times by 1 test
Evaluated by:
  • fmt
&& c !=
c != (-1)Description
TRUEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
0-1109
854 (-1)
c != (-1)Description
TRUEevaluated 1109 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
0-1109
855 );-
856 return
executed 23 times by 1 test: return get_prefix (f);
Executed by:
  • fmt
get_prefix (f);
executed 23 times by 1 test: return get_prefix (f);
Executed by:
  • fmt
23
857}-
858-
859-
860-
861-
862static int-
863get_prefix (FILE *f)-
864{-
865 int c;-
866-
867 in_column = 0;-
868 c = get_space (f, getc_unlocked (f));-
869 if (prefix_length == 0
prefix_length == 0Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 14 times by 1 test
Evaluated by:
  • fmt
)
14-25
870 next_prefix_indent = prefix_lead_space < in_column
prefix_lead_space < in_columnDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • fmt
FALSEevaluated 24 times by 1 test
Evaluated by:
  • fmt
?
executed 25 times by 1 test: next_prefix_indent = prefix_lead_space < in_column ? prefix_lead_space : in_column;
Executed by:
  • fmt
1-25
871 prefix_lead_space : in_column;
executed 25 times by 1 test: next_prefix_indent = prefix_lead_space < in_column ? prefix_lead_space : in_column;
Executed by:
  • fmt
25
872 else-
873 {-
874 const char *p;-
875 next_prefix_indent = in_column;-
876 for (p = prefix; *
*p != '\0'Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 5 times by 1 test
Evaluated by:
  • fmt
p != '\0'
*p != '\0'Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 5 times by 1 test
Evaluated by:
  • fmt
; p++)
5-18
877 {-
878 unsigned char pc = *p;-
879 if (c != pc
c != pcDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 9 times by 1 test
Evaluated by:
  • fmt
)
9
880 return
executed 9 times by 1 test: return c;
Executed by:
  • fmt
c;
executed 9 times by 1 test: return c;
Executed by:
  • fmt
9
881 in_column++;-
882 c = getc_unlocked (f);-
883 }
executed 9 times by 1 test: end of block
Executed by:
  • fmt
9
884 c = get_space (f, c);-
885 }
executed 5 times by 1 test: end of block
Executed by:
  • fmt
5
886 return
executed 30 times by 1 test: return c;
Executed by:
  • fmt
c;
executed 30 times by 1 test: return c;
Executed by:
  • fmt
30
887}-
888-
889-
890-
891-
892static int-
893get_space (FILE *f, int c)-
894{-
895 while (-
896 1-
897 )-
898 {-
899 if (c == ' '
c == ' 'Description
TRUEevaluated 1117 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1179 times by 1 test
Evaluated by:
  • fmt
)
1117-1179
900 in_column++;
executed 1117 times by 1 test: in_column++;
Executed by:
  • fmt
1117
901 else if (c == '\t'
c == '\t'Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1176 times by 1 test
Evaluated by:
  • fmt
)
3-1176
902 {-
903 tabs = -
904 1-
905 ;-
906 in_column = (in_column / 8 + 1) * 8;-
907 }
executed 3 times by 1 test: end of block
Executed by:
  • fmt
3
908 else-
909 return
executed 1176 times by 1 test: return c;
Executed by:
  • fmt
c;
executed 1176 times by 1 test: return c;
Executed by:
  • fmt
1176
910 c = getc_unlocked (f);-
911 }
executed 1120 times by 1 test: end of block
Executed by:
  • fmt
1120
912}
never executed: end of block
0
913-
914-
915-
916static void-
917check_punctuation (WORD *w)-
918{-
919 char const *start = w->text;-
920 char const *finish = start + (w->length - 1);-
921 unsigned char fin = *finish;-
922-
923 w->paren = (-
924 (__extension__ (__builtin_constant_p (
__builtin_cons...t_p ( *start )Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
0-1132
925 *start
__builtin_cons...t_p ( *start )Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
0-1132
926 )
__builtin_cons...t_p ( *start )Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
&& !__builtin_constant_p (
!__builtin_con...p ( "(['`\"" )Description
TRUEnever evaluated
FALSEnever evaluated
0-1132
927 "(['`\""
!__builtin_con...p ( "(['`\"" )Description
TRUEnever evaluated
FALSEnever evaluated
0
928 )
!__builtin_con...p ( "(['`\"" )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( *start ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
929 *start
( *start ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
930 ) == '\0'
( *start ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
? (char *) __rawmemchr (
0
931 "(['`\""-
932 , -
933 *start-
934 ) : __builtin_strchr (-
935 "(['`\""-
936 , -
937 *start-
938 ))) -
939 != -
940 ((void *)0)-
941 );-
942 w->punct = !! -
943 ((*__ctype_b_loc ())[(int) ((-
944 fin-
945 ))] & (unsigned short int) _ISpunct)-
946 ;-
947 while (start < finish
start < finishDescription
TRUEevaluated 101 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1033 times by 1 test
Evaluated by:
  • fmt
&& (
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-1033
948 (__extension__ (__builtin_constant_p (
__builtin_cons..._p ( *finish )Description
TRUEnever evaluated
FALSEevaluated 101 times by 1 test
Evaluated by:
  • fmt
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-101
949 *finish
__builtin_cons..._p ( *finish )Description
TRUEnever evaluated
FALSEevaluated 101 times by 1 test
Evaluated by:
  • fmt
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-101
950 )
__builtin_cons..._p ( *finish )Description
TRUEnever evaluated
FALSEevaluated 101 times by 1 test
Evaluated by:
  • fmt
&& !__builtin_constant_p (
!__builtin_con..._p ( ")]'\"" )Description
TRUEnever evaluated
FALSEnever evaluated
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-101
951 ")]'\""
!__builtin_con..._p ( ")]'\"" )Description
TRUEnever evaluated
FALSEnever evaluated
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-99
952 )
!__builtin_con..._p ( ")]'\"" )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( *finish ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-99
953 *finish
( *finish ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-99
954 ) == '\0'
( *finish ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
? (char *) __rawmemchr (
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
0-99
955 ")]'\""
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
956 ,
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
957 *finish
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
958 ) : __builtin_strchr (
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
959 ")]'\""
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
960 ,
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
961 *finish
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
962 )))
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
963 !=
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
964 ((void *)0)
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
2-99
965 )
( (__extension... ((void *)0) )Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 99 times by 1 test
Evaluated by:
  • fmt
)
2-99
966 finish--;
executed 2 times by 1 test: finish--;
Executed by:
  • fmt
2
967 w->period = (-
968 (__extension__ (__builtin_constant_p (
__builtin_cons..._p ( *finish )Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
0-1132
969 *finish
__builtin_cons..._p ( *finish )Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
0-1132
970 )
__builtin_cons..._p ( *finish )Description
TRUEnever evaluated
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
&& !__builtin_constant_p (
!__builtin_con...nt_p ( ".?!" )Description
TRUEnever evaluated
FALSEnever evaluated
0-1132
971 ".?!"
!__builtin_con...nt_p ( ".?!" )Description
TRUEnever evaluated
FALSEnever evaluated
0
972 )
!__builtin_con...nt_p ( ".?!" )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( *finish ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
973 *finish
( *finish ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
974 ) == '\0'
( *finish ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
? (char *) __rawmemchr (
0
975 ".?!"-
976 , -
977 *finish-
978 ) : __builtin_strchr (-
979 ".?!"-
980 , -
981 *finish-
982 ))) -
983 != -
984 ((void *)0)-
985 );-
986}
executed 1132 times by 1 test: end of block
Executed by:
  • fmt
1132
987-
988-
989-
990-
991static void-
992flush_paragraph (void)-
993{-
994 WORD *split_point;-
995 WORD *w;-
996 int shift;-
997 COST best_break;-
998-
999-
1000-
1001 if (word_limit == unused_word_type
word_limit == unused_word_typeDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
)
0-1
1002 {-
1003 -
1004 (__extension__ ((__builtin_constant_p (-
1005 sizeof *parabuf-
1006 ) && __builtin_constant_p (-
1007 wptr - parabuf-
1008 ) && (size_t) (-
1009 sizeof *parabuf-
1010 ) * (size_t) (-
1011 wptr - parabuf-
1012 ) <= 8 && (size_t) (-
1013 sizeof *parabuf-
1014 ) != 0) ? ({ const char *__ptr = (const char *) (-
1015 parabuf-
1016 ); FILE *__stream = (stdout); size_t __cnt; for (__cnt = (size_t) (-
1017 sizeof *parabuf-
1018 ) * (size_t) (-
1019 wptr - parabuf-
1020 ); __cnt > 0
__cnt > 0Description
TRUEnever evaluated
FALSEnever evaluated
; --__cnt) if ((
(__builtin_exp...r++))) == (-1)Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0)
__builtin_expe...write_end), 0)Description
TRUEnever evaluated
FALSEnever evaluated
? __overflow (__stream, (unsigned char) (*__ptr++)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (*__ptr++))) == (-1)
(__builtin_exp...r++))) == (-1)Description
TRUEnever evaluated
FALSEnever evaluated
) break;
never executed: break;
((size_t) (
0
1021 sizeof *parabuf-
1022 ) * (size_t) (-
1023 wptr - parabuf-
1024 ) - __cnt) / (size_t) (-
1025 sizeof *parabuf-
1026 ); }) : (((__builtin_constant_p (-
1027 sizeof *parabuf-
1028 ) && (size_t) (-
1029 sizeof *parabuf-
1030 ) == 0) || (__builtin_constant_p (-
1031 wptr - parabuf-
1032 ) && (size_t) (-
1033 wptr - parabuf-
1034 ) == 0)) ? ((void) (-
1035 parabuf-
1036 ), (void) (stdout), (void) (-
1037 sizeof *parabuf-
1038 ), (void) (-
1039 wptr - parabuf-
1040 ), (size_t) 0) : fwrite_unlocked (-
1041 parabuf-
1042 , -
1043 sizeof *parabuf-
1044 , -
1045 wptr - parabuf-
1046 , stdout))))-
1047 ;-
1048 wptr = parabuf;-
1049 return;
never executed: return;
0
1050 }-
1051-
1052-
1053-
1054-
1055-
1056-
1057-
1058 fmt_paragraph ();-
1059-
1060-
1061-
1062 split_point = word_limit;-
1063 best_break = ((COST) (! (! ((COST) 0 < (COST) -1)) ? (COST) -1 : ((((COST) 1 << ((sizeof (COST) * 8) - 2)) - 1) * 2 + 1)));-
1064 for (w = unused_word_type->next_break; w != word_limit
w != word_limitDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
; w = w->next_break)
1-28
1065 {-
1066 if (w->best_cost - w->next_break->best_cost < best_break
w->best_cost -...t < best_breakDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
)
0-28
1067 {-
1068 split_point = w;-
1069 best_break = w->best_cost - w->next_break->best_cost;-
1070 }
executed 28 times by 1 test: end of block
Executed by:
  • fmt
28
1071 if (best_break <= ((COST) (! (! ((COST) 0 < (COST) -1)) ? (COST) -1 : ((((COST) 1 << ((sizeof (COST) * 8) - 2)) - 1) * 2 + 1))) - (((COST) (3)) * ((COST) (3)))
best_break <= ... ((COST) (3)))Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • fmt
FALSEnever evaluated
)
0-28
1072 best_break += (((COST) (3)) * ((COST) (3)));
executed 28 times by 1 test: best_break += (((COST) (3)) * ((COST) (3)));
Executed by:
  • fmt
28
1073 }
executed 28 times by 1 test: end of block
Executed by:
  • fmt
28
1074 put_paragraph (split_point);-
1075-
1076-
1077-
1078-
1079 memmove (parabuf, split_point->text, wptr - split_point->text);-
1080 shift = split_point->text - parabuf;-
1081 wptr -= shift;-
1082-
1083-
1084-
1085 for (w = split_point; w <= word_limit
w <= word_limitDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1 time by 1 test
Evaluated by:
  • fmt
; w++)
1-19
1086 w->text -= shift;
executed 19 times by 1 test: w->text -= shift;
Executed by:
  • fmt
19
1087-
1088-
1089-
1090-
1091 memmove (unused_word_type, split_point, (word_limit - split_point + 1) * sizeof *unused_word_type);-
1092 word_limit -= split_point - unused_word_type;-
1093}
executed 1 time by 1 test: end of block
Executed by:
  • fmt
1
1094-
1095-
1096-
1097-
1098-
1099static void-
1100fmt_paragraph (void)-
1101{-
1102 WORD *start, *w;-
1103 int len;-
1104 COST wcost, best;-
1105 int saved_length;-
1106-
1107 word_limit->best_cost = 0;-
1108 saved_length = word_limit->length;-
1109 word_limit->length = max_width;-
1110-
1111 for (start = word_limit - 1; start >= unused_word_type
start >= unused_word_typeDescription
TRUEevaluated 1150 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 8 times by 1 test
Evaluated by:
  • fmt
; start--)
8-1150
1112 {-
1113 best = ((COST) (! (! ((COST) 0 < (COST) -1)) ? (COST) -1 : ((((COST) 1 << ((sizeof (COST) * 8) - 2)) - 1) * 2 + 1)));-
1114 len = start == unused_word_type
start == unused_word_typeDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1142 times by 1 test
Evaluated by:
  • fmt
? first_indent : other_indent;
8-1142
1115-
1116-
1117-
1118 w = start;-
1119 len += w->length;-
1120 do-
1121 {-
1122 w++;-
1123-
1124-
1125-
1126 wcost = line_cost (w, len) + w->best_cost;-
1127 if (start == unused_word_type
start == unused_word_typeDescription
TRUEevaluated 96 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 37994 times by 1 test
Evaluated by:
  • fmt
&& last_line_length > 0
last_line_length > 0Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 61 times by 1 test
Evaluated by:
  • fmt
)
35-37994
1128 wcost += ((((COST) ((len - last_line_length) * 10)) * ((COST) ((len - last_line_length) * 10))) / 2);
executed 35 times by 1 test: wcost += ((((COST) ((len - last_line_length) * 10)) * ((COST) ((len - last_line_length) * 10))) / 2);
Executed by:
  • fmt
35
1129 if (wcost < best
wcost < bestDescription
TRUEevaluated 35993 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2097 times by 1 test
Evaluated by:
  • fmt
)
2097-35993
1130 {-
1131 best = wcost;-
1132 start->next_break = w;-
1133 start->line_length = len;-
1134 }
executed 35993 times by 1 test: end of block
Executed by:
  • fmt
35993
1135-
1136-
1137-
1138-
1139-
1140 if (w == word_limit
w == word_limitDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 37998 times by 1 test
Evaluated by:
  • fmt
)
92-37998
1141 break;
executed 92 times by 1 test: break;
Executed by:
  • fmt
92
1142-
1143 len += (w - 1)->space + w->length;-
1144 }
executed 37998 times by 1 test: end of block
Executed by:
  • fmt
37998
1145 while (len < max_width
len < max_widthDescription
TRUEevaluated 36940 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1058 times by 1 test
Evaluated by:
  • fmt
);
1058-36940
1146 start->best_cost = best + base_cost (start);-
1147 }
executed 1150 times by 1 test: end of block
Executed by:
  • fmt
1150
1148-
1149 word_limit->length = saved_length;-
1150}
executed 8 times by 1 test: end of block
Executed by:
  • fmt
8
1151-
1152-
1153-
1154-
1155static COST-
1156base_cost (WORD *this)-
1157{-
1158 COST cost;-
1159-
1160 cost = (((COST) (70)) * ((COST) (70)));-
1161-
1162 if (this > unused_word_type
this > unused_word_typeDescription
TRUEevaluated 1142 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 8 times by 1 test
Evaluated by:
  • fmt
)
8-1142
1163 {-
1164 if ((
(this - 1)->periodDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1138 times by 1 test
Evaluated by:
  • fmt
this - 1)->period
(this - 1)->periodDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1138 times by 1 test
Evaluated by:
  • fmt
)
4-1138
1165 {-
1166 if ((
(this - 1)->finalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • fmt
this - 1)->final
(this - 1)->finalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • fmt
)
2
1167 cost -= (((COST) (50)) * ((COST) (50)));
executed 2 times by 1 test: cost -= (((COST) (50)) * ((COST) (50)));
Executed by:
  • fmt
2
1168 else-
1169 cost += (((COST) (600)) * ((COST) (600)));
executed 2 times by 1 test: cost += (((COST) (600)) * ((COST) (600)));
Executed by:
  • fmt
2
1170 }-
1171 else if ((
(this - 1)->punctDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • fmt
this - 1)->punct
(this - 1)->punctDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • fmt
)
14-1124
1172 cost -= (((COST) (40)) * ((COST) (40)));
executed 14 times by 1 test: cost -= (((COST) (40)) * ((COST) (40)));
Executed by:
  • fmt
14
1173 else if (this > unused_word_type + 1
this > unused_word_type + 1Description
TRUEevaluated 1117 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 7 times by 1 test
Evaluated by:
  • fmt
&& (
(this - 2)->finalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1115 times by 1 test
Evaluated by:
  • fmt
this - 2)->final
(this - 2)->finalDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1115 times by 1 test
Evaluated by:
  • fmt
)
2-1117
1174 cost += ((((COST) (200)) * ((COST) (200))) / (((this - 1)->length) + 2));
executed 2 times by 1 test: cost += ((((COST) (200)) * ((COST) (200))) / (((this - 1)->length) + 2));
Executed by:
  • fmt
2
1175 }
executed 1142 times by 1 test: end of block
Executed by:
  • fmt
1142
1176-
1177 if (this->paren
this->parenDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1147 times by 1 test
Evaluated by:
  • fmt
)
3-1147
1178 cost -= (((COST) (40)) * ((COST) (40)));
executed 3 times by 1 test: cost -= (((COST) (40)) * ((COST) (40)));
Executed by:
  • fmt
3
1179 else if (this->final
this->finalDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1138 times by 1 test
Evaluated by:
  • fmt
)
9-1138
1180 cost += ((((COST) (150)) * ((COST) (150))) / ((this->length) + 2));
executed 9 times by 1 test: cost += ((((COST) (150)) * ((COST) (150))) / ((this->length) + 2));
Executed by:
  • fmt
9
1181-
1182 return
executed 1150 times by 1 test: return cost;
Executed by:
  • fmt
cost;
executed 1150 times by 1 test: return cost;
Executed by:
  • fmt
1150
1183}-
1184-
1185-
1186-
1187-
1188static COST-
1189line_cost (WORD *next, int len)-
1190{-
1191 int n;-
1192 COST cost;-
1193-
1194 if (next == word_limit
next == word_limitDescription
TRUEevaluated 92 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 37998 times by 1 test
Evaluated by:
  • fmt
)
92-37998
1195 return
executed 92 times by 1 test: return 0;
Executed by:
  • fmt
0;
executed 92 times by 1 test: return 0;
Executed by:
  • fmt
92
1196 n = goal_width - len;-
1197 cost = (((COST) ((n) * 10)) * ((COST) ((n) * 10)));-
1198 if (next->next_break != word_limit
next->next_break != word_limitDescription
TRUEevaluated 35973 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2025 times by 1 test
Evaluated by:
  • fmt
)
2025-35973
1199 {-
1200 n = len - next->line_length;-
1201 cost += ((((COST) ((n) * 10)) * ((COST) ((n) * 10))) / 2);-
1202 }
executed 35973 times by 1 test: end of block
Executed by:
  • fmt
35973
1203 return
executed 37998 times by 1 test: return cost;
Executed by:
  • fmt
cost;
executed 37998 times by 1 test: return cost;
Executed by:
  • fmt
37998
1204}-
1205-
1206-
1207-
1208-
1209static void-
1210put_paragraph (WORD *finish)-
1211{-
1212 WORD *w;-
1213-
1214 put_line (unused_word_type, first_indent);-
1215 for (w = unused_word_type->next_break; w != finish
w != finishDescription
TRUEevaluated 37 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 8 times by 1 test
Evaluated by:
  • fmt
; w = w->next_break)
8-37
1216 put_line (w, other_indent);
executed 37 times by 1 test: put_line (w, other_indent);
Executed by:
  • fmt
37
1217}
executed 8 times by 1 test: end of block
Executed by:
  • fmt
8
1218-
1219-
1220-
1221-
1222static void-
1223put_line (WORD *w, int indent)-
1224{-
1225 WORD *endline;-
1226-
1227 out_column = 0;-
1228 put_space (prefix_indent);-
1229 fputs_unlocked (prefix,-
1230 stdout-
1231 );-
1232 out_column += prefix_length;-
1233 put_space (indent - out_column);-
1234-
1235 endline = w->next_break - 1;-
1236 for (; w != endline
w != endlineDescription
TRUEevaluated 1087 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 45 times by 1 test
Evaluated by:
  • fmt
; w++)
45-1087
1237 {-
1238 put_word (w);-
1239 put_space (w->space);-
1240 }
executed 1087 times by 1 test: end of block
Executed by:
  • fmt
1087
1241 put_word (w);-
1242 last_line_length = out_column;-
1243 putchar_unlocked ('\n');-
1244}
executed 45 times by 1 test: end of block
Executed by:
  • fmt
45
1245-
1246-
1247-
1248static void-
1249put_word (WORD *w)-
1250{-
1251 const char *s;-
1252 int n;-
1253-
1254 s = w->text;-
1255 for (n = w->length; n != 0
n != 0Description
TRUEevaluated 1586 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • fmt
; n--)
1132-1586
1256 putchar_unlocked (*s++);
executed 1586 times by 1 test: putchar_unlocked (*s++);
Executed by:
  • fmt
1586
1257 out_column += w->length;-
1258}
executed 1132 times by 1 test: end of block
Executed by:
  • fmt
1132
1259-
1260-
1261-
1262static void-
1263put_space (int space)-
1264{-
1265 int space_target, tab_target;-
1266-
1267 space_target = out_column + space;-
1268 if (tabs
tabsDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1180 times by 1 test
Evaluated by:
  • fmt
)
7-1180
1269 {-
1270 tab_target = space_target / 8 * 8;-
1271 if (out_column + 1 < tab_target
out_column + 1 < tab_targetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 5 times by 1 test
Evaluated by:
  • fmt
)
2-5
1272 while (out_column < tab_target
out_column < tab_targetDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 2 times by 1 test
Evaluated by:
  • fmt
)
2-3
1273 {-
1274 putchar_unlocked ('\t');-
1275 out_column = (out_column / 8 + 1) * 8;-
1276 }
executed 3 times by 1 test: end of block
Executed by:
  • fmt
3
1277 }
executed 7 times by 1 test: end of block
Executed by:
  • fmt
7
1278 while (out_column < space_target
out_column < space_targetDescription
TRUEevaluated 1122 times by 1 test
Evaluated by:
  • fmt
FALSEevaluated 1187 times by 1 test
Evaluated by:
  • fmt
)
1122-1187
1279 {-
1280 putchar_unlocked (' ');-
1281 out_column++;-
1282 }
executed 1122 times by 1 test: end of block
Executed by:
  • fmt
1122
1283}
executed 1187 times by 1 test: end of block
Executed by:
  • fmt
1187
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2