Author |
Topic |
|
WannabeeDeveloper
Tomato Guru
Germany
775 Posts |
Posted - Jul 01 2004 : 02:13:31 AM
|
Okay, please check this out:
const int cCodecCelp51 = 0,
cCodecCelp63 = 1,
cCodecGSM148 = 2,
cCodecGSM164 = 3,
cCodecWindowsCELP52 =4,
//Codec masks
cmCelp51 = 1 << cCodecCelp51,
cmCelp63 = 1 << cCodecCelp63,
cmGSM148 = 1 << cCodecGSM148,
cmGSM164 = 1 << cCodecGSM164,
cmWindowsCELP52 = 1 << cCodecWindowsCELP52,
//PlayerChannel Privileges
pcpAdmin = 1 << 0,
pcpOperator = 1 << 1,
pcpAutoOperator = 1 << 2,
pcpVoiced = 1 << 3,
pcpAutoVoice = 1 << 4,
//PlayerPrivileges
ppSuperServerAdmin = 1 << 0,
ppServerAdmin = 1 << 1,
ppCanRegister = 1 << 2,
ppRegistered = 1 << 3,
ppUnregistered = 1 << 4,
//player flags
pfChannelCommander = 1 << 0,
pfWantVoice = 1 << 1,
pfNoWhisper = 1 << 2,
pfAway = 1 << 3,
pfInputMuted = 1 << 4,
pfOutputMuted = 1 << 5,
pfRecording = 1 << 6,
//channel flags
cfRegistered = 1 << 0,
cfUnregistered = 1 << 1,
cfModerated = 1 << 2,
cfPassword = 1 << 3,
cfHierarchical = 1 << 4,
cfDefault = 1 << 5,
//ServerType Flags
stClan = 1 << 0,
stPublic = 1 << 1,
stFreeware = 1 << 2,
stCommercial = 1 << 3,
grRevoke = 0,
grGrant = 1;
This is how it looks like (on both VS 6.0 and .NET 2003): const int cCodecCelp51 = 0, cCodecCelp63 = 1, cCodecGSM148 = 2, cCodecGSM164 = 3, cCodecWindowsCELP52 =4, //Codec masks cmCelp51 = 1 << cCodecCelp51, cmCelp63 = 1 << cCodecCelp63, cmGSM148 = 1 << cCodecGSM148, cmGSM164 = 1 << cCodecGSM164, cmWindowsCELP52 = 1 << cCodecWindowsCELP52, //PlayerChannel Privileges pcpAdmin = 1 << 0, pcpOperator = 1 << 1, pcpAutoOperator = 1 << 2, pcpVoiced = 1 << 3, pcpAutoVoice = 1 << 4, //PlayerPrivileges ppSuperServerAdmin = 1 << 0, ppServerAdmin = 1 << 1, ppCanRegister = 1 << 2, ppRegistered = 1 << 3, ppUnregistered = 1 << 4, //player flags pfChannelCommander = 1 << 0, pfWantVoice = 1 << 1, pfNoWhisper = 1 << 2, pfAway = 1 << 3, pfInputMuted = 1 << 4, pfOutputMuted = 1 << 5, pfRecording = 1 << 6, //channel flags cfRegistered = 1 << 0, cfUnregistered = 1 << 1, cfModerated = 1 << 2, cfPassword = 1 << 3, cfHierarchical = 1 << 4, cfDefault = 1 << 5, //ServerType Flags stClan = 1 << 0, stPublic = 1 << 1, stFreeware = 1 << 2, stCommercial = 1 << 3,
grRevoke = 0, grGrant = 1;
See what I mean? Only partly colored... |
|
Edited by - WannabeeDeveloper on Jul 01 2004 02:22:59 AM |
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jul 04 2004 : 6:15:27 PM
|
confirmed in .NET 2002
it is interesting that VAX got past the first comment, but not the second comment.
is there any particular reason for laying the code out like that? it strikes me as rather hard to read and follow. |
zen is the art of being at one with the two'ness |
|
|
WannabeeDeveloper
Tomato Guru
Germany
775 Posts |
Posted - Jul 05 2004 : 03:19:12 AM
|
Yup, all of them are const int, so no need to type "const int" over and over again. Because all Variables are indented, I (personally) think it is easier to read... but that's just my "style" and opinion... |
|
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Jul 05 2004 : 04:46:44 AM
|
I can't seem to reproduce this, but I assumed it was the bitshift that was confusing VAX, not the comments.
Whatever programming style people choose, VAX should colour it correctly! |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jul 07 2004 : 7:11:57 PM
|
interesting. i simply copy and pasted the example and i saw the problem. as for style and VAX, i agree, i was simply curions |
zen is the art of being at one with the two'ness |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jul 07 2004 : 8:25:13 PM
|
The left shift and comma confuse VA X. This simpler example fails:
int fooA = 1 << 1, fooB;
case=161 |
Whole Tomato Software, Inc. |
|
|
|
Topic |
|
|
|