Skip to content

Commit

Permalink
move return_if_error macro to internals.h
Browse files Browse the repository at this point in the history
  • Loading branch information
vteromero committed Feb 14, 2022
1 parent 70a034a commit 1c7ebf3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
1 change: 0 additions & 1 deletion bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <stdint.h>

#include "internals.h"
#include "error.h"
#include "mem.h"

struct bswriter {
Expand Down
1 change: 0 additions & 1 deletion decode_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "bitstream.h"
#include "common.h"
#include "error.h"
#include "internals.h"

#define decctx_(_width_) BITWIDTH_SUFFIX(decctx, _width_)
Expand Down
1 change: 0 additions & 1 deletion encode_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "bitstream.h"
#include "common.h"
#include "countbits.h"
#include "error.h"
#include "internals.h"

#define encctx_(_width_) BITWIDTH_SUFFIX(encctx, _width_)
Expand Down
19 changes: 0 additions & 19 deletions error.h

This file was deleted.

9 changes: 9 additions & 0 deletions internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,13 @@ struct vtenc {
size_t out_size; /* Output size in bytes */
};

/* Error-handling helper macro */
#define return_if_error(exp) \
do { \
const int code = (exp); \
if (code != VTENC_OK) { \
return code; \
} \
} while(0)

#endif /* VTENC_INTERNALS_H_ */

0 comments on commit 1c7ebf3

Please sign in to comment.