Skip to content

Commit ebc142b

Browse files
authored
Merge pull request #1623 from alalek:android_pack_fix_contrib
* android: fix build warnings * build: fix warnings
1 parent d6bbcd6 commit ebc142b

File tree

3 files changed

+21
-49
lines changed

3 files changed

+21
-49
lines changed

modules/bioinspired/src/retina_ocl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ bool RetinaOCLImpl::convertToColorPlanes(const UMat& input, UMat &output)
391391
else
392392
{
393393
CV_Error(-1, "Retina ocl only support 1, 3, 4 channel input");
394-
return false;
395394
}
396395
}
397396
void RetinaOCLImpl::convertToInterleaved(const UMat& input, bool colorMode, UMat &output)
@@ -449,8 +448,8 @@ void RetinaOCLImpl::getMagnoRAW(OutputArray retinaOutput_magno)
449448

450449
// unimplemented interfaces:
451450
void RetinaOCLImpl::applyFastToneMapping(InputArray /*inputImage*/, OutputArray /*outputToneMappedImage*/) { NOT_IMPLEMENTED; }
452-
const Mat RetinaOCLImpl::getMagnoRAW() const { NOT_IMPLEMENTED; return Mat(); }
453-
const Mat RetinaOCLImpl::getParvoRAW() const { NOT_IMPLEMENTED; return Mat(); }
451+
const Mat RetinaOCLImpl::getMagnoRAW() const { NOT_IMPLEMENTED; }
452+
const Mat RetinaOCLImpl::getParvoRAW() const { NOT_IMPLEMENTED; }
454453

455454
///////////////////////////////////////
456455
///////// BasicRetinaFilter ///////////

modules/surface_matching/src/hash_murmur86.hpp

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -78,59 +78,30 @@ void hashMurmurx86 ( const void * key, const int len, const uint seed, void * ou
7878
* ROTL32(x,r) Rotate x left by r bits
7979
*/
8080

81-
/* Convention is to define __BYTE_ORDER == to one of these values */
82-
#if !defined(__BIG_ENDIAN)
83-
#define __BIG_ENDIAN 4321
84-
#endif
85-
#if !defined(__LITTLE_ENDIAN)
86-
#define __LITTLE_ENDIAN 1234
87-
#endif
88-
89-
/* I386 */
90-
#if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(i386)
91-
#define __BYTE_ORDER __LITTLE_ENDIAN
92-
#define UNALIGNED_SAFE
93-
#endif
94-
95-
/* gcc 'may' define __LITTLE_ENDIAN__ or __BIG_ENDIAN__ to 1 (Note the trailing __),
96-
* or even _LITTLE_ENDIAN or _BIG_ENDIAN (Note the single _ prefix) */
97-
#if !defined(__BYTE_ORDER)
98-
#if defined(__LITTLE_ENDIAN__) && __LITTLE_ENDIAN__==1 || defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN==1
99-
#define __BYTE_ORDER __LITTLE_ENDIAN
100-
#elif defined(__BIG_ENDIAN__) && __BIG_ENDIAN__==1 || defined(_BIG_ENDIAN) && _BIG_ENDIAN==1
101-
#define __BYTE_ORDER __BIG_ENDIAN
102-
#endif
81+
#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(i386))
82+
# define UNALIGNED_SAFE 1
10383
#endif
10484

105-
/* gcc (usually) defines xEL/EB macros for ARM and MIPS endianess */
106-
#if !defined(__BYTE_ORDER)
107-
#if defined(__ARMEL__) || defined(__MIPSEL__)
108-
#define __BYTE_ORDER __LITTLE_ENDIAN
109-
#endif
110-
#if defined(__ARMEB__) || defined(__MIPSEB__)
111-
#define __BYTE_ORDER __BIG_ENDIAN
112-
#endif
85+
#ifndef UNALIGNED_SAFE
86+
# define UNALIGNED_SAFE 1
87+
#elif defined(UNALIGNED_SAFE) && !UNALIGNED_SAFE == 0
88+
# undef UNALIGNED_SAFE
11389
#endif
11490

11591
/* Now find best way we can to READ_UINT32 */
116-
#if __BYTE_ORDER==__LITTLE_ENDIAN
117-
/* CPU endian matches murmurhash algorithm, so read 32-bit word directly */
118-
#define READ_UINT32(ptr) (*((uint32_t*)(ptr)))
119-
#elif __BYTE_ORDER==__BIG_ENDIAN
120-
/* TODO: Add additional cases below where a compiler provided bswap32 is available */
121-
#if defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=3))
122-
#define READ_UINT32(ptr) (__builtin_bswap32(*((uint32_t*)(ptr))))
123-
#else
124-
/* Without a known fast bswap32 we're just as well off doing this */
125-
#define READ_UINT32(ptr) (ptr[0]|ptr[1]<<8|ptr[2]<<16|ptr[3]<<24)
126-
#define UNALIGNED_SAFE
92+
#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(i386)) \
93+
|| (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
94+
# define READ_UINT32(ptr) (*((uint32_t*)(ptr)))
95+
#elif (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
96+
&& defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=3))
97+
# define READ_UINT32(ptr) (__builtin_bswap32(*((uint32_t*)(ptr))))
12798
#endif
128-
#else
129-
/* Unknown endianess so last resort is to read individual bytes */
130-
#define READ_UINT32(ptr) (ptr[0]|ptr[1]<<8|ptr[2]<<16|ptr[3]<<24)
13199

132-
/* Since we're not doing word-reads we can skip the messing about with realignment */
133-
#define UNALIGNED_SAFE
100+
#ifndef READ_UINT32
101+
/* Unknown endianess so last resort is to read individual bytes */
102+
# define READ_UINT32(ptr) (ptr[0]|ptr[1]<<8|ptr[2]<<16|ptr[3]<<24)
103+
# undef UNALIGNED_SAFE
104+
# define UNALIGNED_SAFE 1
134105
#endif
135106

136107
/*-----------------------------------------------------------------------------

modules/ximgproc/src/selectivesearchsegmentation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ namespace cv {
5858
double rank;
5959
Rect bounding_box;
6060

61+
Region() : id(0), level(0), merged_to(0), rank(0) {}
62+
6163
friend std::ostream& operator<<(std::ostream& os, const Region& n);
6264

6365
bool operator <(const Region& n) const {

0 commit comments

Comments
 (0)