Commit a57529d7 authored by Gaetano Raffaele's avatar Gaetano Raffaele

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

parent ea78cfb9
...@@ -39,7 +39,7 @@ namespace grm ...@@ -39,7 +39,7 @@ namespace grm
{ {
for(auto& r : seg.m_Graph.m_Nodes) for(auto& r : seg.m_Graph.m_Nodes)
{ {
__int64 neighborhood[4]; NeighIDType neighborhood[4];
FOURNeighborhood(neighborhood, r->m_Id, width, height); FOURNeighborhood(neighborhood, r->m_Id, width, height);
for(short j = 0; j < 4; ++j) for(short j = 0; j < 4; ++j)
{ {
...@@ -53,7 +53,7 @@ namespace grm ...@@ -53,7 +53,7 @@ namespace grm
{ {
for(auto& r : seg.m_Graph.m_Nodes) for(auto& r : seg.m_Graph.m_Nodes)
{ {
__int64 neighborhood[8]; NeighIDType neighborhood[8];
EIGHTNeighborhood(neighborhood, r->m_Id, width, height); EIGHTNeighborhood(neighborhood, r->m_Id, width, height);
bool haveNeighbors = false; bool haveNeighbors = false;
for(short j = 0; j < 8; ++j) for(short j = 0; j < 8; ++j)
......
...@@ -20,16 +20,22 @@ ...@@ -20,16 +20,22 @@
#include <cstddef> #include <cstddef>
#if defined(_WIN32)
typedef __int64 NeighIDType;
#else
typedef long unsigned int NeighIDType;
#endif
enum CONNECTIVITY{FOUR = 0, EIGHT}; enum CONNECTIVITY{FOUR = 0, EIGHT};
namespace grm namespace grm
{ {
void FOURNeighborhood(__int64 * neighborhood, void FOURNeighborhood(NeighIDType * neighborhood,
const std::size_t id, const std::size_t id,
const unsigned int width, const unsigned int width,
const unsigned int height); const unsigned int height);
void EIGHTNeighborhood(__int64 * neighborhood, void EIGHTNeighborhood(NeighIDType * neighborhood,
const std::size_t id, const std::size_t id,
const unsigned int width, const unsigned int width,
const unsigned int height); const unsigned int height);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace grm namespace grm
{ {
void FOURNeighborhood(__int64 * neighborhood, void FOURNeighborhood(NeighIDType * neighborhood,
const std::size_t id, const std::size_t id,
const unsigned int width, const unsigned int width,
const unsigned int height) const unsigned int height)
...@@ -40,7 +40,7 @@ namespace grm ...@@ -40,7 +40,7 @@ namespace grm
neighborhood[3] = ( x > 0 ? (id - 1) : -1 ); neighborhood[3] = ( x > 0 ? (id - 1) : -1 );
} }
void EIGHTNeighborhood(__int64 * neighborhood, void EIGHTNeighborhood(NeighIDType * neighborhood,
const std::size_t id, const std::size_t id,
const unsigned int width, const unsigned int width,
const unsigned int height) const unsigned int height)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment