Skip to content

Commit 7a2f259

Browse files
committed
Default clang-format overwritten with .clang-format
1 parent 9dbb1fe commit 7a2f259

18 files changed

+2236
-2880
lines changed

clang-format .clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BasedOnStyle: LLVM
33
IndentWidth: 4
44
TabWidth: 4
55
UseTab: Never
6-
ColumnLimit: 120
6+
ColumnLimit: 180
77

88
# NOTE: Cpp is used for both C and C++
99
Language: Cpp

build.rs

+38-38
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@ fn main() {
22
build_info_build::build_script();
33

44
// Generate XCPlite C code bindings
5-
6-
let bindings = bindgen::Builder::default()
7-
.header("xcplib/wrapper.h")
8-
.clang_args(&["-target", "x86_64-pc-windows-msvc"])
9-
.clang_arg("-Ixcplib/src")
10-
.clang_arg("-Ixcplib")
11-
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
12-
//
13-
.blocklist_type("T_CLOCK_INFO")
14-
.allowlist_type("tXcpDaqLists")
15-
// Protocol layer
16-
.allowlist_function("XcpInit")
17-
//.allowlist_function("XcpStart")
18-
.allowlist_function("XcpDisconnect")
19-
// ETH server mode
20-
.allowlist_function("XcpEthServerInit")
21-
.allowlist_function("XcpEthServerShutdown")
22-
.allowlist_function("XcpEthServerStatus")
23-
.allowlist_function("XcpEthTlGetInfo")
24-
// DAQ
25-
.allowlist_function("XcpTriggerDaqEventAt")
26-
//.allowlist_function("XcpEventAt")
27-
.allowlist_function("XcpEvent")
28-
//.allowlist_function("XcpEventExtAt")
29-
.allowlist_function("XcpEventExt")
30-
// Misc
31-
.allowlist_function("XcpPrint")
32-
.allowlist_function("XcpSendTerminateSessionEvent")
33-
.allowlist_function("ApplXcpSetLogLevel")
34-
.allowlist_function("ApplXcpSetA2lName")
35-
.allowlist_function("ApplXcpSetEpk")
36-
.allowlist_function("ApplXcpGetAddr")
37-
.allowlist_function("ApplXcpRegisterCallbacks")
38-
//
39-
.generate()
40-
.expect("Unable to generate bindings");
41-
bindings.write_to_file("src/xcp/xcplib.rs").expect("Couldn't write bindings!");
42-
5+
/*
6+
let bindings = bindgen::Builder::default()
7+
.header("xcplib/wrapper.h")
8+
.clang_args(&["-target", "x86_64-pc-windows-msvc"])
9+
.clang_arg("-Ixcplib/src")
10+
.clang_arg("-Ixcplib")
11+
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
12+
//
13+
.blocklist_type("T_CLOCK_INFO")
14+
.allowlist_type("tXcpDaqLists")
15+
// Protocol layer
16+
.allowlist_function("XcpInit")
17+
//.allowlist_function("XcpStart")
18+
.allowlist_function("XcpDisconnect")
19+
// ETH server mode
20+
.allowlist_function("XcpEthServerInit")
21+
.allowlist_function("XcpEthServerShutdown")
22+
.allowlist_function("XcpEthServerStatus")
23+
.allowlist_function("XcpEthTlGetInfo")
24+
// DAQ
25+
.allowlist_function("XcpTriggerDaqEventAt")
26+
//.allowlist_function("XcpEventAt")
27+
.allowlist_function("XcpEvent")
28+
//.allowlist_function("XcpEventExtAt")
29+
.allowlist_function("XcpEventExt")
30+
// Misc
31+
.allowlist_function("XcpPrint")
32+
.allowlist_function("XcpSendTerminateSessionEvent")
33+
.allowlist_function("ApplXcpSetLogLevel")
34+
.allowlist_function("ApplXcpSetA2lName")
35+
.allowlist_function("ApplXcpSetEpk")
36+
.allowlist_function("ApplXcpGetAddr")
37+
.allowlist_function("ApplXcpRegisterCallbacks")
38+
//
39+
.generate()
40+
.expect("Unable to generate bindings");
41+
bindings.write_to_file("src/xcp/xcplib.rs").expect("Couldn't write bindings!");
42+
*/
4343
// Build a XCP on ETH version of XCPlite as a library
4444
cc::Build::new()
4545
.include("xcplib/src/")

xcplib/src/dbg_print.h

+36-36
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,43 @@
2525
extern uint8_t gDebugLevel;
2626
#define DBG_LEVEL gDebugLevel
2727

28-
#define DBG_PRINTF(level, format, ...) \
29-
if (DBG_LEVEL >= level) \
30-
printf("[XCP ] " format, __VA_ARGS__)
31-
#define DBG_PRINTF_ERROR(format, ...) \
32-
if (DBG_LEVEL >= 1) \
33-
printf("[XCP ] ERROR: " format, __VA_ARGS__)
34-
#define DBG_PRINTF_WARNING(format, ...) \
35-
if (DBG_LEVEL >= 2) \
36-
printf("[XCP ] WARNING: " format, __VA_ARGS__)
37-
#define DBG_PRINTF3(format, ...) \
38-
if (DBG_LEVEL >= 3) \
39-
printf("[XCP ] " format, __VA_ARGS__)
40-
#define DBG_PRINTF4(format, ...) \
41-
if (DBG_LEVEL >= 4) \
42-
printf("[XCP ] " format, __VA_ARGS__)
43-
#define DBG_PRINTF5(format, ...) \
44-
if (DBG_LEVEL >= 5) \
45-
printf("[XCP ] " format, __VA_ARGS__)
28+
#define DBG_PRINTF(level, format, ...) \
29+
if (DBG_LEVEL >= level) \
30+
printf("[XCP ] " format, __VA_ARGS__)
31+
#define DBG_PRINTF_ERROR(format, ...) \
32+
if (DBG_LEVEL >= 1) \
33+
printf("[XCP ] ERROR: " format, __VA_ARGS__)
34+
#define DBG_PRINTF_WARNING(format, ...) \
35+
if (DBG_LEVEL >= 2) \
36+
printf("[XCP ] WARNING: " format, __VA_ARGS__)
37+
#define DBG_PRINTF3(format, ...) \
38+
if (DBG_LEVEL >= 3) \
39+
printf("[XCP ] " format, __VA_ARGS__)
40+
#define DBG_PRINTF4(format, ...) \
41+
if (DBG_LEVEL >= 4) \
42+
printf("[XCP ] " format, __VA_ARGS__)
43+
#define DBG_PRINTF5(format, ...) \
44+
if (DBG_LEVEL >= 5) \
45+
printf("[XCP ] " format, __VA_ARGS__)
4646

47-
#define DBG_PRINT(level, format) \
48-
if (DBG_LEVEL >= level) \
49-
printf("[XCP ] " format)
50-
#define DBG_PRINT_ERROR(format) \
51-
if (DBG_LEVEL >= 1) \
52-
printf("[XCP ] ERROR: " format)
53-
#define DBG_PRINT_WARNING(format) \
54-
if (DBG_LEVEL >= 2) \
55-
printf("[XCP ] WARNING: " format)
56-
#define DBG_PRINT3(format) \
57-
if (DBG_LEVEL >= 3) \
58-
printf("[XCP ] " format)
59-
#define DBG_PRINT4(format) \
60-
if (DBG_LEVEL >= 4) \
61-
printf("[XCP ] " format)
62-
#define DBG_PRINT5(format) \
63-
if (DBG_LEVEL >= 5) \
64-
printf("[XCP ] " format)
47+
#define DBG_PRINT(level, format) \
48+
if (DBG_LEVEL >= level) \
49+
printf("[XCP ] " format)
50+
#define DBG_PRINT_ERROR(format) \
51+
if (DBG_LEVEL >= 1) \
52+
printf("[XCP ] ERROR: " format)
53+
#define DBG_PRINT_WARNING(format) \
54+
if (DBG_LEVEL >= 2) \
55+
printf("[XCP ] WARNING: " format)
56+
#define DBG_PRINT3(format) \
57+
if (DBG_LEVEL >= 3) \
58+
printf("[XCP ] " format)
59+
#define DBG_PRINT4(format) \
60+
if (DBG_LEVEL >= 4) \
61+
printf("[XCP ] " format)
62+
#define DBG_PRINT5(format) \
63+
if (DBG_LEVEL >= 5) \
64+
printf("[XCP ] " format)
6565

6666
#else
6767

0 commit comments

Comments
 (0)