Skip to content

Commit c673ad0

Browse files
committed
Remove unused parameter in 'ulib_ns'
1 parent db4bfe3 commit c673ad0

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ AllowShortCaseLabelsOnASingleLine: true
44
AllowShortFunctionsOnASingleLine: Empty
55
AllowShortIfStatementsOnASingleLine: WithoutElse
66
AllowShortLoopsOnASingleLine: true
7+
AttributeMacros:
8+
- ulib_unused
79
ColumnLimit: 100
810
Cpp11BracedListStyle: false
911
ForEachMacros:
@@ -23,6 +25,7 @@ StatementMacros:
2325
- ULIB_END_DECLS
2426
- p_ubit_count_set_def
2527
TypenameMacros:
28+
- UBit
2629
- UHash
2730
- UVec
2831
WhitespaceSensitiveMacros:

include/ulog.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,16 @@ void ulog_disable(ULog *log) {
278278
#define ulog_fatal(...) ulog(ulog_main, ULOG_FATAL, NULL, __VA_ARGS__)
279279

280280
/**
281-
* Same as @func{ulog}(`log`, @val{ULOG_PERF}, `nanos`, `fmt`, `...`).
281+
* Same as @func{ulog}(@var{ulog_main}, @val{ULOG_PERF}, `nanos`, `fmt`, `...`).
282282
*
283-
* @param log Logger object.
284283
* @param nanos Elapsed time in nanoseconds.
285284
* @param fmt Message format string.
286285
* @param ... Message format arguments.
287286
* @return Return code.
288287
*
289-
* @alias ulib_ret ulog_ns(ULog *log, utime_ns const *nanos, char const *fmt, ...);
288+
* @alias ulib_ret ulog_ns(utime_ns const *nanos, char const *fmt, ...);
290289
*/
291-
#define ulog_ns(log, nanos, ...) ulog(ulog_main, ULOG_PERF, nanos, __VA_ARGS__)
290+
#define ulog_ns(nanos, ...) ulog(ulog_main, ULOG_PERF, nanos, __VA_ARGS__)
292291

293292
/**
294293
* Measures and logs the time elapsed between the start and end of a block of code.
@@ -305,7 +304,8 @@ void ulog_disable(ULog *log) {
305304
*/
306305
#define ulog_elapsed(log, ...) \
307306
for (utime_ns p_##__LINE__ = utime_get_ns(), p_end_##__LINE__ = 1; p_end_##__LINE__--; \
308-
(p_##__LINE__ = utime_get_ns() - p_##__LINE__), ulog_ns(log, &p_##__LINE__, __VA_ARGS__))
307+
((p_##__LINE__ = utime_get_ns() - p_##__LINE__), \
308+
ulog(log, ULOG_PERF, &p_##__LINE__, __VA_ARGS__)))
309309

310310
/**
311311
* Same as @func{ulog_elapsed}(@var{ulog_main}, `...`).

0 commit comments

Comments
 (0)