Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
d32f8ed4
Commit
d32f8ed4
authored
Jul 16, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(QExifImageHeader): clean compilation warnings
parent
2987cdd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
32 deletions
+23
-32
QExifImageHeader.cpp
src/utils/QExifImageHeader.cpp
+19
-28
QExifImageHeader.h
src/utils/QExifImageHeader.h
+3
-3
Utils.hpp
src/utils/Utils.hpp
+1
-1
No files found.
src/utils/QExifImageHeader.cpp
View file @
d32f8ed4
...
@@ -41,8 +41,6 @@
...
@@ -41,8 +41,6 @@
// This file was copied from Qt Extended 4.5
// This file was copied from Qt Extended 4.5
#include "QExifImageHeader.h"
#include <QFile>
#include <QFile>
#include <QImage>
#include <QImage>
#include <QDataStream>
#include <QDataStream>
...
@@ -51,6 +49,10 @@
...
@@ -51,6 +49,10 @@
#include <QtDebug>
#include <QtDebug>
#include <QTextCodec>
#include <QTextCodec>
#include "Utils.hpp"
#include "QExifImageHeader.h"
/*!
/*!
\typedef QExifSRational
\typedef QExifSRational
...
@@ -484,19 +486,18 @@ QString QExifValue::toString () const {
...
@@ -484,19 +486,18 @@ QString QExifValue::toString () const {
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
"JIS X 0208"
);
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
"JIS X 0208"
);
if
(
codec
)
if
(
codec
)
return
codec
->
toUnicode
(
string
);
return
codec
->
toUnicode
(
string
);
}
}
break
;
break
;
case
UnicodeEncoding
:
{
case
UnicodeEncoding
:
{
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
"UTF-16"
);
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
"UTF-16"
);
if
(
codec
)
if
(
codec
)
return
codec
->
toUnicode
(
string
);
return
codec
->
toUnicode
(
string
);
}
}
UTILS_NO_BREAK
;
case
UndefinedEncoding
:
case
UndefinedEncoding
:
return
QString
::
fromLocal8Bit
(
string
.
constData
(),
string
.
length
());
return
QString
::
fromLocal8Bit
(
string
.
constData
(),
string
.
length
());
default:
default:
break
;
break
;
}
}
}
}
UTILS_NO_BREAK
;
default:
default:
return
QString
();
return
QString
();
}
}
...
@@ -1025,27 +1026,17 @@ quint32 QExifImageHeader::sizeOf (const QExifValue &value) const {
...
@@ -1025,27 +1026,17 @@ quint32 QExifImageHeader::sizeOf (const QExifValue &value) const {
switch
(
value
.
type
())
{
switch
(
value
.
type
())
{
case
QExifValue
:
:
Byte
:
case
QExifValue
:
:
Byte
:
case
QExifValue
:
:
Undefined
:
case
QExifValue
:
:
Undefined
:
return
value
.
count
()
>
4
return
value
.
count
()
>
4
?
12
+
value
.
count
()
:
12
;
?
12
+
value
.
count
()
:
12
;
case
QExifValue
:
:
Ascii
:
case
QExifValue
:
:
Ascii
:
return
value
.
count
()
>
4
return
value
.
count
()
>
4
?
12
+
value
.
count
()
:
12
;
?
12
+
value
.
count
()
:
12
;
case
QExifValue
:
:
Short
:
case
QExifValue
:
:
Short
:
return
value
.
count
()
>
2
return
value
.
count
()
>
2
?
static_cast
<
quint32
>
(
12
+
value
.
count
()
*
sizeof
(
quint16
))
:
12
;
?
12
+
value
.
count
()
*
sizeof
(
quint16
)
:
12
;
case
QExifValue
:
:
Long
:
case
QExifValue
:
:
Long
:
case
QExifValue
:
:
SignedLong
:
case
QExifValue
:
:
SignedLong
:
return
value
.
count
()
>
1
return
value
.
count
()
>
1
?
static_cast
<
quint32
>
(
12
+
value
.
count
()
*
sizeof
(
quint32
))
:
12
;
?
12
+
value
.
count
()
*
sizeof
(
quint32
)
:
12
;
case
QExifValue
:
:
Rational
:
case
QExifValue
:
:
Rational
:
case
QExifValue
:
:
SignedRational
:
case
QExifValue
:
:
SignedRational
:
return
value
.
count
()
>
0
return
value
.
count
()
>
0
?
static_cast
<
quint32
>
(
12
+
value
.
count
()
*
sizeof
(
quint32
)
*
2
)
:
12
;
?
12
+
value
.
count
()
*
sizeof
(
quint32
)
*
2
:
12
;
default:
default:
return
0
;
return
0
;
}
}
...
@@ -1471,7 +1462,7 @@ QMap<T, QExifValue> QExifImageHeader::readIfdValues (
...
@@ -1471,7 +1462,7 @@ QMap<T, QExifValue> QExifImageHeader::readIfdValues (
bool
QExifImageHeader
::
read
(
QIODevice
*
device
)
{
bool
QExifImageHeader
::
read
(
QIODevice
*
device
)
{
clear
();
clear
();
int
startPos
=
device
->
pos
(
);
int
startPos
=
static_cast
<
int
>
(
device
->
pos
()
);
QDataStream
stream
(
device
);
QDataStream
stream
(
device
);
...
@@ -1590,7 +1581,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
...
@@ -1590,7 +1581,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
}
else
{
stream
<<
offset
;
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
quint16
);
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
quint16
)
);
}
}
break
;
break
;
case
QExifValue
:
:
Long
:
case
QExifValue
:
:
Long
:
...
@@ -1601,7 +1592,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
...
@@ -1601,7 +1592,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
}
else
{
stream
<<
offset
;
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
quint32
);
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
quint32
)
);
}
}
break
;
break
;
case
QExifValue
:
:
SignedLong
:
case
QExifValue
:
:
SignedLong
:
...
@@ -1612,7 +1603,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
...
@@ -1612,7 +1603,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
}
else
{
stream
<<
offset
;
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
qint32
);
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
qint32
)
);
}
}
break
;
break
;
case
QExifValue
:
:
Rational
:
case
QExifValue
:
:
Rational
:
...
@@ -1621,7 +1612,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
...
@@ -1621,7 +1612,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
}
else
{
stream
<<
offset
;
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
quint32
)
*
2
;
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
quint32
)
*
2
)
;
}
}
break
;
break
;
case
QExifValue
:
:
SignedRational
:
case
QExifValue
:
:
SignedRational
:
...
@@ -1630,7 +1621,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
...
@@ -1630,7 +1621,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
}
else
{
stream
<<
offset
;
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
qint32
)
*
2
;
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
qint32
)
*
2
)
;
}
}
break
;
break
;
default:
default:
...
@@ -1739,7 +1730,7 @@ qint64 QExifImageHeader::write (QIODevice *device) const {
...
@@ -1739,7 +1730,7 @@ qint64 QExifImageHeader::write (QIODevice *device) const {
device
->
write
(
"
\x00\x00\x00\x08
"
,
4
);
device
->
write
(
"
\x00\x00\x00\x08
"
,
4
);
}
}
quint16
count
=
d
->
imageIfdValues
.
count
()
+
1
;
quint16
count
=
static_cast
<
quint16
>
(
d
->
imageIfdValues
.
count
()
+
1
)
;
quint32
offset
=
26
;
quint32
offset
=
26
;
if
(
!
d
->
gpsIfdValues
.
isEmpty
())
{
if
(
!
d
->
gpsIfdValues
.
isEmpty
())
{
...
...
src/utils/QExifImageHeader.h
View file @
d32f8ed4
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
// This file was copied from Qt Extended 4.5
// This file was copied from Qt Extended 4.5
#ifndef QEXIFIMAGEHEADER_H
#ifndef QEXIFIMAGEHEADER_H
_
#define QEXIFIMAGEHEADER_H
#define QEXIFIMAGEHEADER_H
_
#include <QPair>
#include <QPair>
#include <QVector>
#include <QVector>
...
@@ -333,4 +333,4 @@ private:
...
@@ -333,4 +333,4 @@ private:
QExifImageHeaderPrivate
*
d
;
QExifImageHeaderPrivate
*
d
;
};
};
#endif // ifndef QEXIFIMAGEHEADER_H
#endif // ifndef QEXIFIMAGEHEADER_H
_
src/utils/Utils.hpp
View file @
d32f8ed4
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
// =============================================================================
// =============================================================================
/*
/*
* Define telling
G
++ that a 'break' statement has been deliberately omitted
* Define telling
g
++ that a 'break' statement has been deliberately omitted
* in switch block.
* in switch block.
*/
*/
#ifndef UTILS_NO_BREAK
#ifndef UTILS_NO_BREAK
...
...
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