constants are ints by default. so, use sufix 'l' for them. If you still got a problem, post sorces which cause a problem. Form ones you posted, the shift operation should be eliminated. ~d
On Friday 23 May 2003 01:18, Paul Georgief wrote: > mspgcc group: > > > I've been trying to use the right shift operator and have been seeing some > weirdness with long values. I cannot right shift by certain constant > values: 8, 16+. > > > long a; > a = 0x12345678; > > // These compile and work fine: > a = a >> 1; > a = a >> 2; > a = a >> 3; > > > a = a >> 7; > // The value 8 compiles (unlike left shift), but does not work correctly > a = a >> 9; > > a = a >> 15; > > // Any constant 16 and above does not work correctly > > > Any help would be appreciated. > - Paul > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users -- /******************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys (_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44 _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314 ********************************************************************/
