Code Review
/
o-du
/
phy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
O-RAN E Maintenance Release contribution for ODULOW
[o-du/phy.git]
/
fhi_lib
/
lib
/
src
/
xran_printf.h
diff --git
a/fhi_lib/lib/src/xran_printf.h
b/fhi_lib/lib/src/xran_printf.h
index
6caee87
..
e2c938b
100644
(file)
--- a/
fhi_lib/lib/src/xran_printf.h
+++ b/
fhi_lib/lib/src/xran_printf.h
@@
-1,6
+1,6
@@
/******************************************************************************
*
/******************************************************************************
*
-* Copyright (c) 20
19
Intel.
+* Copyright (c) 20
20
Intel.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-16,7
+16,6
@@
*
*******************************************************************************/
*
*******************************************************************************/
-
/**
* @brief Modules provide debug prints and utility functions
* @file xran_printf.h
/**
* @brief Modules provide debug prints and utility functions
* @file xran_printf.h
@@
-30,6
+29,7
@@
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
@@
-40,32
+40,32
@@
extern "C" {
#ifndef WIN32
#ifdef PRINTF_LOG_OK
#ifndef WIN32
#ifdef PRINTF_LOG_OK
-#define print_log(fmt, args...) printf("%s:
" fmt "\n", __FUNCTION
__, ## args)
+#define print_log(fmt, args...) printf("%s:
%d" fmt "\n", __FUNCTION__, __LINE
__, ## args)
#else /* PRINTF_LOG_OK */
#define print_log(fmt, args...)
#endif /* PRINTF_LOG_OK */
#else
#else /* PRINTF_LOG_OK */
#define print_log(fmt, args...)
#endif /* PRINTF_LOG_OK */
#else
-#define print_log(fmt, ...) printf("%s:
" fmt "\n", __FUNCTION
__, __VA_ARGS__)
+#define print_log(fmt, ...) printf("%s:
%d" fmt "\n", __FUNCTION__, __LINE
__, __VA_ARGS__)
#endif
#ifndef WIN32
#ifdef PRINTF_DBG_OK
#endif
#ifndef WIN32
#ifdef PRINTF_DBG_OK
-#define print_dbg(fmt, args...) printf("%s:
[dbg] " fmt "\n", __FUNCTION
__, ## args)
+#define print_dbg(fmt, args...) printf("%s:
%d[dbg] " fmt "\n", __FUNCTION__, __LINE
__, ## args)
#else /* PRINTF_LOG_OK */
#define print_dbg(fmt, args...)
#endif /* PRINTF_LOG_OK */
#else
#else /* PRINTF_LOG_OK */
#define print_dbg(fmt, args...)
#endif /* PRINTF_LOG_OK */
#else
-#define print_dbg(fmt, ...) printf("%s:
[dbg] " fmt "\n", __FUNCTION
__, __VA_ARGS__)
+#define print_dbg(fmt, ...) printf("%s:
%d[dbg] " fmt "\n", __FUNCTION__, __LINE
__, __VA_ARGS__)
#endif
#ifndef WIN32
#ifdef PRINTF_ERR_OK
#endif
#ifndef WIN32
#ifdef PRINTF_ERR_OK
-#define print_err(fmt, args...) printf("%s:
[err] " fmt "\n", __FUNCTION
__, ## args)
+#define print_err(fmt, args...) printf("%s:
%d[err] " fmt "\n", __FUNCTION__, __LINE
__, ## args)
#else /* PRINTF_LOG_OK */
#define print_err(fmt, args...)
#endif /* PRINTF_LOG_OK */
#else
#else /* PRINTF_LOG_OK */
#define print_err(fmt, args...)
#endif /* PRINTF_LOG_OK */
#else
-#define print_err(fmt, ...) printf("%s:
[err] " fmt "\n", __FUNCTION
__, __VA_ARGS__)
+#define print_err(fmt, ...) printf("%s:
%d[err] " fmt "\n", __FUNCTION__, __LINE
__, __VA_ARGS__)
#endif
#ifndef WIN32
#endif
#ifndef WIN32
@@
-101,7
+101,16
@@
extern "C" {
#endif /* _IASSERT_*/
#endif /* _IASSERT_*/
-
+#ifdef CHECK_PARAMS
+#define CHECK_NOT_NULL(param, returnValue) \
+if (param == NULL) \
+{ \
+ print_err("%s is NULL!\n", #param); \
+ return returnValue; \
+}
+#else
+#define CHECK_NOT_NULL(param, returnValue)
+#endif
#ifdef __cplusplus
}
#ifdef __cplusplus
}