Break up large header into smaller headers (include/bn.h)BRL-CAD
Status: ClosedTime to complete: 100 hrs Mentors: Hardeep Singh Rai, IshwerdasTags: header, C, cleanup, code refactoringBeginner

BRL-CAD has a few header files that are just monstrously large. Instead of huge headers, we want to break them up into smaller, more modular headers.

This task entails breaking up our include/bn header into multiple headers. You'll be expected to use the existing header groupings that are in the file so that related portions of the API remain grouped together. You'll probably end up creating at least a dozen new headers in an include/bn/ subdirectory.

  1. obtain BRL-CAD from SVN checkout
  2. create a new header via "sh/template.sh lgpl include/bn/subheader.h"
  3. update include/bn.h to #include your new bn/subheader.h file
  4. make sure it compiles
  5. run "svn add include/bn/subheader.h"
  6. repeat from #2 until there are no more symbols left
  7. submit your changes as a patch file: svn diff my_changes.patch

References:
  • include/bu.h
  • include/bu/*.h
  • http://brlcad.org/wiki/Patches
  • http://brlcad.org/wiki/Compiling
Modify:
  • include/bn.h -- you'll end up with just #include bn subheader.h="" in here
  • include/bn/*.h -- you create new subheaders here, you can run sh/template.sh to create stubs
Uploaded Work
File name/URLFile sizeDate submitted
my_changes.patch309.6 KBDecember 09 2014 15:52 UTC
Comments
wltanon December 7 2014 14:14 UTCTask Claimed

I would like to work on this task.

Ch3ck on December 7 2014 14:16 UTCTask Assigned

This task has been assigned to wltan. You have 100 hours to complete this task, good luck!

wltanon December 9 2014 15:52 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 10 2014 03:55 UTCwow!

THIS IS FANTASTIC!  Wow, seriously!  I figured that whomever worked on this task would almost certainly get stuck and either give up or need to ask for help.


On a quick look through the patch, I only saw a few minor template markers that didn't get updated out of the 25 subheaders introduced.  How long did this take you??


 

Sean on December 10 2014 03:55 UTCTask Closed

Congratulations, this task has been completed successfully.

wltanon December 10 2014 14:24 UTC

Took me about half a day of copy/pasting code into the new headers. Once you get the hang of it, it's fairly simple.


As for the minor stuff I missed out, I'll fix them and submit a patch later.

wltanon December 10 2014 14:33 UTCUploaded the patch

One last thing before this thread gets ignored forever:


https://sourceforge.net/p/brlcad/patches/318/ 

Sean on December 10 2014 14:39 UTCignored forever?

Haha, we actually keep tabs on the patches submitted via Melange and have processes for applying and downloading them (even for previous years).  This one was already applied to a source tree and was being tested last night.  If all the tests pass, it'll be immediately applied and you'll be credited in our documentation.  If you provide your full name, we'll even credit you proper in our AUTHORS file.


 

wltanon December 10 2014 14:57 UTCso they don't get ignored forever :O

I noticed that Melange content rarely appears on Google web search, so that led me to think that stuff like this would be really obscure to most people. Oh well, the more you know...


Anyway, it's good to know that my patch is going somewhere. If you need my proper name for credits and stuff, here you go:


Full Name (surname+given name): Tan Wei Liang


Last name/Surname: Tan