Chipmunk compliling issues

Discuss any Chipmunk bugs here.
Post Reply
marco.lizza
Posts: 1
Joined: Tue May 26, 2015 5:54 pm
Contact:

Chipmunk compliling issues

Post by marco.lizza »

Hello there.

I'm trying and compile Chipmunk 7 with MSVC but I found several issues.

The most annoying is that the source files are not C (pedantic ANSI/C89) compliant, in the sense that in the body of the functions the variable-declarations are intersped with code statements. In order to be compiled, a full revision of the code-base is needed.

Or you can switch to GCC, move to C99 (with MSVC2013)... or switch and compile as C++.

I think that ANSI/C89 should be supported and I will happily take a stab and change them by myself.

Moreover, I suspect I found another issue. In the "cpPolyline.cp" some post-allocation casts are missing (they are permitted by C, but not in C++) and the line buffers are wrongly allocated, for example

Code: Select all

cpPolylineSet *
cpPolylineSetInit(cpPolylineSet *set)
{
	set->count = 0;
	set->capacity = 8;
	set->lines = cpcalloc(set->capacity, sizeof(cpPolyline));
	
  return set;
}
should be

Code: Select all

cpPolylineSet *
cpPolylineSetInit(cpPolylineSet *set)
{
	set->count = 0;
	set->capacity = 8;
	set->lines = (cpPolyline **)cpcalloc(set->capacity, sizeof(cpPolyline *));
	
  return set;
}
and similiar problem is in the "cpPolylineSetPush()" function.

Should I make a pull request for these?

Thanks in advance.
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 3 guests