[MERGED] libosmocore[master]: fix issue on big endian architecture

2018-04-09 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: fix issue on big endian architecture
..


fix issue on big endian architecture

OSMO_IS_LITTLE_ENDIAN is always defined and has a value of
either 0 or 1
as a result in byteswap.h the corresponding swap functions
will be always called, independent of the endianess

Signed-off-by: Thorsten Alteholz 
Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
---
M include/osmocom/core/byteswap.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/byteswap.h b/include/osmocom/core/byteswap.h
index 1ea5b3d..cecdc63 100644
--- a/include/osmocom/core/byteswap.h
+++ b/include/osmocom/core/byteswap.h
@@ -32,7 +32,7 @@
return out;
 }
 
-#ifdef OSMO_IS_LITTLE_ENDIAN
+#if OSMO_IS_LITTLE_ENDIAN == 1
 #define osmo_ntohl(x)  osmo_swab32(x)
 #define osmo_ntohs(x)  osmo_swab16(x)
 #define osmo_htonl(x)  osmo_swab32(x)

-- 
To view, visit https://gerrit.osmocom.org/7666
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


libosmocore[master]: fix issue on big endian architecture

2018-04-09 Thread Harald Welte

Patch Set 1:

thanks.  I think however that there are *many* more big endian related problems 
all over the Osmocom code base.  So I'd not be surprised if you run into all 
kinds of trouble on such systems (e.g. PPC, MIPS).  Fixes are appreciated, but 
nobody of the core developers is using any related big endian hardware, so 
there's not even manual testing for it.

-- 
To view, visit https://gerrit.osmocom.org/7666
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


libosmocore[master]: fix issue on big endian architecture

2018-04-09 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7666
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


libosmocore[master]: fix issue on big endian architecture

2018-04-08 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/7666
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: fix issue on big endian architecture

2018-04-07 Thread Thorsten Alteholz

Review at  https://gerrit.osmocom.org/7666

fix issue on big endian architecture

OSMO_IS_LITTLE_ENDIAN is always defined and has a value of
either 0 or 1
as a result in byteswap.h the corresponding swap functions
will be always called, independent of the endianess

Signed-off-by: Thorsten Alteholz 
Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
---
M include/osmocom/core/byteswap.h
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/7666/1

diff --git a/include/osmocom/core/byteswap.h b/include/osmocom/core/byteswap.h
index 1ea5b3d..cecdc63 100644
--- a/include/osmocom/core/byteswap.h
+++ b/include/osmocom/core/byteswap.h
@@ -32,7 +32,7 @@
return out;
 }
 
-#ifdef OSMO_IS_LITTLE_ENDIAN
+#if OSMO_IS_LITTLE_ENDIAN == 1
 #define osmo_ntohl(x)  osmo_swab32(x)
 #define osmo_ntohs(x)  osmo_swab16(x)
 #define osmo_htonl(x)  osmo_swab32(x)

-- 
To view, visit https://gerrit.osmocom.org/7666
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a09d2d8ccf155e70a3977ae1747758b6bc5125e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Thorsten Alteholz