Add support for additional parameter id
This commit is contained in:
1 parent
983a63fbbc
commit
bd89e162fc
1 file changed
+6
-1
+6
-1
@@ -60,7 +60,7 @@ static inline void testobj_clear(testobj_t z)
|
|||||||
static inline void testobj_init_set(testobj_t d, const testobj_t s)
|
static inline void testobj_init_set(testobj_t d, const testobj_t s)
|
||||||
{
|
{
|
||||||
d->n = s->n;
|
d->n = s->n;
|
||||||
d->a = s->n;
|
d->a = s->a;
|
||||||
d->ptr = (unsigned int *) calloc (s->n, sizeof(unsigned int));
|
d->ptr = (unsigned int *) calloc (s->n, sizeof(unsigned int));
|
||||||
assert(d->ptr != NULL);
|
assert(d->ptr != NULL);
|
||||||
memcpy(d->ptr, s->ptr, sizeof(unsigned int) * s->n);
|
memcpy(d->ptr, s->ptr, sizeof(unsigned int) * s->n);
|
||||||
@@ -81,6 +81,11 @@ static inline void testobj_set_ui(testobj_t d, unsigned int v)
|
|||||||
d->ptr[0] = v;
|
d->ptr[0] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void testobj_set_id(testobj_t d, unsigned int id)
|
||||||
|
{
|
||||||
|
d->a = id;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void testobj_init_set_ui(testobj_t d, unsigned int v)
|
static inline void testobj_init_set_ui(testobj_t d, unsigned int v)
|
||||||
{
|
{
|
||||||
testobj_init(d);
|
testobj_init(d);
|
||||||
|
|||||||
Reference in new issue
Block a user