(Small) error in xs1.h ?

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

(Small) error in xs1.h ?

Post by lilltroll »

Check out this example:

Code: Select all

#include <platform.h>
#include <xs1.h>
#include <print.h>

int main(){
	chan c_tokens;

	par{
		on stdcore[0]:{
			//void outct  ( chanend  c,  unsigned char  val)
			outct(c_tokens,8);
		}on stdcore[1]:{
		char token=0;
		//void inct_byref  ( chanend  c,  unsigned &  val   )
		inct_byref(c_tokens, token);
		printint(token);}
		}
	return 0;
}
And look at this from xs1.h

Code: Select all

void inct_byref(chanend c, unsigned &val);
#define inct_byref(c, val)                   __builtin_inct_byref(c, val)
Isn't a control token always 8 bits, e.g. a char, and the unsigned should be changed to a char in both the xs1.h and the documentation!?
(Writing unsigned token=0; doesn't compile)


Probably not the most confused programmer anymore on the XCORE forum.
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

Thanks for pointing this out. This will be fixed in the next release.