From c994980764451ac4845afb836c7c10a6074c4012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 19 Oct 2013 02:53:17 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Fix a structure declaration for ARM architecture. [GB.CLIPPER] * BUG: Fix the signature of some methods. git-svn-id: svn://localhost/gambas/trunk@5900 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_variant.h | 3 +++ main/lib/clipper/c_clipper.cpp | 17 +++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/main/gbx/gbx_variant.h b/main/gbx/gbx_variant.h index f8125eb6f..050e7fd21 100644 --- a/main/gbx/gbx_variant.h +++ b/main/gbx/gbx_variant.h @@ -28,6 +28,8 @@ #include "gbx_string.h" #include "gbx_object.h" +// On ARM 32 bits, sizeof(VARIANT) = 12, so it must be packed like GB_VARIANT + typedef struct { @@ -48,6 +50,7 @@ typedef } value; } + PACKED VARIANT; #define VARIANT_copy_value(_dst, _src) (_dst)->value.data = (_src)->value.data diff --git a/main/lib/clipper/c_clipper.cpp b/main/lib/clipper/c_clipper.cpp index 00b736605..95f7059d3 100644 --- a/main/lib/clipper/c_clipper.cpp +++ b/main/lib/clipper/c_clipper.cpp @@ -385,7 +385,8 @@ static void execute(ClipType action, PolyFillType fill, void *subject, void *cli return; c.AddPolygons(psubject, ptSubject); - c.AddPolygons(pclip, ptClip); + if (clip) + c.AddPolygons(pclip, ptClip); c.Execute(action, result, fill, fill); @@ -439,7 +440,7 @@ GB_DESC PolygonDesc[] = GB_METHOD("Add", NULL, Polygon_Add, "(X)f(Y)f"), GB_METHOD("AddPoint", NULL, Polygon_AddPoint, "(Point)Point;"), - GB_METHOD("Remove", NULL, Polygon_Remove, "(Index)i[Count)i]"), + GB_METHOD("Remove", NULL, Polygon_Remove, "(Index)i[(Count)i]"), GB_INTERFACE("_convert", &_convert_polygon), @@ -450,10 +451,6 @@ GB_DESC ClipperDesc[] = { GB_DECLARE_VIRTUAL("Clipper"), - //void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, double delta, JoinType jointype = jtSquare, double limit = 0.0, bool autoFix = true); - //void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys, PolyFillType fillType = pftEvenOdd); - //void CleanPolygons(Polygons &in_polys, Polygon &out_polys, double distance = 1.415); - GB_CONSTANT("JoinMiter", "i", jtMiter), GB_CONSTANT("JoinSquare", "i", jtSquare), GB_CONSTANT("JoinRound", "i", jtRound), @@ -468,10 +465,10 @@ GB_DESC ClipperDesc[] = GB_STATIC_METHOD("Simplify", "Polygon[]", Clipper_Simplify, "(Polygons)Polygon[];[(Fill)i]"), GB_STATIC_METHOD("Clean", "Polygon[]", Clipper_Clean, "(Polygons)Polygon[];[(Distance)f]"), - GB_STATIC_METHOD("Union", "Polygon[]", Clipper_Union, "(Polygons)Polygon[];[(Clip)Polygon[];[(Fill)i]"), - GB_STATIC_METHOD("Intersection", "Polygon[]", Clipper_Intersection, "(Polygons)Polygon[];[(Clip)Polygon[];[(Fill)i]"), - GB_STATIC_METHOD("Difference", "Polygon[]", Clipper_Difference, "(Polygons)Polygon[];[(Clip)Polygon[];[(Fill)i]"), - GB_STATIC_METHOD("ExclusiveOr", "Polygon[]", Clipper_ExclusiveOr, "(Polygons)Polygon[];[(Clip)Polygon[];[(Fill)i]"), + GB_STATIC_METHOD("Union", "Polygon[]", Clipper_Union, "(Polygons)Polygon[];[(Clip)Polygon[];(Fill)i]"), + GB_STATIC_METHOD("Intersection", "Polygon[]", Clipper_Intersection, "(Polygons)Polygon[];[(Clip)Polygon[];(Fill)i]"), + GB_STATIC_METHOD("Difference", "Polygon[]", Clipper_Difference, "(Polygons)Polygon[];[(Clip)Polygon[];(Fill)i]"), + GB_STATIC_METHOD("ExclusiveOr", "Polygon[]", Clipper_ExclusiveOr, "(Polygons)Polygon[];[(Clip)Polygon[];(Fill)i]"), GB_END_DECLARE };