[libosmo-sccp] 01/01: Simplified expression a bit

Ruben Undheim rubund-guest at moszumanska.debian.org
Thu Feb 11 21:24:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to branch master
in repository libosmo-sccp.

commit 33c7c40c47491cf46ea98ea176775f58ecdbc8ff
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Thu Feb 11 22:21:57 2016 +0100

    Simplified expression a bit
---
 debian/patches/03_fix_for_big_endian.patch | 41 +++++++-----------------------
 1 file changed, 9 insertions(+), 32 deletions(-)

diff --git a/debian/patches/03_fix_for_big_endian.patch b/debian/patches/03_fix_for_big_endian.patch
index ca6f216..424b6ba 100644
--- a/debian/patches/03_fix_for_big_endian.patch
+++ b/debian/patches/03_fix_for_big_endian.patch
@@ -1,33 +1,10 @@
-Description: <short summary of the patch>
- TODO: Put a short summary on the line above and replace this paragraph
- with a longer explanation of this change. Complete the meta-information
- with other relevant fields (see below for details). To make it easier, the
- information below has been extracted from the changelog. Adjust it or drop
- it.
- .
- libosmo-sccp (0.7.0-1) unstable; urgency=low
- .
-   * Initial release (Closes: #813294)
+Description: Fixes issue on big-endian architectures
 Author: Ruben Undheim <ruben.undheim at gmail.com>
-Bug-Debian: https://bugs.debian.org/813294
-
----
-The information above should follow the Patch Tagging Guidelines, please
-checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
-are templates for supplementary fields that you might want to add:
-
-Origin: <vendor|upstream|other>, <url of original patch>
-Bug: <url in upstream bugtracker>
-Bug-Debian: https://bugs.debian.org/<bugnumber>
-Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
-Forwarded: <no|not-needed|url proving that it has been forwarded>
-Reviewed-By: <name and email of someone who approved the patch>
-Last-Update: <YYYY-MM-DD>
 
 Index: libosmo-sccp/src/sccp.c
 ===================================================================
---- libosmo-sccp.orig/src/sccp.c	2016-02-05 16:56:35.845659264 +0100
-+++ libosmo-sccp/src/sccp.c	2016-02-11 21:48:58.066093403 +0100
+--- libosmo-sccp.orig/src/sccp.c	2016-02-11 22:17:59.151492330 +0100
++++ libosmo-sccp/src/sccp.c	2016-02-11 22:21:41.332300552 +0100
 @@ -1392,14 +1392,26 @@
  uint32_t sccp_src_ref_to_int(struct sccp_source_reference *ref)
  {
@@ -35,9 +12,9 @@ Index: libosmo-sccp/src/sccp.c
 +#if OSMO_IS_LITTLE_ENDIAN
  	memcpy(&src_ref, ref, sizeof(*ref));
 +#elif OSMO_IS_BIG_ENDIAN
-+	memcpy((((char*)(&src_ref))+3),&(ref->octet1),1);
-+	memcpy((((char*)(&src_ref))+2),&(ref->octet2),1);
-+	memcpy((((char*)(&src_ref))+1),&(ref->octet3),1);
++	*(((uint8_t*)(&src_ref))+3) = ref->octet1;
++	*(((uint8_t*)(&src_ref))+2) = ref->octet2;
++	*(((uint8_t*)(&src_ref))+1) = ref->octet3;
 +#endif
  	return src_ref;
  }
@@ -48,9 +25,9 @@ Index: libosmo-sccp/src/sccp.c
 +#if OSMO_IS_LITTLE_ENDIAN
  	memcpy(&ref, &int_ref, sizeof(ref));
 +#elif OSMO_IS_BIG_ENDIAN
-+	memcpy(&(ref.octet1),(((char*)(&int_ref))+3),1);
-+	memcpy(&(ref.octet2),(((char*)(&int_ref))+2),1);
-+	memcpy(&(ref.octet3),(((char*)(&int_ref))+1),1);
++	ref.octet1 = *(((uint8_t*)(&int_ref))+3);
++	ref.octet2 = *(((uint8_t*)(&int_ref))+2);
++	ref.octet3 = *(((uint8_t*)(&int_ref))+1);
 +#endif
  	return ref;
  }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libosmo-sccp.git



More information about the debian-science-commits mailing list