Welcome! Log In Create A New Profile

Advanced

error: pointer of type 'void *' used in arithmetic

Posted by noob 
error: pointer of type 'void *' used in arithmetic
April 13, 2009 03:40AM
I don't get it. I don't see whats wrong.

Can someone please tell me whats wrong with this?

main.cpp: In function 'void drawPng(const unsigned char*, u16, u16)':
main.cpp:45: error: pointer of type 'void *' used in arithmetic
main.cpp:45: error: pointer of type 'void *' used in arithmetic

void drawPng(const unsigned char *img, u16 x, u16 y) {

	IMGCTX ctx;
	PNGUPROP imgProp;
	
	ctx = PNGU_SelectImageFromBuffer(img);
	PNGU_GetImageProperties(ctx, &imgProp);
	
ln 45	PNGU_DECODE_TO_COORDS_YCbYCr(ctx, x, y, imgProp.imgWidth, imgProp.imgHeight, rmode->fbWidth, rmode->xfbHeight, xfb);

}



Edited 1 time(s). Last edit at 04/13/2009 03:46AM by noob.
Re: error: pointer of type 'void *' used in arithmetic
April 13, 2009 07:14AM
Solved it. Some reason it didn't want to compile as cpp, but would as c.

Edited pngu.h

// Macro for decoding an image inside a buffer at given coordinates.
#define PNGU_DECODE_TO_COORDS_YCbYCr(ctx,coordX,coordY,imgWidth,imgHeight,bufferWidth,bufferHeight,buffer)	\
																											\
		PNGU_DecodeToYCbYCr (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 +	\
							(coordX) * 2, (bufferWidth) - (imgWidth))

changed (void *) to (u32 *)
Sorry, only registered users may post in this forum.

Click here to login