From c944152856606166efbfb1b77cce85c0393d7e99 Mon Sep 17 00:00:00 2001 From: tmm Date: Sat, 6 Apr 2002 00:07:15 +0000 Subject: htonl() and ntohl() operate on unsinged types, so they must zero-extend, not sign-extend. Fix a comment in the former to that effect, and change the latter over to do the right conversion. --- lib/libc/sparc64/net/htonl.S | 2 +- lib/libc/sparc64/net/ntohl.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/sparc64') diff --git a/lib/libc/sparc64/net/htonl.S b/lib/libc/sparc64/net/htonl.S index c3d10e5..e972dfc 100644 --- a/lib/libc/sparc64/net/htonl.S +++ b/lib/libc/sparc64/net/htonl.S @@ -57,5 +57,5 @@ .set CNAME(htonl),CNAME(__htonl) ENTRY(__htonl) retl - srl %o0, 0, %o0 /* zero extend -- or do we sign extend? */ + srl %o0, 0, %o0 /* zero extend */ END(__htonl) diff --git a/lib/libc/sparc64/net/ntohl.S b/lib/libc/sparc64/net/ntohl.S index 4a54691..1313a45 100644 --- a/lib/libc/sparc64/net/ntohl.S +++ b/lib/libc/sparc64/net/ntohl.S @@ -57,5 +57,5 @@ .set CNAME(ntohl),CNAME(__ntohl) ENTRY(__ntohl) retl - signx %o0, %o0 + srl %o0, 0, %o0 /* zero extend */ END(__ntohl) -- cgit v1.1