Coverage Report

Created: 2017-11-12 13:27

/home/liu/buildslave/linux-x64-runtests/build/lib/io/_ccv_io_binary.inc
Line
Count
Source (jump to first uncovered line)
1
static void _ccv_write_binary_fd(ccv_dense_matrix_t* mat, FILE* fd, void* conf)
2
0
{
3
0
  fwrite("CCVBINDM", 1, 8, fd);
4
0
  int ctype = mat->type & 0xFFFFF;
5
0
  fwrite(&ctype, 1, 4, fd);
6
0
  fwrite(&(mat->rows), 1, 4, fd);
7
0
  fwrite(&(mat->cols), 1, 4, fd);
8
0
  fwrite(mat->data.u8, 1, mat->step * mat->rows, fd);
9
0
  fflush(fd);
10
0
}
11
12
static void _ccv_read_binary_fd(FILE* in, ccv_dense_matrix_t** x, int type)
13
25
{
14
25
  fseek(in, 8, SEEK_SET);
15
25
  fread(&type, 1, 4, in);
16
25
  int rows, cols;
17
25
  fread(&rows, 1, 4, in);
18
25
  fread(&cols, 1, 4, in);
19
25
  *x = ccv_dense_matrix_new(rows, cols, type, 0, 0);
20
25
  fread((*x)->data.u8, 1, (*x)->step * (*x)->rows, in);
21
25
}