| 1810 | if (!ok) { |
| 1811 | fprintf(stderr, "ds4: failed to write %s\n", path); |
| 1812 | return false; |
| 1813 | } |
| 1814 | return true; |
| 1815 | } |
| 1816 | |
| 1817 | static bool read_f32_binary_file(const char *path, float *data, uint64_t n) { |
| 1818 | struct stat st; |
| 1819 | if (stat(path, &st) != 0) { |
| 1820 | fprintf(stderr, "ds4: failed to stat %s: %s\n", path, strerror(errno)); |
| 1821 | return false; |
| 1822 | } |
| 1823 | if (st.st_size < 0 || (uint64_t)st.st_size != n * sizeof(float)) { |
| 1824 | fprintf(stderr, |
no test coverage detected