Skip to content

Commit 8c7d29e

Browse files
committed
more minor changes to fix -Wunused-function warning on Apple platforms
1 parent 94c58e7 commit 8c7d29e

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

modules/imgproc/src/drawing.cpp

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,13 +1124,15 @@ static inline uint16_t opencvLittleToHost16(const uchar* p){
11241124
#endif
11251125
}
11261126

1127+
/*
11271128
static inline uint16_t opencvLittleToHost16(uint16_t x){
11281129
#if OPENCV_LITTLEENDIAN
11291130
return x;
11301131
#else
1131-
return opencvLittleToHost16((uchar*)&x);
1132+
return opencvLittleToHost16((const uchar*)&x);
11321133
#endif
11331134
}
1135+
*/
11341136

11351137
static inline uint32_t opencvLittleToHost32(const uchar* p){
11361138
#if OPENCV_BYTEORDER==1234
@@ -1156,7 +1158,7 @@ static inline uint32_t opencvLittleToHost32(uint32_t x){
11561158
#if OPENCV_LITTLEENDIAN
11571159
return x;
11581160
#else
1159-
return opencvLittleToHost32((uchar*)&x);
1161+
return opencvLittleToHost32((const uchar*)&x);
11601162
#endif
11611163
}
11621164

@@ -1386,7 +1388,7 @@ static inline void ICV_HLINE_2(uchar* ptr, int xl, int xr, const uchar* color)
13861388
{
13871389
if (is_aligned(((uchar*)(ptr) + (xl)*2), 0x2))
13881390
{
1389-
uint16_t c = opencvLittleToHost16((uchar*)(color));
1391+
uint16_t c = opencvLittleToHost16(color);
13901392
uint16_t* hline_ptr = (uint16_t*)(ptr) + xl;
13911393
uint16_t* hline_max_ptr = (uint16_t*)(ptr) + xr;
13921394
for( ; hline_ptr <= hline_max_ptr; )
@@ -1467,7 +1469,7 @@ static inline void ICV_HLINE_4(uchar* ptr, int xl, int xr, const uchar* color)
14671469
{
14681470
if (is_aligned(((uchar*)(ptr) + (xl)*4), 0x4))
14691471
{
1470-
uint32_t c = opencvLittleToHost32((uchar*)(color));
1472+
uint32_t c = opencvLittleToHost32(color);
14711473
uint32_t* hline_ptr = (uint32_t*)(ptr) + xl;
14721474
uint32_t* hline_max_ptr = (uint32_t*)(ptr) + xr;
14731475
for( ; hline_ptr <= hline_max_ptr; )
@@ -1560,8 +1562,8 @@ static inline void ICV_HLINE_8(uchar* ptr, int xl, int xr, const uchar* color)
15601562
}
15611563
else if (is_aligned(((uchar*)(ptr) + (xl)*8), 0x4))
15621564
{
1563-
uint32_t c[2] = {opencvLittleToHost32((uchar*)(color)+0x00),
1564-
opencvLittleToHost32((uchar*)(color)+0x04)};
1565+
uint32_t c[2] = {opencvLittleToHost32(color+0x00),
1566+
opencvLittleToHost32(color+0x04)};
15651567
uint32_t* hline_ptr = (uint32_t*)((uchar*)(ptr) + (xl)*(8));
15661568
uint32_t* hline_max_ptr = (uint32_t*)((uchar*)(ptr) + (xr)*(8));
15671569
for( ; hline_ptr <= hline_max_ptr; )
@@ -1577,13 +1579,14 @@ static inline void ICV_HLINE_8(uchar* ptr, int xl, int xr, const uchar* color)
15771579
}
15781580
//end ICV_HLINE_8()
15791581

1582+
/*
15801583
static inline void ICV_HLINE_12(uchar* ptr, int xl, int xr, const uchar* color)
15811584
{
15821585
if (is_aligned(((uchar*)(ptr) + (xl)*12), 0x4))
15831586
{
1584-
uint32_t c[3] = {opencvLittleToHost32((uchar*)(color)+0x00),
1585-
opencvLittleToHost32((uchar*)(color)+0x04),
1586-
opencvLittleToHost32((uchar*)(color)+0x08)};
1587+
uint32_t c[3] = {opencvLittleToHost32(color+0x00),
1588+
opencvLittleToHost32(color+0x04),
1589+
opencvLittleToHost32(color+0x08)};
15871590
uint32_t* hline_ptr = (uint32_t*)((uchar*)(ptr) + (xl)*(12));
15881591
uint32_t* hline_max_ptr = (uint32_t*)((uchar*)(ptr) + (xr)*(12));
15891592
for( ; hline_ptr <= hline_max_ptr; )
@@ -1616,10 +1619,10 @@ static inline void ICV_HLINE_16(uchar* ptr, int xl, int xr, const uchar* color)
16161619
}
16171620
else if (is_aligned(((uchar*)(ptr) + (xl)*16), 0x4))
16181621
{
1619-
uint32_t c[4] = {opencvLittleToHost32((uchar*)(color)+0x00),
1620-
opencvLittleToHost32((uchar*)(color)+0x04),
1621-
opencvLittleToHost32((uchar*)(color)+0x08),
1622-
opencvLittleToHost32((uchar*)(color)+0x0C)};
1622+
uint32_t c[4] = {opencvLittleToHost32(color+0x00),
1623+
opencvLittleToHost32(color+0x04),
1624+
opencvLittleToHost32(color+0x08),
1625+
opencvLittleToHost32(color+0x0C)};
16231626
uint32_t* hline_ptr = (uint32_t*)((uchar*)(ptr) + (xl)*(16));
16241627
uint32_t* hline_max_ptr = (uint32_t*)((uchar*)(ptr) + (xr)*(16));
16251628
for( ; hline_ptr <= hline_max_ptr; )
@@ -1655,12 +1658,12 @@ static inline void ICV_HLINE_24(uchar* ptr, int xl, int xr, const uchar* color)
16551658
}
16561659
else if (is_aligned(((uchar*)(ptr) + (xl)*24), 0x4))
16571660
{
1658-
uint32_t c[6] = {opencvLittleToHost32((uchar*)(color)+0x00),
1659-
opencvLittleToHost32((uchar*)(color)+0x04),
1660-
opencvLittleToHost32((uchar*)(color)+0x08),
1661-
opencvLittleToHost32((uchar*)(color)+0x0C),
1662-
opencvLittleToHost32((uchar*)(color)+0x10),
1663-
opencvLittleToHost32((uchar*)(color)+0x14)};
1661+
uint32_t c[6] = {opencvLittleToHost32(color+0x00),
1662+
opencvLittleToHost32(color+0x04),
1663+
opencvLittleToHost32(color+0x08),
1664+
opencvLittleToHost32(color+0x0C),
1665+
opencvLittleToHost32(color+0x10),
1666+
opencvLittleToHost32(color+0x14)};
16641667
uint32_t* hline_ptr = (uint32_t*)((uchar*)(ptr) + (xl)*(24));
16651668
uint32_t* hline_max_ptr = (uint32_t*)((uchar*)(ptr) + (xr)*(24));
16661669
for( ; hline_ptr <= hline_max_ptr; )
@@ -1700,14 +1703,14 @@ static inline void ICV_HLINE_32(uchar* ptr, int xl, int xr, const uchar* color)
17001703
}
17011704
else if (is_aligned(((uchar*)(ptr) + (xl)*2324), 0x4))
17021705
{
1703-
uint32_t c[8] = {opencvLittleToHost32((uchar*)(color)+0x00),
1704-
opencvLittleToHost32((uchar*)(color)+0x04),
1705-
opencvLittleToHost32((uchar*)(color)+0x08),
1706-
opencvLittleToHost32((uchar*)(color)+0x0C),
1707-
opencvLittleToHost32((uchar*)(color)+0x10),
1708-
opencvLittleToHost32((uchar*)(color)+0x14),
1709-
opencvLittleToHost32((uchar*)(color)+0x18),
1710-
opencvLittleToHost32((uchar*)(color)+0x1C)};
1706+
uint32_t c[8] = {opencvLittleToHost32(color+0x00),
1707+
opencvLittleToHost32(color+0x04),
1708+
opencvLittleToHost32(color+0x08),
1709+
opencvLittleToHost32(color+0x0C),
1710+
opencvLittleToHost32(color+0x10),
1711+
opencvLittleToHost32(color+0x14),
1712+
opencvLittleToHost32(color+0x18),
1713+
opencvLittleToHost32(color+0x1C)};
17111714
uint32_t* hline_ptr = (uint32_t*)((uchar*)(ptr) + (xl)*(32));
17121715
uint32_t* hline_max_ptr = (uint32_t*)((uchar*)(ptr) + (xr)*(32));
17131716
for( ; hline_ptr <= hline_max_ptr; )
@@ -1728,6 +1731,7 @@ static inline void ICV_HLINE_32(uchar* ptr, int xl, int xr, const uchar* color)
17281731
}
17291732
}
17301733
//end ICV_HLINE_32()
1734+
*/
17311735

17321736
static const bool ICV_HLINE_OPTIMIZATION = true;
17331737
static inline void ICV_HLINE(uchar* ptr, int xl, int xr, const void* color, int pix_size)

0 commit comments

Comments
 (0)