Chandra-MARX / marx

Chandra X-ray Observatory ray-trace simulator
http://space.mit.edu/cxc/marx/
5 stars 4 forks source link

Clean up dublicate definitions of FSEEK #43

Open hamogu opened 4 years ago

hamogu commented 4 years ago

marx code with with fseeko/ftello if available and fseek/ftell if not. In jdfits however, preprocessor definitions that select one of the two are duplicated in both configure.ac and in _jdfits.h. At first glance, I believe that only one of those is needed. The same is probably true for jdmath and possible marx itself. To be clear, nothing is really broken, but it is nice to reduce the number of compiler warnings and make headers and install scripts easier to read.

hamogu commented 8 months ago

In fact, I can probably remove all of those, since the C standard has evolved. It might be better to replace all fseek/ftell with fgetpos/fsetpos anywany when switching to C99 and remove all the preprocessor stuff, since I don't think we need to support systems that don't supply fseek any more.

Related: https://langdev.stackexchange.com/questions/2895/why-does-the-c-library-include-fgetpos-fsetpos-if-the-same-functionality-can