GSoC/GCI Archive
Google Code-in 2012 BRL-CAD

Reduce duplicate code in htonf.c

completed by: Shomiron Ghose

mentors: Sean, Andrei Popescu


BRL-CAD is more than one million lines of source code and keeping that much code clean is a never-ending task.  Keeping maintenance costs low requires consistent attention on improving code quality.  One great way to improve code quality is to reduce the amount of duplication.

This task involves creating a static inline function named convert_float(). Since you will modify an existing file, you need to write the function in C.  It should have the same functionality as the duplicated code in our htonf() and ntonf() functions. 

References:

  • http://www.greenend.org.uk/rjk/tech/inline.html - About inline functions.

Code:

  • brlcad/src/libbu/htonf.c

Contact andrei on #brlcad on irc.freenode.net if you need help on this task.