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.
This commit is contained in:
Thomas Moestl 2002-04-06 00:07:15 +00:00
parent eac1eda045
commit ca31253aa8
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -57,5 +57,5 @@
.set CNAME(ntohl),CNAME(__ntohl)
ENTRY(__ntohl)
retl
signx %o0, %o0
srl %o0, 0, %o0 /* zero extend */
END(__ntohl)