coin3d / simage

Image file loading
ISC License
7 stars 9 forks source link

Many unused functions and function parameters, deprecated type aliases #52

Open omartijn opened 3 years ago

omartijn commented 3 years ago

In src/resize.c there are a lot of unused functions:

float filter(float)
float box_filter(float)
float triangle_filter(float)
B_spline_filter(float)
Lanczos3_filter(float)
Mitchell_filter(float)
unsigned char* simage_resize_fast(unsigned char, int, int, int, int, int)

src/simage_write.c also has some unused functions:

add_saver_ext
str_tolower

There are also quite some functions taking arguments they don't use, e.g. in src/simage_pic.c there is a function called simage_pic_identify which takes a const char * ptr argument it doesn't use, and in src/image.c there's a function called s_set_dynamic_loader_interface which gets three arguments, none of which are used (the function doesn't do anything).

Also, if you use this library with libtiff 4.3.0, you'll get some deprecation notices, because we use typedefs for numerics which are deprecated in this version onward, e.g. uint16.

What should we do with these issues? Is there a reason not to just remove the unused functions? They're all static, so I guess they're not doing us any good.

Removing the unused parameters likely means an API break, not sure what the policy is on that.

For libtiff compatibility we can probably just include stdint.h and use the typedefs from their (so e.g. changing uint16 to uint16_t).