| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/fmt.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | typedef long int COST; | - | ||||||||||||||||||||||||
| 7 | typedef struct Word WORD; | - | ||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | struct 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 | - | |||||||||||||||||||||||||
| 31 | static void set_prefix (char *p); | - | ||||||||||||||||||||||||
| 32 | static void fmt (FILE *f); | - | ||||||||||||||||||||||||
| 33 | static | - | ||||||||||||||||||||||||
| 34 | _Bool | - | ||||||||||||||||||||||||
| 35 | get_paragraph (FILE *f); | - | ||||||||||||||||||||||||
| 36 | static int get_line (FILE *f, int c); | - | ||||||||||||||||||||||||
| 37 | static int get_prefix (FILE *f); | - | ||||||||||||||||||||||||
| 38 | static int get_space (FILE *f, int c); | - | ||||||||||||||||||||||||
| 39 | static int copy_rest (FILE *f, int c); | - | ||||||||||||||||||||||||
| 40 | static | - | ||||||||||||||||||||||||
| 41 | _Bool | - | ||||||||||||||||||||||||
| 42 | same_para (int c); | - | ||||||||||||||||||||||||
| 43 | static void flush_paragraph (void); | - | ||||||||||||||||||||||||
| 44 | static void fmt_paragraph (void); | - | ||||||||||||||||||||||||
| 45 | static void check_punctuation (WORD *w); | - | ||||||||||||||||||||||||
| 46 | static COST base_cost (WORD *this); | - | ||||||||||||||||||||||||
| 47 | static COST line_cost (WORD *next, int len); | - | ||||||||||||||||||||||||
| 48 | static void put_paragraph (WORD *finish); | - | ||||||||||||||||||||||||
| 49 | static void put_line (WORD *w, int indent); | - | ||||||||||||||||||||||||
| 50 | static void put_word (WORD *w); | - | ||||||||||||||||||||||||
| 51 | static void put_space (int space); | - | ||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | static | - | ||||||||||||||||||||||||
| 57 | _Bool | - | ||||||||||||||||||||||||
| 58 | crown; | - | ||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | static | - | ||||||||||||||||||||||||
| 62 | _Bool | - | ||||||||||||||||||||||||
| 63 | tagged; | - | ||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||
| 66 | static | - | ||||||||||||||||||||||||
| 67 | _Bool | - | ||||||||||||||||||||||||
| 68 | split; | - | ||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | static | - | ||||||||||||||||||||||||
| 72 | _Bool | - | ||||||||||||||||||||||||
| 73 | uniform; | - | ||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | static const char *prefix; | - | ||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | static int max_width; | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||
| 85 | static int prefix_full_length; | - | ||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | static int prefix_lead_space; | - | ||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | - | |||||||||||||||||||||||||
| 91 | static int prefix_length; | - | ||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | static int goal_width; | - | ||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | static int in_column; | - | ||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | static int out_column; | - | ||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | static char parabuf[5000]; | - | ||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||
| 109 | static char *wptr; | - | ||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||
| 111 | - | |||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | static WORD unused_word_type[1000]; | - | ||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||
| 118 | static WORD *word_limit; | - | ||||||||||||||||||||||||
| 119 | - | |||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||
| 122 | static | - | ||||||||||||||||||||||||
| 123 | _Bool | - | ||||||||||||||||||||||||
| 124 | tabs; | - | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||
| 127 | static int prefix_indent; | - | ||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | static int first_indent; | - | ||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | static int other_indent; | - | ||||||||||||||||||||||||
| 134 | static int next_char; | - | ||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | static int next_prefix_indent; | - | ||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||
| 140 | - | |||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | - | |||||||||||||||||||||||||
| 143 | static int last_line_length; | - | ||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||
| 145 | void | - | ||||||||||||||||||||||||
| 146 | usage (int status) | - | ||||||||||||||||||||||||
| 147 | { | - | ||||||||||||||||||||||||
| 148 | if (status !=
| 4-17 | ||||||||||||||||||||||||
| 149 | 0
| 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: while (0);end of blockExecuted by:
| 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 blockExecuted by:
| 17 | ||||||||||||||||||||||||
| 222 | exit (status); executed 21 times by 1 test: exit (status);Executed by:
| 21 | ||||||||||||||||||||||||
| 223 | } | - | ||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | static 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 | - | |||||||||||||||||||||||||
| 281 | int | - | ||||||||||||||||||||||||
| 282 | main (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
| 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||
| 325 | while ((
| 13-51 | ||||||||||||||||||||||||
| 326 | long_options,
| 13-51 | ||||||||||||||||||||||||
| 327 | ((void *)0)
| 13-51 | ||||||||||||||||||||||||
| 328 | ))
| 13-51 | ||||||||||||||||||||||||
| 329 | != -1
| 13-51 | ||||||||||||||||||||||||
| 330 | switch (optchar) | - | ||||||||||||||||||||||||
| 331 | { | - | ||||||||||||||||||||||||
| 332 | default executed 4 times by 1 test: :default:Executed by:
executed 4 times by 1 test: default:Executed by:
| 4 | ||||||||||||||||||||||||
| 333 | if (((
| 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:
| 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:
| 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:
| 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:
| 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:
| 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:
| 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:
| 1 | ||||||||||||||||||||||||
| 341 | usage ( | - | ||||||||||||||||||||||||
| 342 | 1 | - | ||||||||||||||||||||||||
| 343 | ); | - | ||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||
| 345 | case executed 3 times by 1 test: case 'c':Executed by:
code before this statement never executed: case 'c':executed 3 times by 1 test: 'c':case 'c':Executed by:
code before this statement never executed: case 'c':executed 3 times by 1 test: case 'c':Executed by:
| 0-3 | ||||||||||||||||||||||||
| 346 | crown = | - | ||||||||||||||||||||||||
| 347 | 1 | - | ||||||||||||||||||||||||
| 348 | ; | - | ||||||||||||||||||||||||
| 349 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||
| 350 | - | |||||||||||||||||||||||||
| 351 | case executed 3 times by 1 test: 's':case 's':Executed by:
executed 3 times by 1 test: case 's':Executed by:
| 3 | ||||||||||||||||||||||||
| 352 | split = | - | ||||||||||||||||||||||||
| 353 | 1 | - | ||||||||||||||||||||||||
| 354 | ; | - | ||||||||||||||||||||||||
| 355 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | case executed 2 times by 1 test: 't':case 't':Executed by:
executed 2 times by 1 test: case 't':Executed by:
| 2 | ||||||||||||||||||||||||
| 358 | tagged = | - | ||||||||||||||||||||||||
| 359 | 1 | - | ||||||||||||||||||||||||
| 360 | ; | - | ||||||||||||||||||||||||
| 361 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||
| 362 | - | |||||||||||||||||||||||||
| 363 | case executed 2 times by 1 test: 'u':case 'u':Executed by:
executed 2 times by 1 test: case 'u':Executed by:
| 2 | ||||||||||||||||||||||||
| 364 | uniform = | - | ||||||||||||||||||||||||
| 365 | 1 | - | ||||||||||||||||||||||||
| 366 | ; | - | ||||||||||||||||||||||||
| 367 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | case executed 5 times by 1 test: 'w':case 'w':Executed by:
executed 5 times by 1 test: case 'w':Executed by:
| 5 | ||||||||||||||||||||||||
| 370 | max_width_option = optarg; | - | ||||||||||||||||||||||||
| 371 | break; executed 5 times by 1 test: break;Executed by:
| 5 | ||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||
| 373 | case executed 3 times by 1 test: 'g':case 'g':Executed by:
executed 3 times by 1 test: case 'g':Executed by:
| 3 | ||||||||||||||||||||||||
| 374 | goal_width_option = optarg; | - | ||||||||||||||||||||||||
| 375 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||
| 377 | case executed 6 times by 1 test: 'p':case 'p':Executed by:
executed 6 times by 1 test: case 'p':Executed by:
| 6 | ||||||||||||||||||||||||
| 378 | set_prefix (optarg); | - | ||||||||||||||||||||||||
| 379 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||
| 381 | case executed 17 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 17 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 17 | ||||||||||||||||||||||||
| 382 | 0 | - | ||||||||||||||||||||||||
| 383 | ); break; never executed: ;break; | 0 | ||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | case executed 6 times by 1 test: GETOPT_VERSION_CHAR:case GETOPT_VERSION_CHAR:Executed by:
executed 6 times by 1 test: version_etc (case GETOPT_VERSION_CHAR:Executed by:
| 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:
| 6 | ||||||||||||||||||||||||
| 390 | 0 executed 6 times by 1 test: exit ( 0 );Executed by:
| 6 | ||||||||||||||||||||||||
| 391 | ); executed 6 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-6 | ||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||
| 393 | } | - | ||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||
| 395 | if (max_width_option
| 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||
| 407 | if (goal_width_option
| 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 ==
| 0-1 | ||||||||||||||||||||||||
| 417 | ((void *)0)
| 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 421 | else | - | ||||||||||||||||||||||||
| 422 | { | - | ||||||||||||||||||||||||
| 423 | goal_width = max_width * (2 * (100 - 7) + 1) / 200; | - | ||||||||||||||||||||||||
| 424 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||
| 425 | - | |||||||||||||||||||||||||
| 426 | if (optind == argc
| 3-7 | ||||||||||||||||||||||||
| 427 | fmt ( executed 3 times by 1 test: fmt ( stdin );Executed by:
| 3 | ||||||||||||||||||||||||
| 428 | stdin executed 3 times by 1 test: fmt ( stdin );Executed by:
| 3 | ||||||||||||||||||||||||
| 429 | ); executed 3 times by 1 test: fmt ( stdin );Executed by:
| 3 | ||||||||||||||||||||||||
| 430 | else | - | ||||||||||||||||||||||||
| 431 | { | - | ||||||||||||||||||||||||
| 432 | for (; optind < argc
| 7 | ||||||||||||||||||||||||
| 433 | { | - | ||||||||||||||||||||||||
| 434 | char *file = argv[optind]; | - | ||||||||||||||||||||||||
| 435 | if ((
| 0-7 | ||||||||||||||||||||||||
| 436 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 0-7 | ||||||||||||||||||||||||
| 437 | file
| 0-7 | ||||||||||||||||||||||||
| 438 | ) && __builtin_constant_p (
| 0-7 | ||||||||||||||||||||||||
| 439 | "-"
| 0-7 | ||||||||||||||||||||||||
| 440 | ) && (__s1_len = __builtin_strlen (
| 0-7 | ||||||||||||||||||||||||
| 441 | file
| 0-7 | ||||||||||||||||||||||||
| 442 | ), __s2_len = __builtin_strlen (
| 0-7 | ||||||||||||||||||||||||
| 443 | "-"
| 0-7 | ||||||||||||||||||||||||
| 444 | ), (!((size_t)(const void *)((
| 0-7 | ||||||||||||||||||||||||
| 445 | file
| 0-7 | ||||||||||||||||||||||||
| 446 | ) + 1) - (size_t)(const void *)(
| 0-7 | ||||||||||||||||||||||||
| 447 | file
| 0-7 | ||||||||||||||||||||||||
| 448 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 0-7 | ||||||||||||||||||||||||
| 449 | "-"
| 0-7 | ||||||||||||||||||||||||
| 450 | ) + 1) - (size_t)(const void *)(
| 0-7 | ||||||||||||||||||||||||
| 451 | "-"
| 0-7 | ||||||||||||||||||||||||
| 452 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 0-7 | ||||||||||||||||||||||||
| 453 | file
| 0-7 | ||||||||||||||||||||||||
| 454 | ,
| 0-7 | ||||||||||||||||||||||||
| 455 | "-"
| 0-7 | ||||||||||||||||||||||||
| 456 | ) : (__builtin_constant_p (
| 0-7 | ||||||||||||||||||||||||
| 457 | file
| 0-7 | ||||||||||||||||||||||||
| 458 | ) && ((size_t)(const void *)((
| 0-7 | ||||||||||||||||||||||||
| 459 | file
| 0-7 | ||||||||||||||||||||||||
| 460 | ) + 1) - (size_t)(const void *)(
| 0-7 | ||||||||||||||||||||||||
| 461 | file
| 0-7 | ||||||||||||||||||||||||
| 462 | ) == 1) && (__s1_len = __builtin_strlen (
| 0-7 | ||||||||||||||||||||||||
| 463 | file
| 0-7 | ||||||||||||||||||||||||
| 464 | ), __s1_len < 4) ? (__builtin_constant_p (
| 0-7 | ||||||||||||||||||||||||
| 465 | "-"
| 0-7 | ||||||||||||||||||||||||
| 466 | ) && ((size_t)(const void *)((
| 0-7 | ||||||||||||||||||||||||
| 467 | "-"
| 0-7 | ||||||||||||||||||||||||
| 468 | ) + 1) - (size_t)(const void *)(
| 0-7 | ||||||||||||||||||||||||
| 469 | "-"
| 0-7 | ||||||||||||||||||||||||
| 470 | ) == 1) ? __builtin_strcmp (
| 0-7 | ||||||||||||||||||||||||
| 471 | file
| 0-7 | ||||||||||||||||||||||||
| 472 | ,
| 0-7 | ||||||||||||||||||||||||
| 473 | "-"
| 0-7 | ||||||||||||||||||||||||
| 474 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-7 | ||||||||||||||||||||||||
| 475 | "-"
| 0-7 | ||||||||||||||||||||||||
| 476 | ); int __result = (((const unsigned char *) (const char *) (
| 0-7 | ||||||||||||||||||||||||
| 477 | file
| 0-7 | ||||||||||||||||||||||||
| 478 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-7 | ||||||||||||||||||||||||
| 479 | file
| 0-7 | ||||||||||||||||||||||||
| 480 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-7 | ||||||||||||||||||||||||
| 481 | file
| 0-7 | ||||||||||||||||||||||||
| 482 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]);
| 0-7 | ||||||||||||||||||||||||
| 483 | file
never executed: __result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]); | 0-7 | ||||||||||||||||||||||||
| 484 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( file ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-7 | ||||||||||||||||||||||||
| 485 | "-"
| 0-7 | ||||||||||||||||||||||||
| 486 | ) && ((size_t)(const void *)((
| 0-7 | ||||||||||||||||||||||||
| 487 | "-"
| 0-7 | ||||||||||||||||||||||||
| 488 | ) + 1) - (size_t)(const void *)(
| 0-7 | ||||||||||||||||||||||||
| 489 | "-"
| 0-7 | ||||||||||||||||||||||||
| 490 | ) == 1) && (__s2_len = __builtin_strlen (
| 0-7 | ||||||||||||||||||||||||
| 491 | "-"
| 0-7 | ||||||||||||||||||||||||
| 492 | ), __s2_len < 4) ? (__builtin_constant_p (
| 0-7 | ||||||||||||||||||||||||
| 493 | file
| 0-7 | ||||||||||||||||||||||||
| 494 | ) && ((size_t)(const void *)((
| 0-7 | ||||||||||||||||||||||||
| 495 | file
| 0-7 | ||||||||||||||||||||||||
| 496 | ) + 1) - (size_t)(const void *)(
| 0-7 | ||||||||||||||||||||||||
| 497 | file
| 0-7 | ||||||||||||||||||||||||
| 498 | ) == 1) ? __builtin_strcmp (
| 0-7 | ||||||||||||||||||||||||
| 499 | file
| 0-7 | ||||||||||||||||||||||||
| 500 | ,
| 0-7 | ||||||||||||||||||||||||
| 501 | "-"
| 0-7 | ||||||||||||||||||||||||
| 502 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-7 | ||||||||||||||||||||||||
| 503 | file
| 0-7 | ||||||||||||||||||||||||
| 504 | ); int __result = (((const unsigned char *) (const char *) (
| 0-7 | ||||||||||||||||||||||||
| 505 | "-"
| 0-7 | ||||||||||||||||||||||||
| 506 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-7 | ||||||||||||||||||||||||
| 507 | "-"
| 0-7 | ||||||||||||||||||||||||
| 508 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-7 | ||||||||||||||||||||||||
| 509 | "-"
| 0-7 | ||||||||||||||||||||||||
| 510 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);
| 0-7 | ||||||||||||||||||||||||
| 511 | "-"
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0-7 | ||||||||||||||||||||||||
| 512 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : __builtin_strcmp (end of block
| 0-7 | ||||||||||||||||||||||||
| 513 | file
| 0-7 | ||||||||||||||||||||||||
| 514 | ,
| 0-7 | ||||||||||||||||||||||||
| 515 | "-"
| 0-7 | ||||||||||||||||||||||||
| 516 | )))); })
| 0-7 | ||||||||||||||||||||||||
| 517 | == 0)
| 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 !=
| 1-6 | ||||||||||||||||||||||||
| 526 | ((void *)0)
| 1-6 | ||||||||||||||||||||||||
| 527 | ) | - | ||||||||||||||||||||||||
| 528 | { | - | ||||||||||||||||||||||||
| 529 | fmt (in_stream); | - | ||||||||||||||||||||||||
| 530 | if ( | - | ||||||||||||||||||||||||
| 531 | rpl_fclose
| 0-6 | ||||||||||||||||||||||||
| 532 | (in_stream) ==
| 0-6 | ||||||||||||||||||||||||
| 533 | (-1)
| 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 blockExecuted by:
| 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 558 | } | - | ||||||||||||||||||||||||
| 559 | } | - | ||||||||||||||||||||||||
| 560 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||
| 562 | return executed 10 times by 1 test: ok ? return ok ? 0 : 1 ;Executed by:
executed 10 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 563 | 0 executed 10 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 564 | : executed 10 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 565 | 1 executed 10 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 566 | ; executed 10 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 567 | } | - | ||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||
| 572 | static void | - | ||||||||||||||||||||||||
| 573 | set_prefix (char *p) | - | ||||||||||||||||||||||||
| 574 | { | - | ||||||||||||||||||||||||
| 575 | char *s; | - | ||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||
| 577 | prefix_lead_space = 0; | - | ||||||||||||||||||||||||
| 578 | while (*
| 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
| 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 blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 591 | - | |||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||
| 593 | - | |||||||||||||||||||||||||
| 594 | static void | - | ||||||||||||||||||||||||
| 595 | fmt (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)
| 7-9 | ||||||||||||||||||||||||
| 604 | { | - | ||||||||||||||||||||||||
| 605 | fmt_paragraph (); | - | ||||||||||||||||||||||||
| 606 | put_paragraph (word_limit); | - | ||||||||||||||||||||||||
| 607 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 608 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||
| 610 | - | |||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||
| 613 | static void | - | ||||||||||||||||||||||||
| 614 | set_other_indent ( | - | ||||||||||||||||||||||||
| 615 | _Bool | - | ||||||||||||||||||||||||
| 616 | same_paragraph) | - | ||||||||||||||||||||||||
| 617 | { | - | ||||||||||||||||||||||||
| 618 | if (split
| 2-6 | ||||||||||||||||||||||||
| 619 | other_indent = first_indent; executed 2 times by 1 test: other_indent = first_indent;Executed by:
| 2 | ||||||||||||||||||||||||
| 620 | else if (crown
| 0-6 | ||||||||||||||||||||||||
| 621 | { | - | ||||||||||||||||||||||||
| 622 | other_indent = (same_paragraph
| 0 | ||||||||||||||||||||||||
| 623 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 624 | else if (tagged
| 0-6 | ||||||||||||||||||||||||
| 625 | { | - | ||||||||||||||||||||||||
| 626 | if (same_paragraph
| 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
| 0 | ||||||||||||||||||||||||
| 637 | other_indent = first_indent == 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 blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 643 | } | - | ||||||||||||||||||||||||
| 644 | static | - | ||||||||||||||||||||||||
| 645 | _Bool | - | ||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||
| 647 | get_paragraph (FILE *f) | - | ||||||||||||||||||||||||
| 648 | { | - | ||||||||||||||||||||||||
| 649 | int c; | - | ||||||||||||||||||||||||
| 650 | - | |||||||||||||||||||||||||
| 651 | last_line_length = 0; | - | ||||||||||||||||||||||||
| 652 | c = next_char; | - | ||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||
| 654 | - | |||||||||||||||||||||||||
| 655 | - | |||||||||||||||||||||||||
| 656 | while (c == '\n'
| 3-20 | ||||||||||||||||||||||||
| 657 | (-1)
| 9-11 | ||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||
| 659 | || next_prefix_indent < prefix_lead_space
| 0-11 | ||||||||||||||||||||||||
| 660 | || in_column < next_prefix_indent + prefix_full_length
| 4-7 | ||||||||||||||||||||||||
| 661 | { | - | ||||||||||||||||||||||||
| 662 | c = copy_rest (f, c); | - | ||||||||||||||||||||||||
| 663 | if (c ==
| 7-9 | ||||||||||||||||||||||||
| 664 | (-1)
| 7-9 | ||||||||||||||||||||||||
| 665 | ) | - | ||||||||||||||||||||||||
| 666 | { | - | ||||||||||||||||||||||||
| 667 | next_char = | - | ||||||||||||||||||||||||
| 668 | (-1) | - | ||||||||||||||||||||||||
| 669 | ; | - | ||||||||||||||||||||||||
| 670 | return executed 9 times by 1 test: return 0 ;Executed by:
executed 9 times by 1 test: return 0 ;Executed by:
| 9 | ||||||||||||||||||||||||
| 671 | 0 executed 9 times by 1 test: return 0 ;Executed by:
| 9 | ||||||||||||||||||||||||
| 672 | ; executed 9 times by 1 test: return 0 ;Executed by:
| 9 | ||||||||||||||||||||||||
| 673 | } | - | ||||||||||||||||||||||||
| 674 | putchar_unlocked ('\n'); | - | ||||||||||||||||||||||||
| 675 | c = get_prefix (f); | - | ||||||||||||||||||||||||
| 676 | } executed 7 times by 1 test: end of blockExecuted by:
| 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
| 1-6 | ||||||||||||||||||||||||
| 690 | { | - | ||||||||||||||||||||||||
| 691 | - | |||||||||||||||||||||||||
| 692 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 693 | else if (crown
| 0-6 | ||||||||||||||||||||||||
| 694 | { | - | ||||||||||||||||||||||||
| 695 | if (same_para (c)
| 0 | ||||||||||||||||||||||||
| 696 | { | - | ||||||||||||||||||||||||
| 697 | do | - | ||||||||||||||||||||||||
| 698 | { | - | ||||||||||||||||||||||||
| 699 | c = get_line (f, c); | - | ||||||||||||||||||||||||
| 700 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 701 | while (same_para (c)
| 0 | ||||||||||||||||||||||||
| 702 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 703 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 704 | else if (tagged
| 0-6 | ||||||||||||||||||||||||
| 705 | { | - | ||||||||||||||||||||||||
| 706 | if (same_para (c)
| 0 | ||||||||||||||||||||||||
| 707 | { | - | ||||||||||||||||||||||||
| 708 | do | - | ||||||||||||||||||||||||
| 709 | { | - | ||||||||||||||||||||||||
| 710 | c = get_line (f, c); | - | ||||||||||||||||||||||||
| 711 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 712 | while (same_para (c)
| 0 | ||||||||||||||||||||||||
| 713 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 714 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 715 | else | - | ||||||||||||||||||||||||
| 716 | { | - | ||||||||||||||||||||||||
| 717 | while (same_para (c)
| 0-16 | ||||||||||||||||||||||||
| 718 | c = get_line (f, c); executed 16 times by 1 test: c = get_line (f, c);Executed by:
| 16 | ||||||||||||||||||||||||
| 719 | } executed 6 times by 1 test: end of blockExecuted by:
| 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:
executed 7 times by 1 test: return 1 ;Executed by:
| 7 | ||||||||||||||||||||||||
| 736 | 1 executed 7 times by 1 test: return 1 ;Executed by:
| 7 | ||||||||||||||||||||||||
| 737 | ; executed 7 times by 1 test: return 1 ;Executed by:
| 7 | ||||||||||||||||||||||||
| 738 | } | - | ||||||||||||||||||||||||
| 739 | - | |||||||||||||||||||||||||
| 740 | - | |||||||||||||||||||||||||
| 741 | - | |||||||||||||||||||||||||
| 742 | - | |||||||||||||||||||||||||
| 743 | - | |||||||||||||||||||||||||
| 744 | - | |||||||||||||||||||||||||
| 745 | static int | - | ||||||||||||||||||||||||
| 746 | copy_rest (FILE *f, int c) | - | ||||||||||||||||||||||||
| 747 | { | - | ||||||||||||||||||||||||
| 748 | const char *s; | - | ||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||
| 750 | out_column = 0; | - | ||||||||||||||||||||||||
| 751 | if (in_column > next_prefix_indent
| 1-14 | ||||||||||||||||||||||||
| 752 | (-1)
| 4-9 | ||||||||||||||||||||||||
| 753 | )) | - | ||||||||||||||||||||||||
| 754 | { | - | ||||||||||||||||||||||||
| 755 | put_space (next_prefix_indent); | - | ||||||||||||||||||||||||
| 756 | for (s = prefix; out_column != in_column
| 0-6 | ||||||||||||||||||||||||
| 757 | putchar_unlocked (*s++); executed 3 times by 1 test: putchar_unlocked (*s++);Executed by:
| 3 | ||||||||||||||||||||||||
| 758 | if (c !=
| 0-6 | ||||||||||||||||||||||||
| 759 | (-1)
| 0-6 | ||||||||||||||||||||||||
| 760 | && c != '\n'
| 2-4 | ||||||||||||||||||||||||
| 761 | put_space (in_column - out_column); executed 4 times by 1 test: put_space (in_column - out_column);Executed by:
| 4 | ||||||||||||||||||||||||
| 762 | if (c ==
| 0-6 | ||||||||||||||||||||||||
| 763 | (-1)
| 0-6 | ||||||||||||||||||||||||
| 764 | && in_column >= next_prefix_indent + prefix_length
| 0 | ||||||||||||||||||||||||
| 765 | putchar_unlocked ('\n'); never executed: putchar_unlocked ('\n'); | 0 | ||||||||||||||||||||||||
| 766 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 767 | while (c != '\n'
| 4-13 | ||||||||||||||||||||||||
| 768 | (-1)
| 4-9 | ||||||||||||||||||||||||
| 769 | ) | - | ||||||||||||||||||||||||
| 770 | { | - | ||||||||||||||||||||||||
| 771 | putchar_unlocked (c); | - | ||||||||||||||||||||||||
| 772 | c = getc_unlocked (f); | - | ||||||||||||||||||||||||
| 773 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 774 | return executed 16 times by 1 test: c;return c;Executed by:
executed 16 times by 1 test: return c;Executed by:
| 16 | ||||||||||||||||||||||||
| 775 | } | - | ||||||||||||||||||||||||
| 776 | - | |||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||
| 781 | static | - | ||||||||||||||||||||||||
| 782 | _Bool | - | ||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||
| 784 | same_para (int c) | - | ||||||||||||||||||||||||
| 785 | { | - | ||||||||||||||||||||||||
| 786 | return executed 29 times by 1 test: (next_prefix_indent == prefix_indentreturn (next_prefix_indent == prefix_indent && in_column >= next_prefix_indent + prefix_full_length && c != '\n' && c != (-1) );Executed by:
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:
| 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:
| 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:
| 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:
| 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:
| 29 | ||||||||||||||||||||||||
| 791 | } | - | ||||||||||||||||||||||||
| 792 | static int | - | ||||||||||||||||||||||||
| 793 | get_line (FILE *f, int c) | - | ||||||||||||||||||||||||
| 794 | { | - | ||||||||||||||||||||||||
| 795 | int start; | - | ||||||||||||||||||||||||
| 796 | char *end_of_parabuf; | - | ||||||||||||||||||||||||
| 797 | WORD *end_of_word; | - | ||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||
| 799 | end_of_parabuf = ¶buf[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
| 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 blockExecuted by:
| 1586 | ||||||||||||||||||||||||
| 820 | while (c !=
| 0-1586 | ||||||||||||||||||||||||
| 821 | (-1)
| 0-1586 | ||||||||||||||||||||||||
| 822 | && !
| 454-1132 | ||||||||||||||||||||||||
| 823 | ((*__ctype_b_loc ())[(int) ((
| 454-1132 | ||||||||||||||||||||||||
| 824 | c
| 454-1132 | ||||||||||||||||||||||||
| 825 | ))] & (unsigned short int) _ISspace)
| 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 ==
| 0-1132 | ||||||||||||||||||||||||
| 836 | (-1)
| 0-1132 | ||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||
| 838 | || (word_limit->period
| 5-1127 | ||||||||||||||||||||||||
| 839 | && (c == '\n'
| 1-4 | ||||||||||||||||||||||||
| 840 | if (c == '\n'
| 0-1109 | ||||||||||||||||||||||||
| 841 | (-1)
| 0-1109 | ||||||||||||||||||||||||
| 842 | || uniform
| 0-1109 | ||||||||||||||||||||||||
| 843 | word_limit->space = word_limit->final
executed 23 times by 1 test: word_limit->space = word_limit->final ? 2 : 1;Executed by:
| 1-23 | ||||||||||||||||||||||||
| 844 | if (word_limit == end_of_word
| 1-1131 | ||||||||||||||||||||||||
| 845 | { | - | ||||||||||||||||||||||||
| 846 | set_other_indent ( | - | ||||||||||||||||||||||||
| 847 | 1 | - | ||||||||||||||||||||||||
| 848 | ); | - | ||||||||||||||||||||||||
| 849 | flush_paragraph (); | - | ||||||||||||||||||||||||
| 850 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 851 | word_limit++; | - | ||||||||||||||||||||||||
| 852 | } executed 1132 times by 1 test: end of blockExecuted by:
| 1132 | ||||||||||||||||||||||||
| 853 | while (c != '\n'
| 0-1109 | ||||||||||||||||||||||||
| 854 | (-1)
| 0-1109 | ||||||||||||||||||||||||
| 855 | ); | - | ||||||||||||||||||||||||
| 856 | return executed 23 times by 1 test: get_prefix (f);return get_prefix (f);Executed by:
executed 23 times by 1 test: return get_prefix (f);Executed by:
| 23 | ||||||||||||||||||||||||
| 857 | } | - | ||||||||||||||||||||||||
| 858 | - | |||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||
| 860 | - | |||||||||||||||||||||||||
| 861 | - | |||||||||||||||||||||||||
| 862 | static int | - | ||||||||||||||||||||||||
| 863 | get_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
| 14-25 | ||||||||||||||||||||||||
| 870 | next_prefix_indent = 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:
| 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:
| 25 | ||||||||||||||||||||||||
| 872 | else | - | ||||||||||||||||||||||||
| 873 | { | - | ||||||||||||||||||||||||
| 874 | const char *p; | - | ||||||||||||||||||||||||
| 875 | next_prefix_indent = in_column; | - | ||||||||||||||||||||||||
| 876 | for (p = prefix; *
| 5-18 | ||||||||||||||||||||||||
| 877 | { | - | ||||||||||||||||||||||||
| 878 | unsigned char pc = *p; | - | ||||||||||||||||||||||||
| 879 | if (c != pc
| 9 | ||||||||||||||||||||||||
| 880 | return executed 9 times by 1 test: c;return c;Executed by:
executed 9 times by 1 test: return c;Executed by:
| 9 | ||||||||||||||||||||||||
| 881 | in_column++; | - | ||||||||||||||||||||||||
| 882 | c = getc_unlocked (f); | - | ||||||||||||||||||||||||
| 883 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||
| 884 | c = get_space (f, c); | - | ||||||||||||||||||||||||
| 885 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 886 | return executed 30 times by 1 test: c;return c;Executed by:
executed 30 times by 1 test: return c;Executed by:
| 30 | ||||||||||||||||||||||||
| 887 | } | - | ||||||||||||||||||||||||
| 888 | - | |||||||||||||||||||||||||
| 889 | - | |||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||
| 892 | static int | - | ||||||||||||||||||||||||
| 893 | get_space (FILE *f, int c) | - | ||||||||||||||||||||||||
| 894 | { | - | ||||||||||||||||||||||||
| 895 | while ( | - | ||||||||||||||||||||||||
| 896 | 1 | - | ||||||||||||||||||||||||
| 897 | ) | - | ||||||||||||||||||||||||
| 898 | { | - | ||||||||||||||||||||||||
| 899 | if (c == ' '
| 1117-1179 | ||||||||||||||||||||||||
| 900 | in_column++; executed 1117 times by 1 test: in_column++;Executed by:
| 1117 | ||||||||||||||||||||||||
| 901 | else if (c == '\t'
| 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 blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 908 | else | - | ||||||||||||||||||||||||
| 909 | return executed 1176 times by 1 test: c;return c;Executed by:
executed 1176 times by 1 test: return c;Executed by:
| 1176 | ||||||||||||||||||||||||
| 910 | c = getc_unlocked (f); | - | ||||||||||||||||||||||||
| 911 | } executed 1120 times by 1 test: end of blockExecuted by:
| 1120 | ||||||||||||||||||||||||
| 912 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||
| 914 | - | |||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||
| 916 | static void | - | ||||||||||||||||||||||||
| 917 | check_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 (
| 0-1132 | ||||||||||||||||||||||||
| 925 | *start
| 0-1132 | ||||||||||||||||||||||||
| 926 | )
| 0-1132 | ||||||||||||||||||||||||
| 927 | "(['`\""
| 0 | ||||||||||||||||||||||||
| 928 | )
| 0 | ||||||||||||||||||||||||
| 929 | *start
| 0 | ||||||||||||||||||||||||
| 930 | ) == '\0'
| 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
| 2-1033 | ||||||||||||||||||||||||
| 948 | (__extension__ (__builtin_constant_p (
| 0-101 | ||||||||||||||||||||||||
| 949 | *finish
| 0-101 | ||||||||||||||||||||||||
| 950 | )
| 0-101 | ||||||||||||||||||||||||
| 951 | ")]'\""
| 0-99 | ||||||||||||||||||||||||
| 952 | )
| 0-99 | ||||||||||||||||||||||||
| 953 | *finish
| 0-99 | ||||||||||||||||||||||||
| 954 | ) == '\0'
| 0-99 | ||||||||||||||||||||||||
| 955 | ")]'\""
| 2-99 | ||||||||||||||||||||||||
| 956 | ,
| 2-99 | ||||||||||||||||||||||||
| 957 | *finish
| 2-99 | ||||||||||||||||||||||||
| 958 | ) : __builtin_strchr (
| 2-99 | ||||||||||||||||||||||||
| 959 | ")]'\""
| 2-99 | ||||||||||||||||||||||||
| 960 | ,
| 2-99 | ||||||||||||||||||||||||
| 961 | *finish
| 2-99 | ||||||||||||||||||||||||
| 962 | )))
| 2-99 | ||||||||||||||||||||||||
| 963 | !=
| 2-99 | ||||||||||||||||||||||||
| 964 | ((void *)0)
| 2-99 | ||||||||||||||||||||||||
| 965 | )
| 2-99 | ||||||||||||||||||||||||
| 966 | finish--; executed 2 times by 1 test: finish--;Executed by:
| 2 | ||||||||||||||||||||||||
| 967 | w->period = ( | - | ||||||||||||||||||||||||
| 968 | (__extension__ (__builtin_constant_p (
| 0-1132 | ||||||||||||||||||||||||
| 969 | *finish
| 0-1132 | ||||||||||||||||||||||||
| 970 | )
| 0-1132 | ||||||||||||||||||||||||
| 971 | ".?!"
| 0 | ||||||||||||||||||||||||
| 972 | )
| 0 | ||||||||||||||||||||||||
| 973 | *finish
| 0 | ||||||||||||||||||||||||
| 974 | ) == '\0'
| 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 blockExecuted by:
| 1132 | ||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||
| 991 | static void | - | ||||||||||||||||||||||||
| 992 | flush_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
| 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
never executed: ((size_t) (break; | 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
| 1-28 | ||||||||||||||||||||||||
| 1065 | { | - | ||||||||||||||||||||||||
| 1066 | if (w->best_cost - w->next_break->best_cost < best_break
| 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 blockExecuted by:
| 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)))
| 0-28 | ||||||||||||||||||||||||
| 1072 | best_break += (((COST) (3)) * ((COST) (3))); executed 28 times by 1 test: best_break += (((COST) (3)) * ((COST) (3)));Executed by:
| 28 | ||||||||||||||||||||||||
| 1073 | } executed 28 times by 1 test: end of blockExecuted by:
| 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
| 1-19 | ||||||||||||||||||||||||
| 1086 | w->text -= shift; executed 19 times by 1 test: w->text -= shift;Executed by:
| 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||
| 1095 | - | |||||||||||||||||||||||||
| 1096 | - | |||||||||||||||||||||||||
| 1097 | - | |||||||||||||||||||||||||
| 1098 | - | |||||||||||||||||||||||||
| 1099 | static void | - | ||||||||||||||||||||||||
| 1100 | fmt_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
| 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
| 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
| 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:
| 35 | ||||||||||||||||||||||||
| 1129 | if (wcost < best
| 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 blockExecuted by:
| 35993 | ||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||
| 1136 | - | |||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||
| 1138 | - | |||||||||||||||||||||||||
| 1139 | - | |||||||||||||||||||||||||
| 1140 | if (w == word_limit
| 92-37998 | ||||||||||||||||||||||||
| 1141 | break; executed 92 times by 1 test: break;Executed by:
| 92 | ||||||||||||||||||||||||
| 1142 | - | |||||||||||||||||||||||||
| 1143 | len += (w - 1)->space + w->length; | - | ||||||||||||||||||||||||
| 1144 | } executed 37998 times by 1 test: end of blockExecuted by:
| 37998 | ||||||||||||||||||||||||
| 1145 | while (len < max_width
| 1058-36940 | ||||||||||||||||||||||||
| 1146 | start->best_cost = best + base_cost (start); | - | ||||||||||||||||||||||||
| 1147 | } executed 1150 times by 1 test: end of blockExecuted by:
| 1150 | ||||||||||||||||||||||||
| 1148 | - | |||||||||||||||||||||||||
| 1149 | word_limit->length = saved_length; | - | ||||||||||||||||||||||||
| 1150 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 1151 | - | |||||||||||||||||||||||||
| 1152 | - | |||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||
| 1154 | - | |||||||||||||||||||||||||
| 1155 | static COST | - | ||||||||||||||||||||||||
| 1156 | base_cost (WORD *this) | - | ||||||||||||||||||||||||
| 1157 | { | - | ||||||||||||||||||||||||
| 1158 | COST cost; | - | ||||||||||||||||||||||||
| 1159 | - | |||||||||||||||||||||||||
| 1160 | cost = (((COST) (70)) * ((COST) (70))); | - | ||||||||||||||||||||||||
| 1161 | - | |||||||||||||||||||||||||
| 1162 | if (this > unused_word_type
| 8-1142 | ||||||||||||||||||||||||
| 1163 | { | - | ||||||||||||||||||||||||
| 1164 | if ((
| 4-1138 | ||||||||||||||||||||||||
| 1165 | { | - | ||||||||||||||||||||||||
| 1166 | if ((
| 2 | ||||||||||||||||||||||||
| 1167 | cost -= (((COST) (50)) * ((COST) (50))); executed 2 times by 1 test: cost -= (((COST) (50)) * ((COST) (50)));Executed by:
| 2 | ||||||||||||||||||||||||
| 1168 | else | - | ||||||||||||||||||||||||
| 1169 | cost += (((COST) (600)) * ((COST) (600))); executed 2 times by 1 test: cost += (((COST) (600)) * ((COST) (600)));Executed by:
| 2 | ||||||||||||||||||||||||
| 1170 | } | - | ||||||||||||||||||||||||
| 1171 | else if ((
| 14-1124 | ||||||||||||||||||||||||
| 1172 | cost -= (((COST) (40)) * ((COST) (40))); executed 14 times by 1 test: cost -= (((COST) (40)) * ((COST) (40)));Executed by:
| 14 | ||||||||||||||||||||||||
| 1173 | else if (this > unused_word_type + 1
| 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:
| 2 | ||||||||||||||||||||||||
| 1175 | } executed 1142 times by 1 test: end of blockExecuted by:
| 1142 | ||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||
| 1177 | if (this->paren
| 3-1147 | ||||||||||||||||||||||||
| 1178 | cost -= (((COST) (40)) * ((COST) (40))); executed 3 times by 1 test: cost -= (((COST) (40)) * ((COST) (40)));Executed by:
| 3 | ||||||||||||||||||||||||
| 1179 | else if (this->final
| 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:
| 9 | ||||||||||||||||||||||||
| 1181 | - | |||||||||||||||||||||||||
| 1182 | return executed 1150 times by 1 test: cost;return cost;Executed by:
executed 1150 times by 1 test: return cost;Executed by:
| 1150 | ||||||||||||||||||||||||
| 1183 | } | - | ||||||||||||||||||||||||
| 1184 | - | |||||||||||||||||||||||||
| 1185 | - | |||||||||||||||||||||||||
| 1186 | - | |||||||||||||||||||||||||
| 1187 | - | |||||||||||||||||||||||||
| 1188 | static COST | - | ||||||||||||||||||||||||
| 1189 | line_cost (WORD *next, int len) | - | ||||||||||||||||||||||||
| 1190 | { | - | ||||||||||||||||||||||||
| 1191 | int n; | - | ||||||||||||||||||||||||
| 1192 | COST cost; | - | ||||||||||||||||||||||||
| 1193 | - | |||||||||||||||||||||||||
| 1194 | if (next == word_limit
| 92-37998 | ||||||||||||||||||||||||
| 1195 | return executed 92 times by 1 test: 0;return 0;Executed by:
executed 92 times by 1 test: return 0;Executed by:
| 92 | ||||||||||||||||||||||||
| 1196 | n = goal_width - len; | - | ||||||||||||||||||||||||
| 1197 | cost = (((COST) ((n) * 10)) * ((COST) ((n) * 10))); | - | ||||||||||||||||||||||||
| 1198 | if (next->next_break != word_limit
| 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 blockExecuted by:
| 35973 | ||||||||||||||||||||||||
| 1203 | return executed 37998 times by 1 test: cost;return cost;Executed by:
executed 37998 times by 1 test: return cost;Executed by:
| 37998 | ||||||||||||||||||||||||
| 1204 | } | - | ||||||||||||||||||||||||
| 1205 | - | |||||||||||||||||||||||||
| 1206 | - | |||||||||||||||||||||||||
| 1207 | - | |||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||
| 1209 | static void | - | ||||||||||||||||||||||||
| 1210 | put_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
| 8-37 | ||||||||||||||||||||||||
| 1216 | put_line (w, other_indent); executed 37 times by 1 test: put_line (w, other_indent);Executed by:
| 37 | ||||||||||||||||||||||||
| 1217 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 1218 | - | |||||||||||||||||||||||||
| 1219 | - | |||||||||||||||||||||||||
| 1220 | - | |||||||||||||||||||||||||
| 1221 | - | |||||||||||||||||||||||||
| 1222 | static void | - | ||||||||||||||||||||||||
| 1223 | put_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
| 45-1087 | ||||||||||||||||||||||||
| 1237 | { | - | ||||||||||||||||||||||||
| 1238 | put_word (w); | - | ||||||||||||||||||||||||
| 1239 | put_space (w->space); | - | ||||||||||||||||||||||||
| 1240 | } executed 1087 times by 1 test: end of blockExecuted by:
| 1087 | ||||||||||||||||||||||||
| 1241 | put_word (w); | - | ||||||||||||||||||||||||
| 1242 | last_line_length = out_column; | - | ||||||||||||||||||||||||
| 1243 | putchar_unlocked ('\n'); | - | ||||||||||||||||||||||||
| 1244 | } executed 45 times by 1 test: end of blockExecuted by:
| 45 | ||||||||||||||||||||||||
| 1245 | - | |||||||||||||||||||||||||
| 1246 | - | |||||||||||||||||||||||||
| 1247 | - | |||||||||||||||||||||||||
| 1248 | static void | - | ||||||||||||||||||||||||
| 1249 | put_word (WORD *w) | - | ||||||||||||||||||||||||
| 1250 | { | - | ||||||||||||||||||||||||
| 1251 | const char *s; | - | ||||||||||||||||||||||||
| 1252 | int n; | - | ||||||||||||||||||||||||
| 1253 | - | |||||||||||||||||||||||||
| 1254 | s = w->text; | - | ||||||||||||||||||||||||
| 1255 | for (n = w->length; n != 0
| 1132-1586 | ||||||||||||||||||||||||
| 1256 | putchar_unlocked (*s++); executed 1586 times by 1 test: putchar_unlocked (*s++);Executed by:
| 1586 | ||||||||||||||||||||||||
| 1257 | out_column += w->length; | - | ||||||||||||||||||||||||
| 1258 | } executed 1132 times by 1 test: end of blockExecuted by:
| 1132 | ||||||||||||||||||||||||
| 1259 | - | |||||||||||||||||||||||||
| 1260 | - | |||||||||||||||||||||||||
| 1261 | - | |||||||||||||||||||||||||
| 1262 | static void | - | ||||||||||||||||||||||||
| 1263 | put_space (int space) | - | ||||||||||||||||||||||||
| 1264 | { | - | ||||||||||||||||||||||||
| 1265 | int space_target, tab_target; | - | ||||||||||||||||||||||||
| 1266 | - | |||||||||||||||||||||||||
| 1267 | space_target = out_column + space; | - | ||||||||||||||||||||||||
| 1268 | if (tabs
| 7-1180 | ||||||||||||||||||||||||
| 1269 | { | - | ||||||||||||||||||||||||
| 1270 | tab_target = space_target / 8 * 8; | - | ||||||||||||||||||||||||
| 1271 | if (out_column + 1 < tab_target
| 2-5 | ||||||||||||||||||||||||
| 1272 | while (out_column < tab_target
| 2-3 | ||||||||||||||||||||||||
| 1273 | { | - | ||||||||||||||||||||||||
| 1274 | putchar_unlocked ('\t'); | - | ||||||||||||||||||||||||
| 1275 | out_column = (out_column / 8 + 1) * 8; | - | ||||||||||||||||||||||||
| 1276 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 1277 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 1278 | while (out_column < space_target
| 1122-1187 | ||||||||||||||||||||||||
| 1279 | { | - | ||||||||||||||||||||||||
| 1280 | putchar_unlocked (' '); | - | ||||||||||||||||||||||||
| 1281 | out_column++; | - | ||||||||||||||||||||||||
| 1282 | } executed 1122 times by 1 test: end of blockExecuted by:
| 1122 | ||||||||||||||||||||||||
| 1283 | } executed 1187 times by 1 test: end of blockExecuted by:
| 1187 | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |