[Issue 4937] std.bitmanip: Allow repeated (identical) bitfield declarations

2016-10-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4937

Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |WONTFIX

--


[Issue 4937] std.bitmanip: Allow repeated (identical) bitfield declarations

2013-02-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4937



--- Comment #3 from Andrei Alexandrescu  2013-02-26 08:58:34 
PST ---
I think we're good as we are. OK to close?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4937] std.bitmanip: Allow repeated (identical) bitfield declarations

2012-07-31 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4937


Era Scarecrow  changed:

   What|Removed |Added

 CC||rtcv...@yahoo.com


--- Comment #2 from Era Scarecrow  2012-07-31 19:11:09 PDT 
---
> Also, I think I'm going to request that repeated bitfield definitions be
> allowed if they are identical - I'd like to redeclare "opcode" rather than "".

How would you tell them apart? If i know how you may want to call them, i may
be able to make something. I can understand with registers, but still need some
way to work with them. Perhaps as a set then?


> So I would like the bitmanip code to permit redeclaration of bitfields that
> are identical in all respects.

>That is, obviously the names are the same, but the field width, offset, and
>type representation has to be the same as well.

Maybe?

struct S {
mixin(bitfields!(
uint, "opcode", 4,
uint, "register", 4,
uint, "register", 4,
uint, "register", 4
));
}

and using the registers would have function signature like...

struct Register {
  uint register_1;
  uint register_2;
  uint register_3;

}

//setters, likely can't be @propery
void register(uint reg1, uint reg2, uint reg3);
void register(uint[] register ...); //maybe?
void register(Register register);

//getter ??
Register register() const;

Or perhaps...

struct S {
mixin(bitfields!(
uint, "opcode", 4,
uint, "reg1", 4,
uint, "reg2", 4,
uint, "reg3", 4
));
mixin(sharedNameSet(
"nameForGetterAndSetter",
"struct name for returning/passing",
"reg1", "reg2", "reg3" //named variables as a set
));

//nameForGetterAndSetter's would be added here, perhaps as above.
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4937] std.bitmanip: Allow repeated (identical) bitfield declarations

2010-09-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4937


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-09-24 18:46:51 PDT ---
See also bug 4425

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4937] std.bitmanip: Allow repeated (identical) bitfield declarations

2010-09-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4937


Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||and...@metalanguage.com
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---