Fixed ~20 potential errors identified by the MS complier.

This commit is contained in:
Andrey Kamaev
2012-03-31 11:09:16 +00:00
parent 1e5a600d13
commit 72f2523d0f
15 changed files with 150 additions and 133 deletions

View File

@@ -336,10 +336,18 @@ CvLSH* cvCreateLSH(CvLSHOperations* ops, int d, int L, int k, int type, double r
if (type != CV_32FC1 && type != CV_64FC1)
CV_Error(CV_StsUnsupportedFormat, "vectors must be either CV_32FC1 or CV_64FC1");
lsh = new CvLSH;
lsh->type = type;
switch (type) {
case CV_32FC1: lsh->u.lsh_32f = new lsh_pstable_l2_32f(ops, d, L, k, r, rng); break;
case CV_64FC1: lsh->u.lsh_64f = new lsh_pstable_l2_64f(ops, d, L, k, r, rng); break;
try
{
lsh->type = type;
switch (type) {
case CV_32FC1: lsh->u.lsh_32f = new lsh_pstable_l2_32f(ops, d, L, k, r, rng); break;
case CV_64FC1: lsh->u.lsh_64f = new lsh_pstable_l2_64f(ops, d, L, k, r, rng); break;
}
}
catch(...)
{
delete lsh;
throw;
}
return lsh;