Use const pointer in write functions
The buffer passed to the write function should be const.
Thanks! Will run it thru the tests next week, currently in vacation mode 😉
Hi again,
building it (gcc 4.8.4) yields warnings:
src/spiffs_hydrogen.c: In function ‘spiffs_hydro_write’:
src/spiffs_hydrogen.c:420:44: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
res = spiffs_object_modify(fd, offset, (u8_t *)buf, m_len);
^
src/spiffs_hydrogen.c:423:19: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
u8_t *buf_8 = (u8_t *)buf;
^
src/spiffs_hydrogen.c:429:44: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
res = spiffs_object_append(fd, offset, (u8_t *)buf, remaining);
^
Would you please fix these before I merge it in?
@pellepl Sorry I forgot to do it until now.
Const pointer are used in more write functions, the warning should disappear.
Only drawback is that the HAL write function prototype has been updated.
Hi, Sorry for belated answer. Busy times for me now. Thanks for your work! Ah yes, suspected the callbacks would have to change. I am planning a major rewrite of spiffs which will change some other API stuff also. Instead of pushing two different patches with API changes in both, I think the best way is to incorporate yours in the major change. Meaning this request will be put on ice for some time, if that's ok with you.
Cheers / Peter