20070827

Patch to aggdraw for 64 bit machines


diff -Naur aggdraw-1.1-20051010/agg2/include/agg_array.h
aggdraw-1.1-20051010-64/agg2/include/agg_array.h
--- aggdraw-1.1-20051010/agg2/include/agg_array.h 2005-05-03
17:57:34.000000000 +0530
+++ aggdraw-1.1-20051010-64/agg2/include/agg_array.h 2007-08-22
00:19:48.000000000 +0530
@@ -520,7 +520,7 @@
int8u* ptr = m_buf_ptr;
if(alignment > 1)
{
- unsigned align = (alignment - unsigned(ptr) %
alignment) % alignment;
+ unsigned align = (alignment - (unsigned
long)(ptr) % alignment) % alignment;
size += align;
ptr += align;
if(size <= m_rest)



  • Platform :Linux, Python/C++
  • Script : Diff Patch
  • desc :

    This patch lets aggdraw compile and work fine for my requirement. But
    I haven't extensively tested it. YMMV.


4 comments:

Osirius said...

Thanks! This solution saved me!

I re-posted your solution to my blog because blogger seems to have mangled your diff a bit. I hope that's ok.

physicsnick said...

I would recommend casting to size_t, not unsigned long, that way you're not changing the behavior on i386.

Vincent said...

Thanks for the diff, it worked fine for me!

harijay said...

Thanks for this patch which helps aggdraw compile on 64 bit systems