Skip to content

Commit a8abb96

Browse files
committed
RP2040 MBED compile warnings
1 parent c01be15 commit a8abb96

File tree

7 files changed

+149
-9
lines changed

7 files changed

+149
-9
lines changed

src/AudioBasic/Str.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace audio_tools {
1717

1818
class Str {
1919
public:
20-
Str(){}
20+
Str() = default;
2121

2222
/// Creates a Str for string constant
2323
Str(const char* chars){

src/AudioBasic/StrExt.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ namespace audio_tools {
2222
class StrExt : public Str {
2323

2424
public:
25-
StrExt(){
26-
}
25+
StrExt() = default;
2726

2827
StrExt(int initialAllocatedLength){
2928
maxlen = initialAllocatedLength;

src/AudioMetaData/MetaDataID3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ class MetaDataID3V2 : public MetaDataID3Base {
504504
// we just use the first entry
505505
result[end_pos]=0;
506506
int idx = atoi(result+1);
507-
if (idx>=0 && idx<sizeof(genres)){
507+
if (idx>=0 && idx< (int)sizeof(genres)){
508508
strncpy((char*)result,genres[idx],256);
509509
}
510510
}

src/AudioPWM/PWMAudioBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct PWMConfig : public AudioBaseInfo {
6868
LOGI("channels: %d", channels);
6969
LOGI("bits_per_sample: %d", bits_per_sample);
7070
LOGI("buffer_size: %u", buffer_size);
71-
LOGI("pwm_frequency: %u", pwm_frequency);
71+
LOGI("pwm_frequency: %lu", pwm_frequency);
7272
//LOGI("resolution: %d", resolution);
7373
//LOGI("timer_id: %d", timer_id);
7474
}

src/AudioTimer/AudioTimerDef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AudioUtils {
4040
static uint32_t toTimeUs(uint32_t samplingRate, uint8_t limit=10){
4141
uint32_t result = 1000000l / samplingRate;
4242
if (result <= limit){
43-
LOGW("Time for samplingRate %u -> %u is < %u μs - we rounded up", samplingRate, result, limit);
43+
LOGW("Time for samplingRate %u -> %lu is < %u μs - we rounded up", (unsigned int)samplingRate, result, limit);
4444
result = limit;
4545
}
4646
return result;
@@ -49,7 +49,7 @@ class AudioUtils {
4949
static uint32_t toTimeMs(uint32_t samplingRate, uint8_t limit=1){
5050
uint32_t result = 1000l / samplingRate;
5151
if (result <= limit){
52-
LOGW("Time for samplingRate %u -> %u is < %u μs - we rounded up", samplingRate, result, limit);
52+
LOGW("Time for samplingRate %u -> %lu is < %u μs - we rounded up", (unsigned int)samplingRate, result, limit);
5353
result = limit;
5454
}
5555
return result;

src/AudioTools/AudioStreams.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ class TimerCallbackAudioStream : public BufferedStream,
621621
buffer = new RingBuffer<uint8_t>(cfg.buffer_size);
622622
timer = new TimerAlarmRepeating(cfg.timer_function, cfg.timer_id);
623623
time = AudioUtils::toTimeUs(cfg.sample_rate);
624-
LOGI("sample_rate: %u -> time: %u milliseconds", cfg.sample_rate, time);
624+
LOGI("sample_rate: %u -> time: %lu milliseconds", cfg.sample_rate, time);
625625
timer->setCallbackParameter(this);
626626
timer->begin(timerCallback, time, TimeUnit::US);
627627
}
@@ -717,7 +717,7 @@ class TimerCallbackAudioStream : public BufferedStream,
717717

718718
/// log and update effective sample rate
719719
virtual void printSampleRate() {
720-
LOGI("effective sample rate: %d", currentRateValue);
720+
LOGI("effective sample rate: %u", (unsigned int)currentRateValue);
721721
if (cfg.adapt_sample_rate &&
722722
abs((int)currentRateValue - cfg.sample_rate) > 200) {
723723
cfg.sample_rate = currentRateValue;
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "../../../../../../../../../Arduino/libraries/arduino-audio-tools"
5+
},
6+
{
7+
"name": "RP2040-Audiotools",
8+
"path": "../../../../../.."
9+
}
10+
],
11+
"settings": {
12+
"files.associations": {
13+
"functional": "cpp",
14+
"array": "cpp",
15+
"initializer_list": "cpp",
16+
"string_view": "cpp",
17+
"utility": "cpp",
18+
"atomic": "cpp",
19+
"*.tcc": "cpp",
20+
"cctype": "cpp",
21+
"chrono": "cpp",
22+
"clocale": "cpp",
23+
"cmath": "cpp",
24+
"compare": "cpp",
25+
"complex": "cpp",
26+
"concepts": "cpp",
27+
"cstdint": "cpp",
28+
"cstdio": "cpp",
29+
"cstdlib": "cpp",
30+
"ctime": "cpp",
31+
"cwchar": "cpp",
32+
"cwctype": "cpp",
33+
"deque": "cpp",
34+
"unordered_map": "cpp",
35+
"vector": "cpp",
36+
"exception": "cpp",
37+
"iosfwd": "cpp",
38+
"iostream": "cpp",
39+
"istream": "cpp",
40+
"limits": "cpp",
41+
"new": "cpp",
42+
"numbers": "cpp",
43+
"ostream": "cpp",
44+
"ratio": "cpp",
45+
"semaphore": "cpp",
46+
"sstream": "cpp",
47+
"stdexcept": "cpp",
48+
"stop_token": "cpp",
49+
"streambuf": "cpp",
50+
"string": "cpp",
51+
"system_error": "cpp",
52+
"thread": "cpp",
53+
"type_traits": "cpp",
54+
"tuple": "cpp",
55+
"typeinfo": "cpp",
56+
"valarray": "cpp",
57+
"condition_variable": "cpp",
58+
"future": "cpp",
59+
"bitset": "cpp",
60+
"hash_map": "cpp",
61+
"hashtable": "cpp",
62+
"regex": "cpp",
63+
"bufferobject": "cpp",
64+
"image": "cpp",
65+
"mixinvector": "cpp",
66+
"texture": "cpp",
67+
"vertexarraystate": "cpp",
68+
"buffered_value": "cpp",
69+
"fast_back_stack": "cpp",
70+
"random": "cpp",
71+
"vec3b": "cpp",
72+
"vec3i": "cpp",
73+
"vec3s": "cpp",
74+
"vec3ub": "cpp",
75+
"vec3ui": "cpp",
76+
"vec3us": "cpp",
77+
"vec4b": "cpp",
78+
"vec4d": "cpp",
79+
"vec4f": "cpp",
80+
"vec4i": "cpp",
81+
"vec4s": "cpp",
82+
"vec4ub": "cpp",
83+
"vec4ui": "cpp",
84+
"vec4us": "cpp",
85+
"mutex": "cpp",
86+
"list": "cpp",
87+
"unordered_set": "cpp",
88+
"attributedispatchers": "cpp",
89+
"types": "cpp",
90+
"optional": "cpp",
91+
"variant": "cpp",
92+
"valueobject": "cpp",
93+
"cullsettings": "cpp",
94+
"fstream": "cpp",
95+
"graphicscontext": "cpp",
96+
"object": "cpp",
97+
"operationthread": "cpp",
98+
"stats": "cpp",
99+
"valuemap": "cpp",
100+
"valuestack": "cpp",
101+
"primitiveset": "cpp",
102+
"quat": "cpp",
103+
"vec2d": "cpp",
104+
"vec2f": "cpp",
105+
"vec3d": "cpp",
106+
"vec3f": "cpp",
107+
"matrixd": "cpp",
108+
"matrixf": "cpp",
109+
"plane": "cpp",
110+
"uniform": "cpp",
111+
"vec2b": "cpp",
112+
"vec2i": "cpp",
113+
"vec2s": "cpp",
114+
"vec2ub": "cpp",
115+
"vec2ui": "cpp",
116+
"vec2us": "cpp",
117+
"polytope": "cpp",
118+
"light": "cpp",
119+
"affinity": "cpp",
120+
"program": "cpp",
121+
"cstdarg": "cpp",
122+
"cstddef": "cpp",
123+
"cstring": "cpp",
124+
"iomanip": "cpp",
125+
"memory": "cpp",
126+
"cfenv": "cpp",
127+
"cinttypes": "cpp",
128+
"bit": "cpp",
129+
"map": "cpp",
130+
"set": "cpp",
131+
"algorithm": "cpp",
132+
"iterator": "cpp",
133+
"memory_resource": "cpp",
134+
"numeric": "cpp",
135+
"__bit_reference": "cpp",
136+
"__hash_table": "cpp",
137+
"__split_buffer": "cpp",
138+
"__tree": "cpp"
139+
}
140+
}
141+
}

0 commit comments

Comments
 (0)