Crafty 22.8

Discussion of chess software programming and technical issues.

Moderator: Ras

frankp
Posts: 233
Joined: Sun Mar 12, 2006 3:11 pm

Crafty 22.8

Post by frankp »

Crafty 22.8
init.c line 33, minor oops

void Initialize()
{
int i, major, minor, id;
TREE *tree;
void *mem;
int j;

tree = block[0];
for (j = 1; j < MAX_BLOCKS; j++)
block[j] == NULL;

Guess this should be block[j] = NULL;
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 22.8

Post by bob »

frankp wrote:Crafty 22.8
init.c line 33, minor oops

void Initialize()
{
int i, major, minor, id;
TREE *tree;
void *mem;
int j;

tree = block[0];
for (j = 1; j < MAX_BLOCKS; j++)
block[j] == NULL;
Guess this should be block[j] = NULL;
Absolutely. I'll fix it.
Cardoso
Posts: 363
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: Crafty 22.8

Post by Cardoso »

I've done my share of those.
But it is unbelivable how we do these things.
Could it be that programming can cause things like alzhimer desease?
I'm saying this because I'm in a pretty bad shape.
I'm 42 and I just sleep 3-5 hours and medication don't help much.
I guess we live in a world we ain't suppose to live in, almost everything around us is bad.

best regards,
Alvaro
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Crafty 22.8

Post by Tord Romstad »

Cardoso wrote:I've done my share of those.
What compiler(s) do you guys use? I thought any modern compiler would catch cases like this and give a warning. I just tested gcc and icc under OS X, and they both give a warning (gcc says "statement with no effect", icc says "expression has no effect").

Tord
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 22.8

Post by bob »

Cardoso wrote:I've done my share of those.
But it is unbelivable how we do these things.
Could it be that programming can cause things like alzhimer desease?
I'm saying this because I'm in a pretty bad shape.
I'm 42 and I just sleep 3-5 hours and medication don't help much.
I guess we live in a world we ain't suppose to live in, almost everything around us is bad.

best regards,
Alvaro
I think in my case it is just a symptom of being almost 61 years old... :)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty 22.8

Post by bob »

Tord Romstad wrote:
Cardoso wrote:I've done my share of those.
What compiler(s) do you guys use? I thought any modern compiler would catch cases like this and give a warning. I just tested gcc and icc under OS X, and they both give a warning (gcc says "statement with no effect", icc says "expression has no effect").

Tord
I used ICC, with all warnings enabled. I am not sure how that particular glitch happened.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Crafty 22.8

Post by Tord Romstad »

bob wrote:
Cardoso wrote:I've done my share of those.
But it is unbelivable how we do these things.
Could it be that programming can cause things like alzhimer desease?
I'm saying this because I'm in a pretty bad shape.
I'm 42 and I just sleep 3-5 hours and medication don't help much.
I guess we live in a world we ain't suppose to live in, almost everything around us is bad.

best regards,
Alvaro
I think in my case it is just a symptom of being almost 61 years old... :)
I'm 34, and I can't even write syntactically correct C without using a cheat sheet. I never remember things like the operator precedence levels or where to put semicolons.

Tord
Edsel Apostol
Posts: 803
Joined: Mon Jul 17, 2006 5:53 am
Full name: Edsel Apostol

Re: Crafty 22.8

Post by Edsel Apostol »

Tord Romstad wrote:
bob wrote:
Cardoso wrote:I've done my share of those.
But it is unbelivable how we do these things.
Could it be that programming can cause things like alzhimer desease?
I'm saying this because I'm in a pretty bad shape.
I'm 42 and I just sleep 3-5 hours and medication don't help much.
I guess we live in a world we ain't suppose to live in, almost everything around us is bad.

best regards,
Alvaro
I think in my case it is just a symptom of being almost 61 years old... :)
I'm 34, and I can't even write syntactically correct C without using a cheat sheet. I never remember things like the operator precedence levels or where to put semicolons.

Tord
I'm 24 and I also can't memorize the operator precedence though I could write well in C without using any reference at all. I think what's important is not what you memorize or what data one have in his brain but rather the way on how to process this data.
frankp
Posts: 233
Joined: Sun Mar 12, 2006 3:11 pm

Re: Crafty 22.8

Post by frankp »

One 'rule' I try to follow is

NULL == p

p = NULL
Steelman

Re: Crafty 22.8

Post by Steelman »

The old "lint" would find that.