Issue #1

0 up
0 down
Open
jerasure/jerasure#1
Created by jan--f

data sources for encoding should be const

Hi, imho the interface of the 3 encoding functions and the jerasure_do_parity function would benefit from declaring data source pointers as const. It gives the user a clear statement that these buffers will not be written to.

On the downside a few casts to char* are necessary but I think it is better to do it in the library itself, rather than let the user do it.

I run into this since the code I use jerasure with has declared the source buffer in a write operation as const. I have to const_cast it to use jerasure. someone else who uses jerasure might not have existing code and just use a mutual buffer in the rest of the code too.

I am aware that backwards compatibility is an issue (i.e. cast from char** to const char ** produces warnings) but maybe this issue can be discussed.

best, jan

Assignee: None
Milestone: None
2 participants