[osol-code] Dumping core while using rwFactory()->create( )

2008-06-12 Thread Rahul
hi Guys!!! I'm not sure if this is the right forum... but please help.. Please have a look at the code. int main(int argc, char *argv[]) { std::cout << "Begining of the program .. " << endl; RWBag dummy; //might have to create a dummy RWBAG to link the correct code; std::cout << "This program cre

Re: [osol-code] Bitmask macros?

2008-06-12 Thread Joerg Schilling
"Garrett D'Amore" <[EMAIL PROTECTED]> wrote: > > - You take care about Bit-ordering (this may be different from Byte-order > > see Plan 9 compiler...) > > > > Yeah, I don't like to rely on ordering of the bits within the C > structure. C structures are fine for bit fields used only by

Re: [osol-code] Bitmask macros?

2008-06-12 Thread Keith M Wesolowski
On Thu, Jun 12, 2008 at 04:19:57PM +0200, Joerg Schilling wrote: > Cdrecord uses bitfields for SCSI structures but as you see from above, you > definitely need autoconf to get the right definition for the current compile > platform. Fortunately this is opensolaris-code and we are talking about

Re: [osol-code] Bitmask macros?

2008-06-12 Thread Garrett D'Amore
Joerg Schilling wrote: > James Carlson <[EMAIL PROTECTED]> wrote: > > >> Garrett D'Amore writes: >> >>> I have macros like those above, yes. (Although in my code it looks more >>> like this:) >>> >>> #define BIT(x) (1UL << (x)) >>> ... >>> #define MYMASK BIT(4) >>> >> I'm surprised

Re: [osol-code] Bitmask macros?

2008-06-12 Thread Joerg Schilling
James Carlson <[EMAIL PROTECTED]> wrote: > Garrett D'Amore writes: > > I have macros like those above, yes. (Although in my code it looks more > > like this:) > > > > #define BIT(x) (1UL << (x)) > > ... > > #define MYMASK BIT(4) > > I'm surprised nobody's mentioned C structures with bit fields.

Re: [osol-code] Bitmask macros?

2008-06-12 Thread James Carlson
Garrett D'Amore writes: > I have macros like those above, yes. (Although in my code it looks more > like this:) > > #define BIT(x) (1UL << (x)) > ... > #define MYMASK BIT(4) I'm surprised nobody's mentioned C structures with bit fields. I've used those to good effect on hardware in the past. (

Re: [osol-code] Bitmask macros?

2008-06-12 Thread Paul Durrant
Jason King wrote: > I'm curious to know if anyone feels if there might be utility in > providing macros in a header file for defining and manipulating > bitmasks (analogous to __BIT(x), __BITS(a,b), __SHIFTIN, __SHIFTOUT, > etc on some of the BSDs)? In some of the driver work I've done, I've > fou