Issue 5 in cdma: Changes applied in order to fix std::smart_ptr issues (ticket 4)

0 views
Skip to first unread message

cd...@googlecode.com

unread,
Nov 22, 2012, 9:36:35 AM11/22/12
to common-d...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Review Priority-Critical

New issue 5 by eugen.win...@gmail.com: Changes applied in order to
fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

Branch name:issue_4

Purpose of code changes on this branch:
The most of the changes were done in order to fix issue 4 that appeared
when using std::shared_ptr instead of the yat smart pointers.


When reviewing my code changes, please focus on:
all changes I made concerning smart pointers.


After the review, I'll merge this branch into:
/trunk



cd...@googlecode.com

unread,
Nov 22, 2012, 11:21:30 AM11/22/12
to common-d...@googlegroups.com

Comment #1 on issue 5 by stephane...@synchrotron-soleil.fr: Changes applied
in order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

The class yat::sharedPtr defines the operator anonymous_bool_type
So this:

if( my_ptr )
{...}

is strictly equivalent to:

if( my_ptr.is_null() )
{...}

Therefore, in LogicalGroup.cpp (line 138), you can avoid the #ifdef
CDMA_STD_SMART_PTR




cd...@googlecode.com

unread,
Nov 22, 2012, 11:50:05 AM11/22/12
to common-d...@googlegroups.com

Comment #2 on issue 5 by stephane...@synchrotron-soleil.fr: Changes applied
in order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

Oups. The comparison results are opposite. This is correct:

if( my_ptr )
{...}

is strictly equivalent to (be careful about the '!' (not) operator):

if( ! my_ptr.is_null() )
{...}


In the line 139 you should write:
for( unsigned int i = 0; i < keys.size() - 1 && tmp ; i++)

instead of:
for( unsigned int i = 0; i < keys.size() - 1 && ! tmp ; i++)


cd...@googlecode.com

unread,
Nov 23, 2012, 2:58:10 AM11/23/12
to common-d...@googlegroups.com

Comment #4 on issue 5 by eugen.win...@gmail.com: Changes applied in
order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

There are a log of other places in the code where this problem appears. I
will go through the files and try to fix this issues.

cd...@googlecode.com

unread,
Nov 23, 2012, 5:45:53 AM11/23/12
to common-d...@googlegroups.com

Comment #5 on issue 5 by stephane...@synchrotron-soleil.fr: Changes applied
in order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

Same remark for lines 208, 252, 283, 351 in LogicalGroup.cpp !


cd...@googlecode.com

unread,
Nov 26, 2012, 4:21:13 AM11/26/12
to common-d...@googlegroups.com

Comment #6 on issue 5 by stephane...@synchrotron-soleil.fr: Changes applied
in order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

I've fixed the smart pointers checking in LogicalGroup.cpp

cd...@googlecode.com

unread,
Nov 29, 2012, 9:13:54 AM11/29/12
to common-d...@googlegroups.com

Comment #7 on issue 5 by eugen.win...@gmail.com: Changes applied in
order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

I think we can close this review and merge the issue_4 branch back to trunk.

@Stephane: will you do it or shall I do the merge?

cd...@googlecode.com

unread,
Nov 29, 2012, 11:44:32 AM11/29/12
to common-d...@googlegroups.com
Updates:
Status: Fixed

Comment #8 on issue 5 by eugen.win...@gmail.com: Changes applied in
order to fix std::smart_ptr issues (ticket 4)
http://code.google.com/p/cdma/issues/detail?id=5

Code Review can be closed as the issue seems to be solved.

Reply all
Reply to author
Forward
0 new messages