Patches item #3528023, was opened at 2012-05-18 12:37 Message generated for change (Settings changed) made by ksuzee You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=640804&aid=3528023&group_id=105292
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open >Resolution: None Priority: 5 Private: No Submitted By: Ksenija Slivko (ksuzee) Assigned to: Sean Morrison (brlcad) Summary: duplication in /libbu/htonf.c Initial Comment: Function NTOHF had the same body as HTONF. So I deleted this function but reduction in some other files were necessary. They are in this patch ---------------------------------------------------------------------- Comment By: Ksenija Slivko (ksuzee) Date: 2012-05-20 05:25 Message: Sean, I've done as you told: now there's static inline function that both htonf() and ntohf() call. I've updated htonf.patch too. ---------------------------------------------------------------------- Comment By: Ksenija Slivko (ksuzee) Date: 2012-05-19 09:12 Message: ..."convert_float()" that both htonf() and ntohf() call...Thank you. I'll work on it ---------------------------------------------------------------------- Comment By: Sean Morrison (brlcad) Date: 2012-05-19 08:02 Message: On that note, as you find yourself doing further source code reductions, check whether the function you are changing or eliminating is in any of the include/*.h header files. If it is, that change needs to be discussed (on the mailing list or IRC). For example, with this patch, the ntohf() and htonf() functions are listed in include/bu.h so deleting either would warrant discussion. As in this case, neither function should go away, so the proper fix for the duplication is a common shared function that both call, the static inline implementation function. ---------------------------------------------------------------------- Comment By: Sean Morrison (brlcad) Date: 2012-05-19 07:57 Message: It's fine to refactor the duplication, but you cannot eliminate either function. They semantically go together. The fact that our implementation is identical for both is just coincidence/lucky. To eliminate the duplication, you could create a static inline function perhaps called "convert_float()" that both htonf() and ntohf() call. Then you do not need to modify any of the callers. If you update the patch that way, it should be good to apply. ---------------------------------------------------------------------- Comment By: Ksenija Slivko (ksuzee) Date: 2012-05-19 02:15 Message: Sean, you've told it's very old - so shall I find smth new or it's normal? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=640804&aid=3528023&group_id=105292 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ BRL-CAD Tracker mailing list brlcad-tracker@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-tracker