From: SourceForge.net <no...@so...> - 2003-08-28 09:59:44
|
Patches item #796591, was opened at 2003-08-28 09:57 Message generated for change (Comment added) made by redi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=307869&aid=796591&group_id=7869 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jonathan Wakely (redi) Assigned to: Nobody/Anonymous (nobody) Summary: Tidy up SharedPtr to prevent warnings Initial Comment: This patch re-orders the initialisation list for SharedPtr to match the order of declaration in the class body. The compiler does this re-ordering automatically since members must be initialised in the order they're declared, so this patch simply prevents a compiler warning to that effect (at least GCC warns about this, I don't know about others). While looking at this I also made some other similar changes. I changed the SharedPtr(T_obj* pobj) ctor to initialise m_pobj in the initialisation list and removed the test for pobj!=NULL since this is repeated inside ref() anyway. I changed the copy ctor to remove the check for self-assignment (which is impossible since this is a ctor, not operator=) and to copy the members in the initialisation list rather than initialising to zero and then assigning. As well as preventing warnings these changes should make the class (very slightly) more efficient. Tested on GCC 3.4 (experimental) ---------------------------------------------------------------------- >Comment By: Jonathan Wakely (redi) Date: 2003-08-28 09:59 Message: Logged In: YES user_id=426241 Oops, posted a version of the patch without a ChangeLog entry. Replaced. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=307869&aid=796591&group_id=7869 |