1. ## parse error?

What is this error?

error: parse error before "YUV"

Code:
```YUV	  *QMUL_format_converter(Image* image)
{
size = image->width * image->height;

YUV *yuv = (YUV *) malloc(sizeof(YUV));

yuv->y   = (int *) malloc(size);
yuv->u   = (int *) malloc(size);
yuv->v   = (int *) malloc(size);

for(i=0;i<=size;i++){
*(yuv->y + i) = (0.257) * (*image->data + (i*3)) + (0.504) * (*image->data + (i*3+1)) + (0.098) * (*image->data + (i*3+2)) + 16;

*(yuv->u + i) = (0.439) * (*image->data + (i*3)) + (0.368) * (*image->data + (i*3+1)) - (0.071) * (*image->data + (i*3+2)) + 128;

*(yuv->v + i) =(-0.148) * (*image->data + (i*3)) - (0.291) * (*image->data + (i*3+1)) + (0.439) * (*image->data + (i*3+2)) + 128;
}

return YUV;
}```

2. > YUV *yuv = (YUV *) malloc(sizeof(YUV));
1. It's a declaration after a statement - this isn't allowed in C
2. You're casting malloc.

3. Also, is 'return YUV;' what you want? (YUV is a typedef ... not a struct pointer)

4. Originally Posted by eerok
Also, is 'return YUV;' what you want? (YUV is a typedef ... not a struct pointer)
It's a typedef and a structure.

5. Ok solved it... the return was meant to be 'yuv' not 'YUV'

How annoying,

6. See what having stupid variable names gets you?

Quzah.

7. Originally Posted by cblix
Originally Posted by eerok
Also, is 'return YUV;' what you want? (YUV is a typedef ... not a struct pointer)
It's a typedef and a structure.
Ok solved it... the return was meant to be 'yuv' not 'YUV'
I guess I'll have to learn to be less subtle around here