vdudouyt / minipro

An open source program for controlling the MiniPRO TL866xx series of chip programmers
383 stars 77 forks source link

int size appears in a few places #115

Closed DavidGriffith closed 5 years ago

DavidGriffith commented 6 years ago

I found some places where a size for something is defined as an int. We should probably be using size_t instead.

rozhuk-im commented 6 years ago

Bad idea use size_t every where, int was very bad. size_t designed to address host memory size, but this struct device contain external flash memory size. For example, off_t is used to address some disk/storage offset/size, and sizeof(off_t) not depend on x32/x64 cpu arch. TL866 uses 24 bit address, so uint32_t - is OK for addresses and flash size (in db - struct device). get_file_size() - off_t!!! compare_memory() - size_t - OK other size_t - ok, it is for in app mem calculations.

DavidGriffith commented 6 years ago

Are there any other places where I shouldn't be using size_t besides the type for get_file_size()?

rozhuk-im commented 6 years ago

struct device and all other places where "size" - mean size/offset for flash