[pvrusb2] bitmask cleanup / new patch / newer..

Frans Meulenbroeks fransmeulenbroeks at yahoo.com
Sat Jan 7 06:23:09 CST 2006


Exactly what I wanted to say.

Reason for posting this anyway, is that personally I'm
in favor for the old bitmasks (I consider them to be
better readable and it is instantaneously clear which
bit is involved whereas the shift mechanism requires
more thinking).

My suggestion would be to keep the old masks...

Frans.

--- Mike Isely <isely at isely.net> wrote:

> On Sat, 7 Jan 2006, Ingo Flaschberger wrote:
> 
> > Hey..
> >
> > Seems to be my good day...
> >
> > version 3 works now.
> >
> > But in file driver/pvrusb2-hdw.h I have no idea
> why I can't replace
> > #define PVR2_SUBSYS_ENC_FIRMWARE        0x00000001
> > #define PVR2_SUBSYS_ENC_CFG             0x00004000
> > #define PVR2_SUBSYS_DIGITIZER_RUN       0x00008000
> > #define PVR2_SUBSYS_USBSTREAM_RUN       0x00010000
> > #define PVR2_SUBSYS_ENC_RUN             0x00020000
> >
> > with:
> > #define PVR2_SUBSYS_ENC_FIRMWARE        1 << 0
> > #define PVR2_SUBSYS_ENC_CFG             1 << 14
> > #define PVR2_SUBSYS_DIGITIZER_RUN       1 << 15
> > #define PVR2_SUBSYS_USBSTREAM_RUN       1 << 16
> > #define PVR2_SUBSYS_ENC_RUN             1 << 17
> >
> >
> > It just does not work. Also ((unsigned long) 1) <<
> 0 casts does not help.
> > Strange...
> 
> Surround them with parantheses, like this:
> 
> #define PVR2_SUBSYS_ENC_FIRMWARE        (1 << 0)
> 
> In fact, the debug masks (or anything that expands
> in a preproc macro) 
> should do this too.  You're replacing a constant
> with an expression (a 
> constant expression, but still an expression) thus
> you expose yourself to 
> problems involving associativity and commutativity
> in expression 
> evaluation.
> 
>    -Mike
> 
> 
> -- 
>                          |         Mike Isely       
>   |     PGP fingerprint
>       Spammers Die!!     |                          
>   | 03 54 43 4D 75 E5 CC 92
>                          |   isely @ pobox (dot) com
>   | 71 16 01 E2 B5 F5 C1 E8
>                          |                          
>   |
> _______________________________________________
> pvrusb2 mailing list
> pvrusb2 at isely.net
>
http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2
> 



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



More information about the pvrusb2 mailing list