bool BinarizationAutoTest(const Func1 & f1, const Func1 & f2) { bool result = true; for(SimdCompareType type = SimdCompareEqual; type <= SimdCompareLesserOrEqual && result; type = SimdCompareType(type + 1)) { result = result && BinarizationAutoTest(ARGS1(W, H, type, f1, f2)); result = result && BinarizationAutoTest(ARGS1(W + O, H - O, type, f1, f2)); result = result && BinarizationAutoTest(ARGS1(W - O, H + O, type, f1, f2)); } return result; }
int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { char* path = NULL; WRAP_EIO(UV_FS_CLOSE, eio_close, close, ARGS1(file)); }
int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { char* path = NULL; WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fdatasync, ARGS1(file)) }
req->result = offset < 0 ? read(fd, buf, length) : pread(fd, buf, length, offset); if (req->result < 0) { uv_err_new(loop, errno); return -1; } } return 0; } int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { WRAP_EIO(UV_FS_UNLINK, eio_unlink, unlink, ARGS1(path)) } int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, void* buf, size_t length, off_t offset, uv_fs_cb cb) { uv_fs_req_init(loop, req, UV_FS_WRITE, NULL, cb); if (cb) { /* async */ uv_ref(loop); req->eio = eio_write(file, buf, length, offset, EIO_PRI_DEFAULT, uv__fs_after, req); if (!req->eio) { uv_err_new(loop, ENOMEM); return -1;