newdigate / teensy-variable-playback

Firmware library: variable playback rate for teensy audio library
MIT License
56 stars 10 forks source link

Please clean up your warnings. #55

Closed johannthorir closed 1 year ago

johannthorir commented 1 year ago

This is very unprofessional....

In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableSDFile.h:5, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:13, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h: In instantiation of 'newdigate::IndexableFile<BUFFER_SIZE, MAX_NUM_BUFFERS, TFile>::IndexableFile(const char) [with unsigned int BUFFER_SIZE = 128; unsigned int MAX_NUM_BUFFERS = 4; TFile = File]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableSDFile.h:17:66: required from 'newdigate::IndexableSDFile<BUFFER_SIZE, MAX_NUM_BUFFERS>::IndexableSDFile(const char) [with unsigned int BUFFER_SIZE = 128; unsigned int MAX_NUM_BUFFERS = 4]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:62:53: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:92:33: warning: 'newdigate::IndexableFile<128, 4, File>::_buffers' will be initialized after [-Wreorder] 92 | std::vector<indexedbuffer> _buffers; | ^~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:29:12: warning: 'size_t newdigate::IndexableFile<128, 4, File>::buffer_to_index_shift' [-Wreorder] 29 | size_t buffer_to_index_shift; | ^~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:30:5: warning: when initialized here [-Wreorder] 30 | IndexableFile(const char filename) : | ^~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h: In instantiation of 'newdigate::IndexableFile<BUFFER_SIZE, MAX_NUM_BUFFERS, TFile>::IndexableFile(const char) [with unsigned int BUFFER_SIZE = 128; unsigned int MAX_NUM_BUFFERS = 2; TFile = File]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableLittleFSFile.h:18:17: required from 'newdigate::IndexableLittleFSFile<BUFFER_SIZE, MAX_NUM_BUFFERS>::IndexableLittleFSFile(LittleFS&, const char) [with unsigned int BUFFER_SIZE = 128; unsigned int MAX_NUM_BUFFERS = 2]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingLfsReader.h:59:66: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:92:33: warning: 'newdigate::IndexableFile<128, 2, File>::_buffers' will be initialized after [-Wreorder] 92 | std::vector<indexedbuffer> _buffers; | ^~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:29:12: warning: 'size_t newdigate::IndexableFile<128, 2, File>::buffer_to_index_shift' [-Wreorder] 29 | size_t buffer_to_index_shift; | ^~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:30:5: warning: when initialized here [-Wreorder] 30 | IndexableFile(const char filename) : | ^~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h: In instantiation of 'newdigate::IndexableFile<BUFFER_SIZE, MAX_NUM_BUFFERS, TFile>::IndexableFile(const char) [with unsigned int BUFFER_SIZE = 128; unsigned int MAX_NUM_BUFFERS = 2; TFile = SerialFlashFile]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableSerialFlashFile.h:18:17: required from 'newdigate::IndexableSerialFlashFile<BUFFER_SIZE, MAX_NUM_BUFFERS>::IndexableSerialFlashFile(SerialFlashChip&, const char) [with unsigned int BUFFER_SIZE = 128; unsigned int MAX_NUM_BUFFERS = 2]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSerialFlashReader.h:63:69: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:92:33: warning: 'newdigate::IndexableFile<128, 2, SerialFlashFile>::_buffers' will be initialized after [-Wreorder] 92 | std::vector<indexedbuffer> _buffers; | ^~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:29:12: warning: 'size_t newdigate::IndexableFile<128, 2, SerialFlashFile>::buffer_to_index_shift' [-Wreorder] 29 | size_t buffer_to_index_shift; | ^~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/IndexableFile.h:30:5: warning: when initialized here [-Wreorder] 30 | IndexableFile(const char filename) : | ^~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playsdresmp.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:13, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h: In instantiation of 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingSerialFlashReader]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:106:26: warning: unused variable 'i' [-Wunused-variable] 106 | unsigned int i, n; | ^ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h: In instantiation of 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingLfsReader]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:106:26: warning: unused variable 'i' [-Wunused-variable] c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h: In instantiation of 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingArrayReader]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:106:26: warning: unused variable 'i' [-Wunused-variable] c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h: In instantiation of 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingSdReader]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:106:26: warning: unused variable 'i' [-Wunused-variable] In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h: In instantiation of 'bool newdigate::ResamplingReader<TArray, TFile>::readNextValue(int16_t*, uint16_t) [with TArray = newdigate::IndexableSerialFlashFile<128, 2>; TFile = SerialFlashFile; int16_t = short int; uint16_t = short unsigned int]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:172:21: required from 'unsigned int newdigate::ResamplingReader<TArray, TFile>::read(void, uint16_t) [with TArray = newdigate::IndexableSerialFlashFile<128, 2>; TFile = SerialFlashFile; uint16_t = short unsigned int]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:121:33: required from 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingSerialFlashReader]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:241:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 241 | if (_crossfade == 0.0 && _bufferPosition1 > (_loop_finish - _numChannels) - _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:245:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 245 | } else if (_crossfade == 1.0 && _bufferPosition2 > (_loop_finish - _numChannels)- _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:263:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 263 | if (_crossfade == 0.0 && _bufferPosition1 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:267:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 267 | } else if (_crossfade == 1.0 && _bufferPosition2 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h: In instantiation of 'bool newdigate::ResamplingReader<TArray, TFile>::readNextValue(int16_t*, uint16_t) [with TArray = newdigate::IndexableLittleFSFile<128, 2>; TFile = File; int16_t = short int; uint16_t = short unsigned int]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:172:21: required from 'unsigned int newdigate::ResamplingReader<TArray, TFile>::read(void*, uint16_t) [with TArray = newdigate::IndexableLittleFSFile<128, 2>; TFile = File; uint16_t = short unsigned int]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:121:33: required from 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingLfsReader]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:241:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 241 | if (_crossfade == 0.0 && _bufferPosition1 > (_loop_finish - _numChannels) - _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:245:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 245 | } else if (_crossfade == 1.0 && _bufferPosition2 > (_loop_finish - _numChannels)- _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:263:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 263 | if (_crossfade == 0.0 && _bufferPosition1 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:267:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 267 | } else if (_crossfade == 1.0 && _bufferPosition2 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h: In instantiation of 'bool newdigate::ResamplingReader<TArray, TFile>::readNextValue(int16_t, uint16_t) [with TArray = short int; TFile = File; int16_t = short int; uint16_t = short unsigned int]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:172:21: required from 'unsigned int newdigate::ResamplingReader<TArray, TFile>::read(void, uint16_t) [with TArray = short int; TFile = File; uint16_t = short unsigned int]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:121:33: required from 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingArrayReader]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:241:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 241 | if (_crossfade == 0.0 && _bufferPosition1 > (_loop_finish - _numChannels) - _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:245:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 245 | } else if (_crossfade == 1.0 && _bufferPosition2 > (_loop_finish - _numChannels)- _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:263:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 263 | if (_crossfade == 0.0 && _bufferPosition1 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:267:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 267 | } else if (_crossfade == 1.0 && _bufferPosition2 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h: In instantiation of 'bool newdigate::ResamplingReader<TArray, TFile>::readNextValue(int16_t*, uint16_t) [with TArray = newdigate::IndexableSDFile<128, 4>; TFile = File; int16_t = short int; uint16_t = short unsigned int]': c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:172:21: required from 'unsigned int newdigate::ResamplingReader<TArray, TFile>::read(void**, uint16_t) [with TArray = newdigate::IndexableSDFile<128, 4>; TFile = File; uint16_t = short unsigned int]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:121:33: required from 'void AudioPlayResmp::update() [with TResamplingReader = newdigate::ResamplingSdReader]' c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/playresmp.h:100:14: required from here c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:241:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 241 | if (_crossfade == 0.0 && _bufferPosition1 > (_loop_finish - _numChannels) - _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~~ In file included from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingSdReader.h:14, from c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/TeensyVariablePlayback.h:9, from C:\Users\joi\Documents\Arduino\sketch_apr28a\sketch_apr28a.ino:6: c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:245:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 245 | } else if (_crossfade == 1.0 && _bufferPosition2 > (_loop_finish - _numChannels)- _crossfadeDurationInSamples) { | ~~~^~~~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:263:59: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 263 | if (_crossfade == 0.0 && _bufferPosition1 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~ c:\Users\joi\Documents\Arduino\libraries\TeensyVariablePlayback\src/ResamplingReader.h:267:66: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] 267 | } else if (_crossfade == 1.0 && _bufferPosition2 < _crossfadeDurationInSamples + _header_offset) { | ~~~^~~~~~~~~~~~

newdigate commented 1 year ago

thank you for you enthusiasm.

if you don’t like the warnings, and you feel really strongly about this, you could 1) fix them and send a pull request. 2) turn off warnings in your ide

there are lots of improvements needed on this library and reducing the warnings (being professional as you put it) is not something i plan on doing at any time soon.

let me be very clear. this is not professional code. this is entirely recreational programming which the community have contributed.