Commit a57529d7b0bd837ffcf28389558df8a408eec6b6

Authored by raffaele.gaetano
1 parent ea78cfb9
Exists in master

FIX: platform check for int64 type, will be __int64 for WIN32, long unsigned int otherwise

include/grmGraphOperations.txx
... ... @@ -39,7 +39,7 @@ namespace grm
39 39 {
40 40 for(auto& r : seg.m_Graph.m_Nodes)
41 41 {
42   - __int64 neighborhood[4];
  42 + NeighIDType neighborhood[4];
43 43 FOURNeighborhood(neighborhood, r->m_Id, width, height);
44 44 for(short j = 0; j < 4; ++j)
45 45 {
... ... @@ -53,7 +53,7 @@ namespace grm
53 53 {
54 54 for(auto& r : seg.m_Graph.m_Nodes)
55 55 {
56   - __int64 neighborhood[8];
  56 + NeighIDType neighborhood[8];
57 57 EIGHTNeighborhood(neighborhood, r->m_Id, width, height);
58 58 bool haveNeighbors = false;
59 59 for(short j = 0; j < 8; ++j)
... ...
include/grmNeighborhood.h
... ... @@ -20,16 +20,22 @@
20 20  
21 21 #include <cstddef>
22 22  
  23 +#if defined(_WIN32)
  24 +typedef __int64 NeighIDType;
  25 +#else
  26 +typedef long unsigned int NeighIDType;
  27 +#endif
  28 +
23 29 enum CONNECTIVITY{FOUR = 0, EIGHT};
24 30  
25 31 namespace grm
26 32 {
27   - void FOURNeighborhood(__int64 * neighborhood,
  33 + void FOURNeighborhood(NeighIDType * neighborhood,
28 34 const std::size_t id,
29 35 const unsigned int width,
30 36 const unsigned int height);
31 37  
32   - void EIGHTNeighborhood(__int64 * neighborhood,
  38 + void EIGHTNeighborhood(NeighIDType * neighborhood,
33 39 const std::size_t id,
34 40 const unsigned int width,
35 41 const unsigned int height);
... ...
src/grmNeighborhood.cxx
... ... @@ -19,7 +19,7 @@
19 19  
20 20 namespace grm
21 21 {
22   - void FOURNeighborhood(__int64 * neighborhood,
  22 + void FOURNeighborhood(NeighIDType * neighborhood,
23 23 const std::size_t id,
24 24 const unsigned int width,
25 25 const unsigned int height)
... ... @@ -40,7 +40,7 @@ namespace grm
40 40 neighborhood[3] = ( x > 0 ? (id - 1) : -1 );
41 41 }
42 42  
43   - void EIGHTNeighborhood(__int64 * neighborhood,
  43 + void EIGHTNeighborhood(NeighIDType * neighborhood,
44 44 const std::size_t id,
45 45 const unsigned int width,
46 46 const unsigned int height)
... ...