Skip to content

Commit

Permalink
#341 return object in corto_assert_object
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Jul 30, 2018
1 parent 88471bc commit 0a68fb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/corto.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ corto_object _corto_assert_type(
/* Is pointer a valid object */
#ifndef NDEBUG
CORTO_EXPORT
void _corto_assert_object(
corto_object _corto_assert_object(
char const *file,
unsigned int line,
corto_object o);
#define corto_assert_object(o) _corto_assert_object(__FILE__, __LINE__, o)
#else
#define corto_assert_object(o)
#define corto_assert_object(o) o
#endif

/* Is object of specified type */
Expand Down
4 changes: 3 additions & 1 deletion src/store/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ corto_object _corto_assert_type(

/* Assert object is valid. Only enabled in debug builds */
#ifndef NDEBUG
void _corto_assert_object(char const *file, unsigned int line, corto_object o) {
corto_object _corto_assert_object(char const *file, unsigned int line, corto_object o) {
if (o) {
corto__object *_o = corto_hdr(o);
if (_o->magic != CORTO_MAGIC) {
Expand All @@ -1507,5 +1507,7 @@ void _corto_assert_object(char const *file, unsigned int line, corto_object o) {
}
}
}

return o;
}
#endif

0 comments on commit 0a68fb4

Please sign in to comment.