Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
69cfde45
Commit
69cfde45
authored
May 26, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new function for vector (future proof)
parent
bdc83da0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
vector.c
jni/utils/vector.c
+6
-0
vector.h
jni/utils/vector.h
+1
-0
No files found.
jni/utils/vector.c
View file @
69cfde45
...
...
@@ -23,6 +23,12 @@ void vec_push_back(struct vector *v, void *p) {
++
vec_size
(
v
);
}
void
*
vec_pop_back
(
struct
vector
*
v
)
{
void
*
ret
=
vec_entry
(
v
)[
vec_size
(
v
)
-
1
];
--
vec_size
(
v
);
return
ret
;
}
void
vec_sort
(
struct
vector
*
v
,
int
(
*
compar
)(
const
void
*
,
const
void
*
))
{
if
(
v
==
NULL
)
return
;
qsort
(
vec_entry
(
v
),
vec_size
(
v
),
sizeof
(
void
*
),
compar
);
...
...
jni/utils/vector.h
View file @
69cfde45
...
...
@@ -14,6 +14,7 @@ struct vector {
void
vec_init
(
struct
vector
*
v
);
void
vec_push_back
(
struct
vector
*
v
,
void
*
p
);
void
*
vec_pop_back
(
struct
vector
*
v
);
void
vec_sort
(
struct
vector
*
v
,
int
(
*
compar
)(
const
void
*
,
const
void
*
));
void
vec_destroy
(
struct
vector
*
v
);
void
vec_deep_destroy
(
struct
vector
*
v
);
...
...
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