Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
excit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
excit
Commits
52f9a76c
Commit
52f9a76c
authored
Jan 07, 2019
by
Nicolas Denoyelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkpatch
parent
4e08270a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
22 deletions
+26
-22
src/excit.c
src/excit.c
+22
-19
src/excit.h
src/excit.h
+4
-3
No files found.
src/excit.c
View file @
52f9a76c
#include <stdlib.h>
#include <excit.h>
#define CASE(val) case val: return #val; break
;
#define CASE(val) case val: return #val; break
const
char
*
excit_type_name
(
enum
excit_type_e
type
)
const
char
*
excit_type_name
(
enum
excit_type_e
type
)
{
switch
(
type
)
{
CASE
(
EXCIT_RANGE
)
CASE
(
EXCIT_CONS
)
CASE
(
EXCIT_REPEAT
)
CASE
(
EXCIT_HILBERT2D
)
CASE
(
EXCIT_PRODUCT
)
CASE
(
EXCIT_SLICE
)
CASE
(
EXCIT_USER
)
CASE
(
EXCIT_TYPE_MAX
)
CASE
(
EXCIT_RANGE
)
;
CASE
(
EXCIT_CONS
)
;
CASE
(
EXCIT_REPEAT
)
;
CASE
(
EXCIT_HILBERT2D
)
;
CASE
(
EXCIT_PRODUCT
)
;
CASE
(
EXCIT_SLICE
)
;
CASE
(
EXCIT_USER
)
;
CASE
(
EXCIT_TYPE_MAX
)
;
default:
return
NULL
;
}
}
const
char
*
excit_error_name
(
enum
excit_error_e
err
)
const
char
*
excit_error_name
(
enum
excit_error_e
err
)
{
switch
(
err
)
{
CASE
(
EXCIT_SUCCESS
)
CASE
(
EXCIT_STOPIT
)
CASE
(
EXCIT_ENOMEM
)
CASE
(
EXCIT_EINVAL
)
CASE
(
EXCIT_EDOM
)
CASE
(
EXCIT_ENOTSUP
)
CASE
(
EXCIT_ERROR_MAX
)
CASE
(
EXCIT_SUCCESS
)
;
CASE
(
EXCIT_STOPIT
)
;
CASE
(
EXCIT_ENOMEM
)
;
CASE
(
EXCIT_EINVAL
)
;
CASE
(
EXCIT_EDOM
)
;
CASE
(
EXCIT_ENOTSUP
)
;
CASE
(
EXCIT_ERROR_MAX
)
;
default:
return
NULL
;
}
...
...
@@ -396,6 +396,7 @@ static int prod_it_rank(const excit_t data, const ssize_t *indexes, ssize_t *n)
for
(
ssize_t
i
=
0
;
i
<
it
->
count
;
i
++
)
{
int
err
=
excit_rank
(
it
->
its
[
i
],
indexes
+
offset
,
&
inner_n
);
if
(
err
)
return
err
;
err
=
excit_size
(
it
->
its
[
i
],
&
subsize
);
...
...
@@ -657,7 +658,7 @@ static void circular_fifo_add(struct circular_fifo_s *fifo, ssize_t elem)
fifo
->
buffer
[
fifo
->
end
]
=
elem
;
}
static
void
circular_fifo_dump
(
const
struct
circular_fifo_s
*
fifo
,
static
void
circular_fifo_dump
(
const
struct
circular_fifo_s
*
fifo
,
ssize_t
*
vals
)
{
ssize_t
i
;
...
...
@@ -1102,6 +1103,7 @@ int excit_repeat_init(excit_t it, excit_t src, ssize_t n)
if
(
!
it
||
it
->
type
!=
EXCIT_REPEAT
||
!
src
||
n
<=
0
)
return
-
EXCIT_EINVAL
;
struct
repeat_it_s
*
repeat_it
=
(
struct
repeat_it_s
*
)
it
->
data
;
excit_free
(
repeat_it
->
it
);
it
->
dimension
=
src
->
dimension
;
repeat_it
->
it
=
src
;
...
...
@@ -1234,6 +1236,7 @@ static int hilbert2d_it_next(excit_t data, ssize_t *val)
static
int
hilbert2d_it_size
(
const
excit_t
data
,
ssize_t
*
size
)
{
const
struct
hilbert2d_it_s
*
it
=
(
struct
hilbert2d_it_s
*
)
data
->
data
;
return
excit_size
(
it
->
range_it
,
size
);
}
...
...
src/excit.h
View file @
52f9a76c
...
...
@@ -20,7 +20,7 @@ enum excit_type_e {
/*
* Returns the string representation of an iterator type.
*/
const
char
*
excit_type_name
(
enum
excit_type_e
type
);
const
char
*
excit_type_name
(
enum
excit_type_e
type
);
/*
* The different possible return codes of an excit function.
...
...
@@ -38,7 +38,7 @@ enum excit_error_e {
/*
* Returns the string representation of a return code.
*/
const
char
*
excit_error_name
(
enum
excit_error_e
err
);
const
char
*
excit_error_name
(
enum
excit_error_e
err
);
/*
* Opaque structure of an iterator
...
...
@@ -254,7 +254,8 @@ int excit_split(const excit_t it, ssize_t n, excit_t *results);
/*
* Gets the nth element of an iterator.
* "it": an iterator.
* "rank": rank of the element, comprised between 0 and the size of the iterator.
* "rank": rank of the element, comprised between 0 and the size of the
* iterator.
* "indexes": an array of indexes with a dimension corresponding to that of the
* iterator, no results is returned if NULL.
* Returns EXCIT_SUCCESS or an error code.
...
...
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