Recent

Author Topic: BitHelpers - bit manipulation for standard pascal types  (Read 20080 times)

440bx

  • Hero Member
  • *****
  • Posts: 4064
Re: BitHelpers - bit manipulation for standard pascal types
« Reply #30 on: May 01, 2022, 05:59:30 pm »
or maybe add the word "Bits":
A mask is a bit structure, because of that, adding "Bits" feels redundant and increases the amount of typing. I think you had it short and concise to begin with. If I were you, I'd keep the way it was.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: BitHelpers - bit manipulation for standard pascal types
« Reply #31 on: May 01, 2022, 06:17:56 pm »
or maybe add the word "Bits":
A mask is a bit structure, because of that, adding "Bits" feels redundant and increases the amount of typing. I think you had it short and concise to begin with. If I were you, I'd keep the way it was.

He probably is a PICian, like me :-) If you are used to Microchip headers, that feels natural :-)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: BitHelpers - bit manipulation for standard pascal types
« Reply #32 on: May 02, 2022, 12:02:53 pm »
Thank you for your work on these and getting them merged into fpc.
You're most welcome. It was a pleasure, not work :D ::) :D

The bit functions such as ClearBit, SetBit, and TestBit take bit index values, but they don't work with bit mask values.  It would be nice to add bit functions that work with masks as well since many APIs and libraries use them.
Devs are very picky (rightfully) with what goes into sysutils, so you should better discuss with them in the mail list before doing any real work. My wild guess would be that if your patches get accepted, they would need to be in some other unit.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

mas steindorff

  • Hero Member
  • *****
  • Posts: 533
Re: BitHelpers - bit manipulation for standard pascal types
« Reply #33 on: May 02, 2022, 09:53:37 pm »
I haven't decided if I like "Mask" or "Flag":
also coming from the hardware world, a Flag is a single bit, Mask = several bits or flag(s). mask is what you do to select one to several flags (bits).
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

 

TinyPortal © 2005-2018