fix some problems found by coverity

f41
David Tardon 10 years ago
parent 19e5c4a429
commit 77ff6bf8c5

@ -0,0 +1,36 @@
From 54c63c653deb070c49621bea8acbc18f76118238 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 26 May 2015 16:56:56 +0200
Subject: [PATCH 1/2] add missing breaks
Change-Id: I6a6afd517e61aff89319348de5af3aa97093bd1d
---
src/lib/KEY2Parser.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lib/KEY2Parser.cpp b/src/lib/KEY2Parser.cpp
index bb58efd..4ba70d2 100644
--- a/src/lib/KEY2Parser.cpp
+++ b/src/lib/KEY2Parser.cpp
@@ -261,8 +261,10 @@ void PointElement::attribute(const int name, const char *const value)
{
case IWORKToken::NS_URI_SFA | IWORKToken::x :
m_point.first = lexical_cast<double>(value);
+ break;
case IWORKToken::NS_URI_SFA | IWORKToken::y :
m_point.second = lexical_cast<double>(value);
+ break;
}
}
@@ -358,6 +360,7 @@ void PointPathElement::attribute(const int name, const char *const value)
ETONYEK_DEBUG_MSG(("unknown point path type: %s\n", value));
break;
}
+ break;
}
default :
KEY2XMLElementContextBase::attribute(name, value);
--
2.4.1

@ -0,0 +1,38 @@
From 91d39222d9f120211c0189f69299898702a65d3d Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 26 May 2015 17:01:22 +0200
Subject: [PATCH 2/2] remove surplus breaks
Change-Id: Ib98a4a5bcd7d9f9eb03874f0715b45bb141ef12d
---
src/lib/KEY2Parser.cpp | 1 -
src/lib/contexts/IWORKStylesContext.cpp | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/lib/KEY2Parser.cpp b/src/lib/KEY2Parser.cpp
index 4ba70d2..9a37dcd 100644
--- a/src/lib/KEY2Parser.cpp
+++ b/src/lib/KEY2Parser.cpp
@@ -124,7 +124,6 @@ IWORKXMLContextPtr_t StylesContext::element(const int name)
return makeContext<KEY2StyleContext>(getState(), name);
case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref :
- break;
return makeContext<KEY2StyleRefContext>(getState(), name, false, m_anonymous);
}
diff --git a/src/lib/contexts/IWORKStylesContext.cpp b/src/lib/contexts/IWORKStylesContext.cpp
index ef3041b..24efa1d 100644
--- a/src/lib/contexts/IWORKStylesContext.cpp
+++ b/src/lib/contexts/IWORKStylesContext.cpp
@@ -43,7 +43,6 @@ IWORKXMLContextPtr_t IWORKStylesContext::element(const int name)
case IWORKToken::NS_URI_SF | IWORKToken::liststyle_ref :
case IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref :
case IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref :
- break;
return makeContext<IWORKStyleRefContext>(getState(), name, false, m_anonymous);
}
--
2.4.1

@ -2,7 +2,7 @@
Name: libetonyek
Version: 0.1.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A library for import of Apple iWork documents
License: MPLv2.0
@ -20,6 +20,8 @@ BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(zlib)
Patch0: 0001-fix-test-on-i386.patch
Patch1: 0001-add-missing-breaks.patch
Patch2: 0002-remove-surplus-breaks.patch
%description
%{name} is library for import of documents from Apple iWork applications
@ -123,6 +125,9 @@ make %{?_smp_mflags} check
%{_mandir}/man1/pages2text.1*
%changelog
* Tue May 26 2015 David Tardon <dtardon@redhat.com> - 0.1.2-2
- fix some problems found by coverity
* Wed May 20 2015 David Tardon <dtardon@redhat.com> - 0.1.2-1
- new upstream release

Loading…
Cancel
Save