Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
e274ebb0
Commit
e274ebb0
authored
Oct 07, 2013
by
npzacs
Browse files
Simple logging optimization
parent
5bde0423
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/util/attributes.h
View file @
e274ebb0
...
...
@@ -17,8 +17,8 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIB
BLURAY
_ATTRIBUTES_H_
#define LIB
BLURAY
_ATTRIBUTES_H_
#ifndef LIB
AACS
_ATTRIBUTES_H_
#define LIB
AACS
_ATTRIBUTES_H_
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 ))
# define AACS_ATTR_FORMAT_PRINTF(format,var) \
...
...
@@ -47,4 +47,12 @@
# define AACS_PRIVATE
#endif
#endif
/* LIBBLURAY_ATTRIBUTES_H_ */
#if !defined(__GNUC__) || __GNUC__ < 3
# define AACS_LIKELY(x) (x)
# define AACS_UNLIKELY(x) (x)
#else
# define AACS_LIKELY(x) __builtin_expect((x),1)
# define AACS_UNLIKELY(x) __builtin_expect((x),0)
#endif
#endif
/* LIBAACS_ATTRIBUTES_H_ */
src/util/logging.c
View file @
e274ebb0
...
...
@@ -24,7 +24,7 @@
#include <stdarg.h>
#include <string.h>
static
debug_mask
_t
debug_mask
=
DBG_CRIT
;
uint32_t
debug_mask
=
(
uint32_t
)
-
1
;
/* set all bits to make sure aacs_debug() is called for initialization */
char
*
print_hex
(
char
*
out
,
const
uint8_t
*
buf
,
int
count
)
{
...
...
src/util/logging.h
View file @
e274ebb0
...
...
@@ -24,7 +24,14 @@
#include <stdint.h>
#define DEBUG(MASK,...) aacs_debug(__FILE__,__LINE__,MASK,##__VA_ARGS__)
AACS_PRIVATE
extern
uint32_t
debug_mask
;
#define DEBUG(MASK,...) \
do { \
if (AACS_UNLIKELY((MASK) & debug_mask)) { \
aacs_debug(__FILE__,__LINE__,MASK,__VA_ARGS__); \
} \
} while (0)
enum
debug_mask_enum
{
DBG_RESERVED
=
0x0001
,
...
...
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