diff options
author | tmm <tmm@FreeBSD.org> | 2002-04-06 00:07:15 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2002-04-06 00:07:15 +0000 |
commit | c944152856606166efbfb1b77cce85c0393d7e99 (patch) | |
tree | 9993e252326c819464b04f5a5eaf741f57e5bc49 /lib | |
parent | 7a9becef0e46299a219f311e7baa5368386d6872 (diff) | |
download | FreeBSD-src-c944152856606166efbfb1b77cce85c0393d7e99.zip FreeBSD-src-c944152856606166efbfb1b77cce85c0393d7e99.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sparc64/net/htonl.S | 2 | ||||
-rw-r--r-- | lib/libc/sparc64/net/ntohl.S | 2 |
2 files changed, 2 insertions, 2 deletions
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) |