| 1794 | ds4_vlog(fp, type, fmt, ap); |
| 1795 | va_end(ap); |
| 1796 | } |
| 1797 | |
| 1798 | static bool write_f32_binary_file(const char *path, const float *data, uint64_t n) { |
| 1799 | FILE *fp = fopen(path, "wb"); |
| 1800 | if (!fp) { |
| 1801 | fprintf(stderr, "ds4: failed to open %s for writing: %s\n", path, strerror(errno)); |
| 1802 | return false; |
| 1803 | } |
| 1804 | const size_t nw = fwrite(data, sizeof(float), (size_t)n, fp); |
| 1805 | const bool ok = nw == (size_t)n && fclose(fp) == 0; |
| 1806 | if (!ok) { |
| 1807 | fprintf(stderr, "ds4: failed to write %s\n", path); |
no test coverage detected