| # | Line 57 | Line 57 | newheader( /* identifying line of information header | |
|---|---|---|
| 57 | { | |
| 58 | fputs(HDRSTR, fp); | |
| 59 | fputs(s, fp); | |
| 60 | < | putc('\n', fp); |
| 60 | > | fputc('\n', fp); |
| 61 | } | |
| 62 | ||
| 63 | ||
| # | Line 209 | Line 209 | fputformat( /* put out a format value */ | |
| 209 | FILE *fp | |
| 210 | ) | |
| 211 | { | |
| 212 | + | int align = 0; |
| 213 | + | |
| 214 | fputs(FMTSTR, fp); | |
| 215 | fputs(s, fp); | |
| 216 | < | putc('\n', fp); |
| 216 | > | /* pad to align binary type for mmap() */ |
| 217 | > | if (!strcmp(s, "float")) |
| 218 | > | align = 4; |
| 219 | > | else if (!strcmp(s, "double")) |
| 220 | > | align = 8; |
| 221 | > | if (align) { |
| 222 | > | long pos = ftell(fp); |
| 223 | > | if (pos >= 0) { |
| 224 | > | pos = (pos + 2) % align; |
| 225 | > | if (pos) align -= pos; |
| 226 | > | else align = 0; |
| 227 | > | } else |
| 228 | > | align = 0; |
| 229 | > | } |
| 230 | > | while (align-- > 0) |
| 231 | > | putc(' ', fp); |
| 232 | > | fputc('\n', fp); |
| 233 | } | |
| 234 | ||
| 235 | ||
| – | Removed lines |
| + | Added lines |
| < | Changed lines (old) |
| > | Changed lines (new) |