Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [netbsd-10] src/sys/sys



Module Name:    src
Committed By:   martin
Date:           Sat Apr 12 12:56:48 UTC 2025

Modified Files:
        src/sys/sys [netbsd-10]: endian.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1095):

        sys/sys/endian.h: revision 1.36
        sys/sys/endian.h: revision 1.37

endian.h: Consistently use __CAST() where appropriate, NFC

In preparation for PR lib/57478
endian.h: Cast to suitable type when byte order conversion is NOP

Otherwise, e.g., following examples do not work as expected on
big-endian machines:
- printf("%x\n", ntohl(0x01234567890abcdefULL);
- uint64_t u64 = ntohl(0x01234567890abcdefULL);
- etc.

Fix PR lib/57478

I've been tested this patch both on big-/little-endian and
LP64/ILP32 environments over a year without troubles.


To generate a diff of this commit:
cvs rdiff -u -r1.31.4.1 -r1.31.4.2 src/sys/sys/endian.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index