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 @@
// This file was copied from Qt Extended 4.5
#include "QExifImageHeader.h"
#include <QFile>
#include <QImage>
#include <QDataStream>
...
...
@@ -51,6 +49,10 @@
#include <QtDebug>
#include <QTextCodec>
#include "Utils.hpp"
#include "QExifImageHeader.h"
/*!
\typedef QExifSRational
...
...
@@ -484,19 +486,18 @@ QString QExifValue::toString () const {
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
"JIS X 0208"
);
if
(
codec
)
return
codec
->
toUnicode
(
string
);
}
break
;
}
break
;
case
UnicodeEncoding
:
{
QTextCodec
*
codec
=
QTextCodec
::
codecForName
(
"UTF-16"
);
if
(
codec
)
return
codec
->
toUnicode
(
string
);
}
}
UTILS_NO_BREAK
;
case
UndefinedEncoding
:
return
QString
::
fromLocal8Bit
(
string
.
constData
(),
string
.
length
());
default:
break
;
}
}
}
UTILS_NO_BREAK
;
default:
return
QString
();
}
...
...
@@ -1025,27 +1026,17 @@ quint32 QExifImageHeader::sizeOf (const QExifValue &value) const {
switch
(
value
.
type
())
{
case
QExifValue
:
:
Byte
:
case
QExifValue
:
:
Undefined
:
return
value
.
count
()
>
4
?
12
+
value
.
count
()
:
12
;
return
value
.
count
()
>
4
?
12
+
value
.
count
()
:
12
;
case
QExifValue
:
:
Ascii
:
return
value
.
count
()
>
4
?
12
+
value
.
count
()
:
12
;
return
value
.
count
()
>
4
?
12
+
value
.
count
()
:
12
;
case
QExifValue
:
:
Short
:
return
value
.
count
()
>
2
?
12
+
value
.
count
()
*
sizeof
(
quint16
)
:
12
;
return
value
.
count
()
>
2
?
static_cast
<
quint32
>
(
12
+
value
.
count
()
*
sizeof
(
quint16
))
:
12
;
case
QExifValue
:
:
Long
:
case
QExifValue
:
:
SignedLong
:
return
value
.
count
()
>
1
?
12
+
value
.
count
()
*
sizeof
(
quint32
)
:
12
;
return
value
.
count
()
>
1
?
static_cast
<
quint32
>
(
12
+
value
.
count
()
*
sizeof
(
quint32
))
:
12
;
case
QExifValue
:
:
Rational
:
case
QExifValue
:
:
SignedRational
:
return
value
.
count
()
>
0
?
12
+
value
.
count
()
*
sizeof
(
quint32
)
*
2
:
12
;
return
value
.
count
()
>
0
?
static_cast
<
quint32
>
(
12
+
value
.
count
()
*
sizeof
(
quint32
)
*
2
)
:
12
;
default:
return
0
;
}
...
...
@@ -1471,7 +1462,7 @@ QMap<T, QExifValue> QExifImageHeader::readIfdValues (
bool
QExifImageHeader
::
read
(
QIODevice
*
device
)
{
clear
();
int
startPos
=
device
->
pos
(
);
int
startPos
=
static_cast
<
int
>
(
device
->
pos
()
);
QDataStream
stream
(
device
);
...
...
@@ -1590,7 +1581,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
quint16
);
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
quint16
)
);
}
break
;
case
QExifValue
:
:
Long
:
...
...
@@ -1601,7 +1592,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
quint32
);
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
quint32
)
);
}
break
;
case
QExifValue
:
:
SignedLong
:
...
...
@@ -1612,7 +1603,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
qint32
);
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
qint32
)
);
}
break
;
case
QExifValue
:
:
Rational
:
...
...
@@ -1621,7 +1612,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
quint32
)
*
2
;
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
quint32
)
*
2
)
;
}
break
;
case
QExifValue
:
:
SignedRational
:
...
...
@@ -1630,7 +1621,7 @@ quint32 QExifImageHeader::writeExifHeader (QDataStream &stream, quint16 tag, con
}
else
{
stream
<<
offset
;
offset
+=
value
.
count
()
*
sizeof
(
qint32
)
*
2
;
offset
+=
static_cast
<
quint32
>
(
value
.
count
()
*
sizeof
(
qint32
)
*
2
)
;
}
break
;
default:
...
...
@@ -1739,7 +1730,7 @@ qint64 QExifImageHeader::write (QIODevice *device) const {
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
;
if
(
!
d
->
gpsIfdValues
.
isEmpty
())
{
...
...
src/utils/QExifImageHeader.h
View file @
d32f8ed4
...
...
@@ -41,8 +41,8 @@
// This file was copied from Qt Extended 4.5
#ifndef QEXIFIMAGEHEADER_H
#define QEXIFIMAGEHEADER_H
#ifndef QEXIFIMAGEHEADER_H
_
#define QEXIFIMAGEHEADER_H
_
#include <QPair>
#include <QVector>
...
...
@@ -333,4 +333,4 @@ private:
QExifImageHeaderPrivate
*
d
;
};
#endif // ifndef QEXIFIMAGEHEADER_H
#endif // ifndef QEXIFIMAGEHEADER_H
_
src/utils/Utils.hpp
View file @
d32f8ed4
...
...
@@ -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.
*/
#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