Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: replace RIOT_FILE_RELATIVE with __FILE__ #18936

Merged
merged 6 commits into from
Nov 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions core/lib/include/assert.h
Original file line number Diff line number Diff line change
@@ -44,10 +44,6 @@ extern "C" {
#define DEBUG_ASSERT_VERBOSE
#endif

#ifndef RIOT_FILE_RELATIVE
#define RIOT_FILE_RELATIVE (__FILE__)
#endif

/**
* @def __NORETURN
* @brief hidden (__) NORETURN definition
@@ -110,8 +106,7 @@ __NORETURN void _assert_failure(const char *file, unsigned line);
*
* @see http://pubs.opengroup.org/onlinepubs/9699919799/functions/assert.html
*/
#define assert(cond) ((cond) ? (void)0 : _assert_failure(RIOT_FILE_RELATIVE, \
__LINE__))
#define assert(cond) ((cond) ? (void)0 : _assert_failure(__FILE__, __LINE__))
#else /* DEBUG_ASSERT_VERBOSE */
__NORETURN void _assert_panic(void);
#define assert(cond) ((cond) ? (void)0 : _assert_panic())
6 changes: 3 additions & 3 deletions core/msg.c
Original file line number Diff line number Diff line change
@@ -105,18 +105,18 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block,
thread_t *me = thread_get_active();

DEBUG("msg_send() %s:%i: Sending from %" PRIkernel_pid " to %" PRIkernel_pid
". block=%i src->state=%i target->state=%i\n", RIOT_FILE_RELATIVE,
". block=%i src->state=%i target->state=%i\n", __FILE__,
__LINE__, thread_getpid(), target_pid,
block, (int)me->status, (int)target->status);

if (target->status != STATUS_RECEIVE_BLOCKED) {
DEBUG(
"msg_send() %s:%i: Target %" PRIkernel_pid " is not RECEIVE_BLOCKED.\n",
RIOT_FILE_RELATIVE, __LINE__, target_pid);
__FILE__, __LINE__, target_pid);

if (queue_msg(target, m)) {
DEBUG("msg_send() %s:%i: Target %" PRIkernel_pid
" has a msg_queue. Queueing message.\n", RIOT_FILE_RELATIVE,
" has a msg_queue. Queueing message.\n", __FILE__,
__LINE__, target_pid);
irq_restore(state);
if (me->status == STATUS_REPLY_BLOCKED
10 changes: 5 additions & 5 deletions cpu/lpc23xx/mci/lpc23xx-mci.c
Original file line number Diff line number Diff line change
@@ -534,7 +534,7 @@ diskio_sta_t mci_initialize(void)
/* Wait while card is busy state (use ACMD41 with HCS bit) */
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (ztimer_now(ZTIMER_USEC) > (start + 1 * US_PER_SEC /* !Timer[0] */)) {
DEBUG("%s, %d: Timeout #1\n", RIOT_FILE_RELATIVE, __LINE__);
DEBUG("%s, %d: Timeout #1\n", __FILE__, __LINE__);
goto di_fail;
}
}
@@ -556,13 +556,13 @@ diskio_sta_t mci_initialize(void)

do {
/* Wait while card is busy state (use ACMD41 or CMD1) */
DEBUG("%s, %d: %lX\n", RIOT_FILE_RELATIVE, __LINE__, resp[0]);
DEBUG("%s, %d: %lX\n", __FILE__, __LINE__, resp[0]);

/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (ztimer_now(ZTIMER_USEC) > (start + 1 * US_PER_SEC/* !Timer[0] */)) {
DEBUG("now: %" PRIu32 "us, started at: %" PRIu32 "\n",
(uint32_t) ztimer_now(ZTIMER_USEC), start);
DEBUG("%s, %d: Timeout #2\n", RIOT_FILE_RELATIVE, __LINE__);
DEBUG("%s, %d: Timeout #2\n", __FILE__, __LINE__);
goto di_fail;
}
}
@@ -575,7 +575,7 @@ diskio_sta_t mci_initialize(void)
/*---- Card is 'ready' state ----*/

if (!send_cmd(CMD2, 0, 2, resp)) {
DEBUG("%s, %d: Failed entering ident state", RIOT_FILE_RELATIVE,
DEBUG("%s, %d: Failed entering ident state", __FILE__,
__LINE__);
goto di_fail; /* Enter ident state */
}
@@ -588,7 +588,7 @@ diskio_sta_t mci_initialize(void)

if (ty & CT_SDC) { /* SDC: Get generated RCA and save it */
if (!send_cmd(CMD3, 0, 1, resp)) {
DEBUG("%s, %d: Failed generating RCA\n", RIOT_FILE_RELATIVE, __LINE__);
DEBUG("%s, %d: Failed generating RCA\n", __FILE__, __LINE__);
goto di_fail;
}

2 changes: 1 addition & 1 deletion cpu/native/netdev_tap/netdev_tap.c
Original file line number Diff line number Diff line change
@@ -330,7 +330,7 @@ static void _tap_isr(int fd, void *arg) {

static int _init(netdev_t *netdev)
{
DEBUG("%s:%s:%u\n", RIOT_FILE_RELATIVE, __func__, __LINE__);
DEBUG("%s:%s:%u\n", __FILE__, __func__, __LINE__);

netdev_tap_t *dev = container_of(netdev, netdev_tap_t, netdev);

6 changes: 3 additions & 3 deletions sys/include/embUnit/AssertImpl.h
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ void assertImplementationCStr(const char *expected,const char *actual, long line
const char *____expected__ = expected_; \
const char *____actual__ = actual_; \
if (stdimpl_strcmp(____expected__, ____actual__) != 0) { \
assertImplementationCStr(____expected__, ____actual__, __LINE__, RIOT_FILE_RELATIVE); \
assertImplementationCStr(____expected__, ____actual__, __LINE__, __FILE__); \
return; \
} \
} while (0)
@@ -60,7 +60,7 @@ void assertImplementationCStr(const char *expected,const char *actual, long line
long long ____actual__ = (long long) (actual_); \
if (____expected__ != ____actual__) { \
assertImplementationLongLong(____expected__, ____actual__, \
__LINE__, RIOT_FILE_RELATIVE); \
__LINE__, __FILE__); \
return; \
} \
} while (0)
@@ -92,7 +92,7 @@ void assertImplementationCStr(const char *expected,const char *actual, long line

#define TEST_FAIL(message) \
do { \
addFailure((message), __LINE__, RIOT_FILE_RELATIVE); \
addFailure((message), __LINE__, __FILE__); \
return; \
} while (0)

7 changes: 1 addition & 6 deletions sys/include/test_utils/expect.h
Original file line number Diff line number Diff line change
@@ -32,10 +32,6 @@
extern "C" {
#endif

#ifndef RIOT_FILE_RELATIVE
#define RIOT_FILE_RELATIVE (__FILE__)
#endif

/**
* @brief Function to handle failed expectation
*
@@ -80,8 +76,7 @@ NORETURN static inline void _expect_failure(const char *file, unsigned line)
* the condition failed in.
*
*/
#define expect(cond) ((cond) ? (void)0 : _expect_failure(RIOT_FILE_RELATIVE, \
__LINE__))
#define expect(cond) ((cond) ? (void)0 : _expect_failure(__FILE__, __LINE__))

#ifdef __cplusplus
}
8 changes: 4 additions & 4 deletions sys/net/gnrc/transport_layer/tcp/include/gnrc_tcp_common.h
Original file line number Diff line number Diff line change
@@ -120,31 +120,31 @@ extern "C" {
* @note Compilation units using TCP_DEBUG_ENTER must set ENABLE_DEBUG and include debug.h.
*/
#define TCP_DEBUG_ENTER DEBUG("GNRC_TCP: Enter \"%s\", File: %s(%d)\n", \
DEBUG_FUNC, RIOT_FILE_RELATIVE, __LINE__)
DEBUG_FUNC, __FILE__, __LINE__)

/**
* @brief Helper macro used to create debug message on function exit.
*
* @note Compilation units using TCP_DEBUG_LEAVE must set ENABLE_DEBUG and include debug.h.
*/
#define TCP_DEBUG_LEAVE DEBUG("GNRC_TCP: Leave \"%s\", File: %s(%d)\n", \
DEBUG_FUNC, RIOT_FILE_RELATIVE, __LINE__)
DEBUG_FUNC, __FILE__, __LINE__)

/**
* @brief Helper macro used to create debug message on error.
*
* @note Compilation units using TCP_DEBUG_ERROR must set ENABLE_DEBUG and include debug.h.
*/
#define TCP_DEBUG_ERROR(msg) DEBUG("GNRC_TCP: Error: \"%s\", Func: %s, File: %s(%d)\n", \
msg, DEBUG_FUNC, RIOT_FILE_RELATIVE, __LINE__)
msg, DEBUG_FUNC, __FILE__, __LINE__)

/**
* @brief Helper macro used to create informational debug message.
*
* @note Compilation units using TCP_DEBUG_INFO must set ENABLE_DEBUG and include debug.h.
*/
#define TCP_DEBUG_INFO(msg) DEBUG("GNRC_TCP: Info: \"%s\", Func: %s, File: %s(%d)\n", \
msg, DEBUG_FUNC, RIOT_FILE_RELATIVE, __LINE__)
msg, DEBUG_FUNC, __FILE__, __LINE__)

/**
* @brief TCB list type.