Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ef3d0221
Commit
ef3d0221
authored
Oct 17, 2014
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing iOS clang warnings, part 2
parent
d3821e8c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
29 deletions
+31
-29
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+2
-2
parallel.cpp
modules/core/src/parallel.cpp
+1
-1
persistence.cpp
modules/core/src/persistence.cpp
+2
-2
haar.cpp
modules/objdetect/src/haar.cpp
+1
-1
cap_avfoundation.mm
modules/videoio/src/cap_avfoundation.mm
+20
-20
cap_ios_abstract_camera.mm
modules/videoio/src/cap_ios_abstract_camera.mm
+2
-0
cap_ios_video_camera.mm
modules/videoio/src/cap_ios_video_camera.mm
+2
-2
iOS.cmake
platforms/ios/cmake/Modules/Platform/iOS.cmake
+1
-1
No files found.
cmake/OpenCVUtils.cmake
View file @
ef3d0221
...
...
@@ -249,9 +249,9 @@ macro(add_apple_compiler_options the_module)
if
(
"
${
source
}
"
MATCHES
"
\\
.mm$"
)
get_source_file_property
(
flags
"
${
source
}
"
COMPILE_FLAGS
)
if
(
flags
)
set
(
flags
"
${
_flags
}
-fobjc-exceptions"
)
set
(
flags
"
${
_flags
}
-fobjc-exceptions
-Wno-semicolon-before-method-body
"
)
else
()
set
(
flags
"-fobjc-exceptions"
)
set
(
flags
"-fobjc-exceptions
-Wno-semicolon-before-method-body
"
)
endif
()
set_source_files_properties
(
"
${
source
}
"
PROPERTIES COMPILE_FLAGS
"
${
flags
}
"
)
...
...
modules/core/src/parallel.cpp
View file @
ef3d0221
...
...
@@ -177,7 +177,7 @@ namespace
static
void
block_function
(
void
*
context
,
size_t
index
)
{
ProxyLoopBody
*
ptr_body
=
static_cast
<
ProxyLoopBody
*>
(
context
);
(
*
ptr_body
)(
cv
::
Range
(
index
,
index
+
1
));
(
*
ptr_body
)(
cv
::
Range
(
(
int
)
index
,
(
int
)
index
+
1
));
}
#elif defined HAVE_CONCURRENCY
class
ProxyLoopBody
:
public
ParallelLoopBodyWrapper
...
...
modules/core/src/persistence.cpp
View file @
ef3d0221
...
...
@@ -1177,7 +1177,7 @@ force_int:
int
val
,
is_hex
=
d
==
'x'
;
c
=
ptr
[
3
];
ptr
[
3
]
=
'\0'
;
val
=
strtol
(
ptr
+
is_hex
,
&
endptr
,
is_hex
?
8
:
16
);
val
=
(
int
)
strtol
(
ptr
+
is_hex
,
&
endptr
,
is_hex
?
8
:
16
);
ptr
[
3
]
=
c
;
if
(
endptr
==
ptr
+
is_hex
)
buf
[
len
++
]
=
'x'
;
...
...
@@ -2787,7 +2787,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
// find the last occurence of </opencv_storage>
for
(;;)
{
int
line_offset
=
ftell
(
fs
->
file
);
int
line_offset
=
(
int
)
ftell
(
fs
->
file
);
char
*
ptr0
=
icvGets
(
fs
,
xml_buf
,
xml_buf_size
),
*
ptr
;
if
(
!
ptr0
)
break
;
...
...
modules/objdetect/src/haar.cpp
View file @
ef3d0221
...
...
@@ -1979,7 +1979,7 @@ cvLoadHaarClassifierCascade( const char* directory, CvSize orig_window_size )
if
(
!
f
)
CV_Error
(
CV_StsError
,
""
);
fseek
(
f
,
0
,
SEEK_END
);
size
=
ftell
(
f
);
size
=
(
int
)
ftell
(
f
);
fseek
(
f
,
0
,
SEEK_SET
);
size_t
elements_read
=
fread
(
ptr
,
1
,
size
,
f
);
CV_Assert
(
elements_read
==
(
size_t
)(
size
));
...
...
modules/videoio/src/cap_avfoundation.mm
View file @
ef3d0221
...
...
@@ -711,26 +711,26 @@ fromConnection:(AVCaptureConnection *)connection{
memcpy(imagedata, baseaddress, currSize);
if (image == NULL) {
image = cvCreateImageHeader(cvSize(
width,
height), IPL_DEPTH_8U, 4);
image = cvCreateImageHeader(cvSize(
(int)width,(int)
height), IPL_DEPTH_8U, 4);
}
image->width =width;
image->height = height;
image->width =
(int)
width;
image->height =
(int)
height;
image->nChannels = 4;
image->depth = IPL_DEPTH_8U;
image->widthStep = (int)rowBytes;
image->imageData = imagedata;
image->imageSize = currSize;
image->imageSize =
(int)
currSize;
if (bgr_image == NULL) {
bgr_image = cvCreateImageHeader(cvSize(
width,
height), IPL_DEPTH_8U, 3);
bgr_image = cvCreateImageHeader(cvSize(
(int)width,(int)
height), IPL_DEPTH_8U, 3);
}
bgr_image->width =width;
bgr_image->height = height;
bgr_image->width =
(int)
width;
bgr_image->height =
(int)
height;
bgr_image->nChannels = 3;
bgr_image->depth = IPL_DEPTH_8U;
bgr_image->widthStep = (int)rowBytes;
bgr_image->imageData = bgr_imagedata;
bgr_image->imageSize = currSize;
bgr_image->imageSize =
(int)
currSize;
cvCvtColor(image, bgr_image, CV_BGRA2BGR);
...
...
@@ -739,7 +739,7 @@ fromConnection:(AVCaptureConnection *)connection{
// iOS provides hardware accelerated rotation through AVCaptureConnection class
// I can't get it work.
if (bgr_image_r90 == NULL){
bgr_image_r90 = cvCreateImage(cvSize(
height,
width), IPL_DEPTH_8U, 3);
bgr_image_r90 = cvCreateImage(cvSize(
(int)height, (int)
width), IPL_DEPTH_8U, 3);
}
cvTranspose(bgr_image, bgr_image_r90);
cvFlip(bgr_image_r90, NULL, 1);
...
...
@@ -939,29 +939,29 @@ IplImage* CvCaptureFile::retrieveFramePixelBuffer() {
memcpy(imagedata, baseaddress, currSize);
if (image == NULL) {
image = cvCreateImageHeader(cvSize(
width,
height), IPL_DEPTH_8U, 4);
image = cvCreateImageHeader(cvSize(
(int)width,(int)
height), IPL_DEPTH_8U, 4);
}
image->width =width;
image->height = height;
image->width =
(int)
width;
image->height =
(int)
height;
image->nChannels = 4;
image->depth = IPL_DEPTH_8U;
image->widthStep = rowBytes;
image->widthStep =
(int)
rowBytes;
image->imageData = imagedata;
image->imageSize = currSize;
image->imageSize =
(int)
currSize;
if (bgr_image == NULL) {
bgr_image = cvCreateImageHeader(cvSize(
width,
height), IPL_DEPTH_8U, 3);
bgr_image = cvCreateImageHeader(cvSize(
(int)width,(int)
height), IPL_DEPTH_8U, 3);
}
bgr_image->width =width;
bgr_image->height = height;
bgr_image->width =
(int)
width;
bgr_image->height =
(int)
height;
bgr_image->nChannels = 3;
bgr_image->depth = IPL_DEPTH_8U;
bgr_image->widthStep = rowBytes;
bgr_image->widthStep =
(int)
rowBytes;
bgr_image->imageData = bgr_imagedata;
bgr_image->imageSize = currSize;
bgr_image->imageSize =
(int)
currSize;
cvCvtColor(image, bgr_image,CV_BGRA2BGR);
...
...
@@ -1262,7 +1262,7 @@ bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) {
// writer status check
if (![mMovieWriterInput isReadyForMoreMediaData] || mMovieWriter.status != AVAssetWriterStatusWriting ) {
NSLog(@"[mMovieWriterInput isReadyForMoreMediaData] Not ready for media data or ...");
NSLog(@"mMovieWriter.status: %d. Error: %@", mMovieWriter.status, [mMovieWriter.error localizedDescription]);
NSLog(@"mMovieWriter.status: %d. Error: %@",
(int)
mMovieWriter.status, [mMovieWriter.error localizedDescription]);
[localpool drain];
return false;
}
...
...
modules/videoio/src/cap_ios_abstract_camera.mm
View file @
ef3d0221
...
...
@@ -150,6 +150,7 @@
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
[super dealloc]
}
...
...
@@ -226,6 +227,7 @@
- (void)deviceOrientationDidChange:(NSNotification*)notification
{
(void)notification;
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
switch (orientation)
...
...
modules/videoio/src/cap_ios_video_camera.mm
View file @
ef3d0221
...
...
@@ -474,7 +474,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
// check if matrix data pointer or dimensions were changed by the delegate
bool iOSimage = false;
if (height ==
image.rows && width ==
image.cols && format_opencv == image.type() && bufferAddress == image.data && bytesPerRow == image.step) {
if (height ==
(size_t)image.rows && width == (size_t)
image.cols && format_opencv == image.type() && bufferAddress == image.data && bytesPerRow == image.step) {
iOSimage = true;
}
...
...
@@ -592,7 +592,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:[self videoFileURL]]) {
[library writeVideoAtPathToSavedPhotosAlbum:[self videoFileURL]
completionBlock:^(NSURL *assetURL, NSError *error){}];
completionBlock:^(NSURL *assetURL, NSError *error){
(void)assetURL; (void)error;
}];
}
}
...
...
platforms/ios/cmake/Modules/Platform/iOS.cmake
View file @
ef3d0221
...
...
@@ -44,7 +44,7 @@ set (CMAKE_CXX_FLAGS "-stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hi
set
(
CMAKE_CXX_FLAGS_RELEASE
"-DNDEBUG -O3 -fomit-frame-pointer -ffast-math"
)
# Silence some warnings
set
(
no_warn
"-Wno-
semicolon-before-method-body -Wno-
unused-function -Wno-unused-parameter -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-const-variable -Wno-overloaded-virtual"
)
set
(
no_warn
"-Wno-unused-function -Wno-unused-parameter -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-const-variable -Wno-overloaded-virtual"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
no_warn
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
no_warn
}
"
)
# Additional linker flag
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment