Coverage Report

Created: 2021-04-07 03:47

/home/liu/buildslave/linux-x64-runtests/build/lib/nnc/_ccv_cnnp_dataframe.h
Line
Count
Source
1
/**********************************************************
2
 * C-based/Cached/Core Computer Vision Library
3
 * Liu Liu, 2010-02-01
4
 **********************************************************/
5
6
/**********************************************************
7
 * CCV - Neural Network Collection
8
 **********************************************************/
9
10
#ifndef GUARD_ccv_cnnp_dataframe_internal_h
11
#define GUARD_ccv_cnnp_dataframe_internal_h
12
13
#include "ccv_nnc.h"
14
15
typedef struct {
16
  int size;
17
} ccv_cnnp_dataframe_tuple_t;
18
19
CCV_WARN_UNUSED(void*) ccv_cnnp_dataframe_column_context(const ccv_cnnp_dataframe_t* const dataframe, const int column_idx);
20
21
static inline char* ccv_cnnp_column_copy_name(const char* const name)
22
6.66k
{
23
6.66k
  if (name)
24
3.21k
  {
25
3.21k
    const size_t len = strnlen(name, 1023);
26
3.21k
    const size_t n = len + 1;
27
3.21k
    char* copy = (char*)ccmalloc(n);
28
3.21k
    // Don't use strndup because this way I can have custom allocator (for ccmalloc).
29
3.21k
    memcpy(copy, name, n);
30
3.21k
    copy[len] = 0;
31
3.21k
    return copy;
32
3.21k
  }
33
3.45k
  return 0;
34
3.45k
}
ccv_cnnp_dataframe.c:ccv_cnnp_column_copy_name
Line
Count
Source
22
6.66k
{
23
6.66k
  if (name)
24
3.21k
  {
25
3.21k
    const size_t len = strnlen(name, 1023);
26
3.21k
    const size_t n = len + 1;
27
3.21k
    char* copy = (char*)ccmalloc(n);
28
3.21k
    // Don't use strndup because this way I can have custom allocator (for ccmalloc).
29
3.21k
    memcpy(copy, name, n);
30
3.21k
    copy[len] = 0;
31
3.21k
    return copy;
32
3.21k
  }
33
3.45k
  return 0;
34
3.45k
}
Unexecuted instantiation: ccv_cnnp_dataframe_core.c:ccv_cnnp_column_copy_name
Unexecuted instantiation: ccv_cnnp_dataframe_addons.c:ccv_cnnp_column_copy_name
Unexecuted instantiation: ccv_cnnp_dataframe_csv.c:ccv_cnnp_column_copy_name
35
36
#endif