Pumpkin, Inc.

Pumpkin User Forums

POSSIBLE mistake in SALVO2.2 !

If you can't make Salvo do what you want it to do, post it here.

POSSIBLE mistake in SALVO2.2 !

Postby luben » Fri Jul 06, 2001 8:00 am

Hello,


Looking into your SALVO.H files I accidentally felt on a place that I think is a mistake, or maybe I wrong.

code:


// line 983
#define OSTA_TIMEDOUT 6 /* 110b */


.................


// line 1829

#define OSTimedOut() OScTcbP->u.runStatus.state && OSTA_TIMEDOUT



It's not hard to see that using the OSTimedOut() will return always u.runStatus.state , just because one of the arguments of the function (&&) is always TRUE.

I looked at the old SALVO2.1 SALVO.H and I saw that there is used (==) instead of (&&) - I think this is more meaningful. In fact you're looking for OSTA_TIMEDOUT == 6 (timed out). Using && has different meaning and because one argument in macro is always TRUE, there is no sense to add it into macro at all. I mean, if && is the right logical operation then why in the macro you put argument that is always TRUE.

Or I wrong somewhere?

Luben

[This message has been edited by luben (edited July 06, 2001).]

[This message has been edited by luben (edited July 06, 2001).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron