[segyio] 195/376: Explicit casts for htons/htonl

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:32 UTC 2017


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

jokva-guest pushed a commit to branch debian
in repository segyio.

commit df16f053b14e9231a7473ca30110b20a20091a1c
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Tue Feb 14 15:17:13 2017 +0100

    Explicit casts for htons/htonl
---
 lib/src/segy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/src/segy.c b/lib/src/segy.c
index bf2acf8..f310f18 100644
--- a/lib/src/segy.c
+++ b/lib/src/segy.c
@@ -484,12 +484,12 @@ static int set_field( char* header, const int* table, int field, int32_t val ) {
 
     switch( bsize ) {
         case 4:
-            buf32 = htonl( val );
+            buf32 = htonl( (uint32_t)val );
             memcpy( header + (field - 1), &buf32, sizeof( buf32 ) );
             return SEGY_OK;
 
         case 2:
-            buf16 = htons( val );
+            buf16 = htons( (uint16_t)val );
             memcpy( header + (field - 1), &buf16, sizeof( buf16 ) );
             return SEGY_OK;
 

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



More information about the debian-science-commits mailing list