|
@@ -38,7 +38,7 @@ void log_dump_to_usb(void) {
|
38
|
38
|
|
39
|
39
|
char buff[32];
|
40
|
40
|
int l = snprintf(buff, sizeof(buff), "\r\n\r\nbuffered log output:\r\n");
|
41
|
|
- if ((l > 0) && (l <= sizeof(buff))) {
|
|
41
|
+ if ((l > 0) && (l <= (int)sizeof(buff))) {
|
42
|
42
|
usb_cdc_write(buff, l);
|
43
|
43
|
}
|
44
|
44
|
|
|
@@ -50,7 +50,7 @@ void log_dump_to_usb(void) {
|
50
|
50
|
}
|
51
|
51
|
|
52
|
52
|
l = snprintf(buff, sizeof(buff), "\r\n\r\nlive log:\r\n");
|
53
|
|
- if ((l > 0) && (l <= sizeof(buff))) {
|
|
53
|
+ if ((l > 0) && (l <= (int)sizeof(buff))) {
|
54
|
54
|
usb_cdc_write(buff, l);
|
55
|
55
|
}
|
56
|
56
|
}
|
|
@@ -94,7 +94,7 @@ static int format_debug_log(char *buff, size_t len, const char *format, va_list
|
94
|
94
|
if (l < 0) {
|
95
|
95
|
// encoding error
|
96
|
96
|
l = snprintf(buff, len, "%s: encoding error\r\n", __func__);
|
97
|
|
- } else if (l >= len) {
|
|
97
|
+ } else if (l >= (ssize_t)len) {
|
98
|
98
|
// not enough space for string
|
99
|
99
|
l = snprintf(buff, len, "%s: message too long (%d)\r\n", __func__, l);
|
100
|
100
|
}
|
|
@@ -110,7 +110,7 @@ void debug_log(bool log, const char* format, ...) {
|
110
|
110
|
int l = format_debug_log(line_buff, sizeof(line_buff), format, args);
|
111
|
111
|
va_end(args);
|
112
|
112
|
|
113
|
|
- if ((l > 0) && (l <= sizeof(line_buff))) {
|
|
113
|
+ if ((l > 0) && (l <= (int)sizeof(line_buff))) {
|
114
|
114
|
usb_cdc_write(line_buff, l);
|
115
|
115
|
|
116
|
116
|
if (log) {
|