Const keyword is missing for data parameter
Closed this issue · 4 comments
MaJerle commented
weycen commented
FileX will ensure that the incoming BUFFER will not be modified, so I think it is not necessary to use const keyword here.
MaJerle commented
Unfortunately this is not enough guaranty for aurhorities. Passing const pointer will result in at least warning, if not even error in some compilers.
Adding const has added value at robustness level and is not introducing backward compatibility break.
weycen commented
You are right. Const keyword is added in many other codes for data parameter, but I read FileX such as fx_file_write(), fx_media_write(), these functions are not added, all the source code is only some constant arrays use const, such as static const USHORT diff_table_range_low[]
.