A safer way to get/set parts of a compact number using contracts

37 views
Skip to first unread message

Finnian Reilly

unread,
Feb 2, 2023, 11:20:14 AM2/2/23
to Eiffel Users

Finnian Reilly

unread,
Feb 3, 2023, 9:17:22 AM2/3/23
to eiffel...@googlegroups.com
The main caveat of the bit-setting technique described in the article was the extra overhead incurred to derive the shift-count from the mask.

But this has now been solved by calling built-in C functions for both msc and gcc compilers. So if available the compiler will use an assembly instruction.
See Unix example EL_BIT_ROUTINES
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/5f6d097a-8920-4313-8aa9-205f052eab1an%40googlegroups.com.


-- 
SmartDevelopersUseUnderScoresInTheirIdentifiersBecause_it_is_much_easier_to_read

Ulrich Windl (Google)

unread,
Feb 6, 2023, 12:23:51 PM2/6/23
to eiffel...@googlegroups.com
Hi!

Having had a quick glance at the code, and having used such functions in a C project myself, I miss the assertions!
From my C code I experienced that bad things happen if you use the routines incorrectly. Unfortunately I cannot access my code right now to give you some details.

Regards,
Ulrich Windl
Reply all
Reply to author
Forward
0 new messages