View previous topic :: View next topic |
Author |
Message |
w2drz
Joined: 27 Dec 2006 Posts: 55 Location: Western New York - USA
|
sin int 32 subtraction of minus sign data problem |
Posted: Sat Nov 24, 2007 1:05 pm |
|
|
using CCS 3.249 compler
18F4580 PICC
20 MHz
I can do a work around but it would not be nice!!
so and suggestions would be good
tom
problem found and it is not a compiler problem,
thanks to all
tom
Last edited by w2drz on Sun Nov 25, 2007 6:50 pm; edited 3 times in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Nov 24, 2007 2:37 pm |
|
|
Look at your post before you submit it. You have little pieces of the
"code" block symbols before and after your code. Delete those.
Also, the first one must say "code". The last one (at the end) must
say "/code". Both must be inside brackets. Edit your post and fix
all those things. |
|
|
Ttelmah Guest
|
|
Posted: Sat Nov 24, 2007 3:30 pm |
|
|
Also, post your declaration of SINT32. Since this is not a native type, you are presumably declaring it somewhere, and just occassionally, declarations like this, don't function quite as you expect.
Best Wishes |
|
|
SET
Joined: 15 Nov 2005 Posts: 161 Location: Glasgow, UK
|
|
Posted: Sun Nov 25, 2007 1:44 pm |
|
|
Code: | void AdjustZIndexes (IndexData *pIdx, SINT32 diff)
{
int i;
for (i=0; i < 16; ++i) {
if (pIdx->IArray [i] == 0)
break; // no more
pIdx->IArray [i] += diff;
}
} |
Are you saying that the routine above always *added* 'diff' (even if it was negative)? |
|
|
|