Commit 2609e77a authored by Olexa Bilaniuk's avatar Olexa Bilaniuk

Silence spurious loss-of-data warnings from Windows.

Added explicit casts to silence warnings in fundam.cpp and rhorefc.cpp.
parent ce0570b7
...@@ -332,12 +332,12 @@ static bool createAndRunRHORegistrator(double confidence, ...@@ -332,12 +332,12 @@ static bool createAndRunRHORegistrator(double confidence,
(const float*)src.data, (const float*)src.data,
(const float*)dst.data, (const float*)dst.data,
(char*) tempMask.data, (char*) tempMask.data,
npoints, (unsigned) npoints,
ransacReprojThreshold, (float) ransacReprojThreshold,
maxIters, (unsigned) maxIters,
maxIters, (unsigned) maxIters,
confidence, confidence,
4, 4U,
beta, beta,
RHO_FLAG_ENABLE_NR | RHO_FLAG_ENABLE_FINAL_REFINEMENT, RHO_FLAG_ENABLE_NR | RHO_FLAG_ENABLE_FINAL_REFINEMENT,
NULL, NULL,
......
...@@ -412,7 +412,7 @@ static inline void* almalloc(size_t nBytes){ ...@@ -412,7 +412,7 @@ static inline void* almalloc(size_t nBytes){
if(ptr){ if(ptr){
unsigned char* adj = (unsigned char*)(((intptr_t)(ptr+MEM_ALIGN))&((intptr_t)(-MEM_ALIGN))); unsigned char* adj = (unsigned char*)(((intptr_t)(ptr+MEM_ALIGN))&((intptr_t)(-MEM_ALIGN)));
ptrdiff_t diff = adj - ptr; ptrdiff_t diff = adj - ptr;
adj[-1] = diff - 1; adj[-1] = (unsigned char)(diff - 1);
return adj; return adj;
} }
} }
...@@ -735,7 +735,7 @@ static inline void sacPROSACGoToNextPhase(RHO_HEST_REFC* p){ ...@@ -735,7 +735,7 @@ static inline void sacPROSACGoToNextPhase(RHO_HEST_REFC* p){
p->ctrl.phNum++; p->ctrl.phNum++;
next = (p->ctrl.phEndFpI * p->ctrl.phNum)/(p->ctrl.phNum - m); next = (p->ctrl.phEndFpI * p->ctrl.phNum)/(p->ctrl.phNum - m);
p->ctrl.phEndI += ceil(next - p->ctrl.phEndFpI); p->ctrl.phEndI += (unsigned)ceil(next - p->ctrl.phEndFpI);
p->ctrl.phEndFpI = next; p->ctrl.phEndFpI = next;
} }
...@@ -913,7 +913,7 @@ static inline void sacEvaluateModelSPRT(RHO_HEST_REFC* p){ ...@@ -913,7 +913,7 @@ static inline void sacEvaluateModelSPRT(RHO_HEST_REFC* p){
float reprojX=H[0]*x+H[1]*y+H[2]; /* ( X_1 ) ( H_11 H_12 H_13 ) (x_1) */ float reprojX=H[0]*x+H[1]*y+H[2]; /* ( X_1 ) ( H_11 H_12 H_13 ) (x_1) */
float reprojY=H[3]*x+H[4]*y+H[5]; /* ( X_2 ) = ( H_21 H_22 H_23 ) (x_2) */ float reprojY=H[3]*x+H[4]*y+H[5]; /* ( X_2 ) = ( H_21 H_22 H_23 ) (x_2) */
float reprojZ=H[6]*x+H[7]*y+1.0; /* ( X_3 ) ( H_31 H_32 H_33=1.0 ) (x_3 = 1.0) */ float reprojZ=H[6]*x+H[7]*y+1.0f; /* ( X_3 ) ( H_31 H_32 H_33=1.0 ) (x_3 = 1.0) */
/* reproj is in homogeneous coordinates. To bring back to "regular" coordinates, divide by Z. */ /* reproj is in homogeneous coordinates. To bring back to "regular" coordinates, divide by Z. */
reprojX/=reprojZ; reprojX/=reprojZ;
...@@ -929,7 +929,7 @@ static inline void sacEvaluateModelSPRT(RHO_HEST_REFC* p){ ...@@ -929,7 +929,7 @@ static inline void sacEvaluateModelSPRT(RHO_HEST_REFC* p){
/* ... */ /* ... */
isInlier = reprojDist <= distSq; isInlier = reprojDist <= distSq;
p->curr.numInl += isInlier; p->curr.numInl += isInlier;
*inl++ = isInlier; *inl++ = (char)isInlier;
/* SPRT */ /* SPRT */
...@@ -1098,7 +1098,7 @@ static inline void sacInitNonRand(double beta, ...@@ -1098,7 +1098,7 @@ static inline void sacInitNonRand(double beta,
for(; n < N; n++){ for(; n < N; n++){
double mu = n * beta; double mu = n * beta;
double sigma = sqrt(n)* beta_beta1_sq_chi; double sigma = sqrt(n)* beta_beta1_sq_chi;
unsigned i_min = ceil(m + mu + sigma); unsigned i_min = (unsigned)ceil(m + mu + sigma);
nonRandMinInl[n] = i_min; nonRandMinInl[n] = i_min;
} }
...@@ -1234,7 +1234,7 @@ static inline void sacRndSmpl(unsigned sampleSize, ...@@ -1234,7 +1234,7 @@ static inline void sacRndSmpl(unsigned sampleSize,
int inList; int inList;
do{ do{
currentSample[i]=dataSetSize*sacRandom(); currentSample[i] = (unsigned)(dataSetSize*sacRandom());
inList=0; inList=0;
for(j=0;j<i;j++){ for(j=0;j<i;j++){
...@@ -1309,7 +1309,7 @@ static inline unsigned sacCalcIterBound(double confidence, ...@@ -1309,7 +1309,7 @@ static inline unsigned sacCalcIterBound(double confidence,
* numIterations (the return value) into * numIterations (the return value) into
*/ */
retVal = ceil(log(1.-confidence)/log(atLeastOneOutlierProbability)); retVal = (unsigned)ceil(log(1.-confidence)/log(atLeastOneOutlierProbability));
} }
/** /**
...@@ -1875,7 +1875,7 @@ static inline int sacChol8x8Damped(const float (*A)[8], ...@@ -1875,7 +1875,7 @@ static inline int sacChol8x8Damped(const float (*A)[8],
for(k=0;k<j;k++){ for(k=0;k<j;k++){
x -= (double)L[i][k] * L[j][k];/* - Sum_{k=0..j-1} Lik*Ljk */ x -= (double)L[i][k] * L[j][k];/* - Sum_{k=0..j-1} Lik*Ljk */
} }
L[i][j] = x / L[j][j]; /* Lij = ... / Ljj */ L[i][j] = (float)(x / L[j][j]); /* Lij = ... / Ljj */
} }
/* Diagonal element */ /* Diagonal element */
...@@ -1887,7 +1887,7 @@ static inline int sacChol8x8Damped(const float (*A)[8], ...@@ -1887,7 +1887,7 @@ static inline int sacChol8x8Damped(const float (*A)[8],
if(x<0){ if(x<0){
return 0; return 0;
} }
L[j][j] = sqrt(x); /* Ljj = sqrt( ... ) */ L[j][j] = (float)sqrt(x); /* Ljj = sqrt( ... ) */
} }
} }
......
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