[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [glob2-devel] Re: what was the cause of repair bug?
From: |
Joe Wells |
Subject: |
Re: [glob2-devel] Re: what was the cause of repair bug? |
Date: |
Tue, 17 Apr 2007 13:10:23 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Kai Antweiler <address@hidden> writes:
>> Level 1 building construction site: 0
>> Level 1 building completed: 1
>> Level 2 building construction site: 2
>> Level 2 building completed: 3
>> Level 3 building construction site: 4
>> Level 3 building completed: 5
>>
>> When a completeted level 1 building goes into construction, its
>> "technical level" goes from 1 to 0. If we take prev level when its at
>> 0, this is -1, which means invalid.
>
> The difference between construction site and building seems to be
> just the first bit. Swapping that seems to be safer.
> "level ^=1;"
> ^ is binary xor, right?
>
>
> Better would be using different functions:
> newBuildingLevel:
> assert (level <=4);
> level &= 0xfe;
> level+=2;
> convertToConstructionSite:
> level |= 1;
> convertToBuilding:
> level &=0xfe;
>
> We could use 0xe or 0x7 instead of 0x7e, but that is not the point.
I'd prefer to see the code move away from taking advantage of
properties of numbers and become more abstract.
--
Joe
- [glob2-devel] Re: what was the cause of repair bug?, (continued)
- [glob2-devel] Re: what was the cause of repair bug?, Kai Antweiler, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Kieran P, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Joe Wells, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Joe Wells, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Bradley Arsenault, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Joe Wells, 2007/04/16
- Re: what was the cause of repair bug? (was: [glob2-devel] bugfixes), Bradley Arsenault, 2007/04/16
- [glob2-devel] Re: what was the cause of repair bug?, Joe Wells, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Bradley Arsenault, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Kai Antweiler, 2007/04/17
- Re: [glob2-devel] Re: what was the cause of repair bug?,
Joe Wells <=
- Re: [glob2-devel] Re: what was the cause of repair bug?, Kai Antweiler, 2007/04/17
- Re: [glob2-devel] Re: what was the cause of repair bug?, Joe Wells, 2007/04/17
- Re: [glob2-devel] Re: what was the cause of repair bug?, Joe Wells, 2007/04/16
- Re: [glob2-devel] Re: what was the cause of repair bug?, Bradley Arsenault, 2007/04/16