No, that would break the code: there is e.g. the condition a bit further asserting that the lookup value should be < 3;
a negative value would pass, while it shouldn't.
-- Peter.
--
________________________________
Från: Gehua Yang <yanggehua@...>
Till: Peter Vanroose <p.vanroose@...>
Kopia: "vxl-users@..." <vxl-users@...>
Skickat: torsdag, 29 mars 2012 22:36
Ämne: Re: [Vxl-users] [PATCH] fix for compiler errors with clang with C++11
Hi Peter,
Just a dumb question without looking at the code: wouldn't it be better if calc_edge_index_lookup is an array of signed int instead? I wonder if it will be a quick change as you are already on it.
Gehua.
On Thu, Mar 29, 2012 at 3:35 PM, Peter Vanroose <peter_vanroose@...> wrote:
OK, I'll change it now.
>
>
>-- Peter.
>
>
>
>
>--
>
>
>________________________________
> Från: Sean McBride <sean@...>
>
>
>Well, I'm not familiar with the code, or what it's trying to do, but I'd say UINT_MAX. The C++ standard does not guarantee that 'int' is 32 bits, so 0xffffffff and UINT_MAX are not necessarily the same.
>
>Sean
>
>On Thu, 29 Mar 2012 20:07:08 +0100, Peter Vanroose said:
>
>>Sorry Sean,
>>it seems like I had roughly the
same idea as you, before I saw your post;
>>but I used 0xffffffff instead of UINT_MAX.
>>
>>Which of the two is preferred?
>>
>>
>>-- Peter.
>>
>>
>>Sean McBride wrote:
>>Index: core/vgl/vgl_triangle_3d.cxx
>>===================================================================
>>--- core/vgl/vgl_triangle_3d.cxx (revision 34632)
>>+++ core/vgl/vgl_triangle_3d.cxx (working copy)
>>@@ -375,7 +375,7 @@
>>
>> namespace
>> {
>>- static const unsigned calc_edge_index_lookup[8] = {-1, 0, 2, 0, -1,
>>1, 2, 1};
>>+ static const unsigned calc_edge_index_lookup[8] = {UINT_MAX, 0, 2, 0,
>>UINT_MAX, 1, 2, 1};
>> //: Given the [0,2] index of two vertices, in either order, return
>>the edge index [0,2]
>> // E.g. between vertices 2 and 0 is edge
2.
>> // Use precalculated list lookup, probably fastest.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>------------------------------------------------------------------------------
>This SF email is sponsosred by:
>Try Windows Azure free for 90 days Click Here
>http://p.sf.net/sfu/sfd2d-msazure
>_______________________________________________
>Vxl-users mailing list
>Vxl-users@...
>https://lists.sourceforge.net/lists/listinfo/vxl-users
>
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Vxl-users mailing list
Vxl-users@...
https://lists.sourceforge.net/lists/listinfo/vxl-users
|