mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 19:44:14 +08:00
Fixed some mingw-w64 compilation issues
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifndef _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -73,7 +73,7 @@ void split(const string &s, vector<string> &elems, char delim)
|
|||||||
|
|
||||||
void createDirectory(const string &path)
|
void createDirectory(const string &path)
|
||||||
{
|
{
|
||||||
#ifdef __GNUC__
|
#ifndef _WIN32
|
||||||
mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
||||||
#else
|
#else
|
||||||
mkdir(path.c_str());
|
mkdir(path.c_str());
|
||||||
@@ -82,7 +82,7 @@ void createDirectory(const string &path)
|
|||||||
|
|
||||||
void getDirList(const string &dirName, vector<string> &fileNames)
|
void getDirList(const string &dirName, vector<string> &fileNames)
|
||||||
{
|
{
|
||||||
#ifdef __GNUC__
|
#ifndef _WIN32
|
||||||
struct dirent **namelist;
|
struct dirent **namelist;
|
||||||
int n = scandir(dirName.c_str(), &namelist, NULL, alphasort);
|
int n = scandir(dirName.c_str(), &namelist, NULL, alphasort);
|
||||||
for (int i=0; i<n; ++i)
|
for (int i=0; i<n; ++i)
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
#ifndef __OPENCV_BITARRAY_HPP
|
#ifndef __OPENCV_BITARRAY_HPP
|
||||||
#define __OPENCV_BITARRAY_HPP
|
#define __OPENCV_BITARRAY_HPP
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
#pragma warning( disable : 4267 )
|
#pragma warning( disable : 4267 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
# include <intrin.h>
|
# include <intrin.h>
|
||||||
# define popcnt __popcnt
|
# define popcnt __popcnt
|
||||||
# pragma warning( disable : 4267 )
|
# pragma warning( disable : 4267 )
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#ifndef __OPENCV_PRECOMP_H__
|
#ifndef __OPENCV_PRECOMP_H__
|
||||||
#define __OPENCV_PRECOMP_H__
|
#define __OPENCV_PRECOMP_H__
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
#pragma warning( disable : 4267 )
|
#pragma warning( disable : 4267 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@
|
|||||||
#ifndef __OPENCV_TYPES_HPP
|
#ifndef __OPENCV_TYPES_HPP
|
||||||
#define __OPENCV_TYPES_HPP
|
#define __OPENCV_TYPES_HPP
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
#pragma warning( disable : 4267 )
|
#pragma warning( disable : 4267 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -425,14 +425,14 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
|
|||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
// select the first node
|
// select the first node
|
||||||
long idx = reinterpret_cast<long>(node->data)-1, dn=0;
|
size_t idx = reinterpret_cast<size_t>(node->data)-1, dn=0;
|
||||||
int dup = (int)node->key-1;
|
int dup = (int)node->key-1;
|
||||||
long minIdxD = idx;
|
size_t minIdxD = idx;
|
||||||
float minDist = distances[idx];
|
float minDist = distances[idx];
|
||||||
|
|
||||||
while ( node )
|
while ( node )
|
||||||
{
|
{
|
||||||
idx = reinterpret_cast<long>(node->data)-1;
|
idx = reinterpret_cast<size_t>(node->data)-1;
|
||||||
|
|
||||||
if (distances[idx] < minDist)
|
if (distances[idx] < minDist)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user