forked from pool/libfreefare
libfreefare-0.3.4+git67
OBS-URL: https://build.opensuse.org/package/show/hardware/libfreefare?expand=0&rev=5
This commit is contained in:
parent
bf73601664
commit
08bb77edb0
@ -1,41 +0,0 @@
|
|||||||
From 3dd547d851cca5906edc674e127ecaa2b49591b6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan Engelhardt <jengelh@inai.de>
|
|
||||||
Date: Wed, 5 Jun 2013 18:22:26 +0200
|
|
||||||
X-Upstream-Status: submitted, awaiting merge
|
|
||||||
Subject: [PATCH] libfreefare: resolve compiler warning on breakage of strict
|
|
||||||
aliasing
|
|
||||||
|
|
||||||
gcc warns:
|
|
||||||
mifare_classic.c:353:45: warning: dereferencing type-punned pointer
|
|
||||||
will break strict-aliasing rules [-Wstrict-aliasing]
|
|
||||||
|
|
||||||
There is another problem with this code: "data", being a 16-byte
|
|
||||||
array, may not be suitably aligned for the other types in the union.
|
|
||||||
This patch resolves this.
|
|
||||||
---
|
|
||||||
libfreefare/mifare_classic.c | 8 +++-----
|
|
||||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libfreefare/mifare_classic.c b/libfreefare/mifare_classic.c
|
|
||||||
index aaf2d64..1502fe8 100644
|
|
||||||
--- a/libfreefare/mifare_classic.c
|
|
||||||
+++ b/libfreefare/mifare_classic.c
|
|
||||||
@@ -346,12 +346,10 @@ mifare_classic_init_value (MifareTag tag, const MifareClassicBlockNumber block,
|
|
||||||
int
|
|
||||||
mifare_classic_read_value (MifareTag tag, const MifareClassicBlockNumber block, int32_t *value, MifareClassicBlockNumber *adr)
|
|
||||||
{
|
|
||||||
- MifareClassicBlock data;
|
|
||||||
- if (mifare_classic_read (tag, block, &data) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- union mifare_classic_block b = *((union mifare_classic_block *)(&data));
|
|
||||||
+ union mifare_classic_block b;
|
|
||||||
|
|
||||||
+ if (mifare_classic_read (tag, block, b.data) < 0)
|
|
||||||
+ return -1;
|
|
||||||
|
|
||||||
if ((b.value.value ^ (uint32_t)~b.value.value_) || (b.value.value != b.value.value__)) {
|
|
||||||
errno = EIO;
|
|
||||||
--
|
|
||||||
1.8.2
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:47126c92aa8a9e35de4db3bce16d14fbdae3cee0587dacee9544afc514f40030
|
|
||||||
size 82324
|
|
3
libfreefare-0.3.4+git67.tar.xz
Normal file
3
libfreefare-0.3.4+git67.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:39e55540e9946ccac950d298435c4aa5e57c4d79274140a46c793417a12b763d
|
||||||
|
size 82352
|
@ -1,9 +1,8 @@
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jun 5 15:58:17 UTC 2013 - jengelh@inai.de
|
Wed Jun 5 15:58:17 UTC 2013 - jengelh@inai.de
|
||||||
|
|
||||||
- Update to new upstream snapshot 0.3.4+git66
|
- Update to new upstream snapshot 0.3.4+git67
|
||||||
* update for new libnfc4-1.7.0 API
|
* update for new libnfc4-1.7.0 API
|
||||||
- Add 0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Jun 15 17:47:46 UTC 2012 - jengelh@inai.de
|
Fri Jun 15 17:47:46 UTC 2012 - jengelh@inai.de
|
||||||
|
@ -21,14 +21,13 @@ Name: libfreefare
|
|||||||
Summary: API for Mifare card manipulations
|
Summary: API for Mifare card manipulations
|
||||||
License: LGPL-3.0+
|
License: LGPL-3.0+
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
# Commit 00e999dd523b6f2be8b7820f3797b4ec9fd6c88a
|
# Commit 089b6006b1bdd7546f9c7b291a8b3325cbda5537
|
||||||
Version: 0.3.4+git66
|
Version: 0.3.4+git67
|
||||||
Release: 0
|
Release: 0
|
||||||
Url: http://code.google.com/p/nfc-tools/
|
Url: http://code.google.com/p/nfc-tools/
|
||||||
|
|
||||||
#Git-Clone: http://code.google.com/p/libfreefare/
|
#Git-Clone: http://code.google.com/p/libfreefare/
|
||||||
Source: %name-%version.tar.xz
|
Source: %name-%version.tar.xz
|
||||||
Patch1: 0001-libfreefare-resolve-compiler-warning-on-breakage-of-.patch
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
@ -87,7 +86,6 @@ inspecting and manipulating Mifare cards.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -qn %name
|
%setup -qn %name
|
||||||
%patch -P 1 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
if [ ! -e configure ]; then
|
if [ ! -e configure ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user