Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Sergey.Kolodchenko
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e8ec1b55
authored
Mar 19, 2018
by
Sergey.Kolodchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
e19dcab4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
coding style.c
coding style.c
0 → 100644
View file @
e8ec1b55
ccv_array_t
*
ccv_array_new
(
int
rsize
,
int
rnum
,
uint64_t
sig
)
{
ccv_array_t
*
array
;
if
(
ccv_cache_opt
&&
sig
!=
0
)
{
uint8_t
type
;
array
=
(
ccv_array_t
*
)
ccv_cache_out
(
&
ccv_cache
,
sig
,
&
type
);
if
(
array
){
assert
(
type
==
1
);
array
->
type
|=
CCV_GARBAGE
;
array
->
refcount
=
1
;
return
array
;
}
}
array
=
(
ccv_array_t
*
)
ccmalloc
(
sizeof
(
ccv_array_t
));
array
->
sig
=
sig
;
array
->
type
=
CCV_REUSABLE
&
~
CCV_GARBAGE
;
array
->
rnum
=
0
;
array
->
rsize
=
rsize
;
array
->
size
=
ccv_max
(
rnum
,
2
/* allocate memory for at least 2 items */
);
array
->
data
=
ccmalloc
((
size_t
)
array
->
size
*
(
size_t
)
rsize
);
return
array
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment