1. Fix many signed/unsigned comparisons
2. Avoid having multiple C files with the same name
3. Add return statements after failing asserts, just to calm the compiler
21 files changed:
+ g_assert_not_reached ();
+ g_assert_not_reached ();
+ /* Return a value to silence some compilers */
+ return -1;
{
return THIS->points_[1];
}
{
return THIS->points_[1];
}
+
+ g_assert_not_reached ();
+ /* Return a value to silence some compilers */
+ return NULL;
}
/* The point counter-clockwise to given point */
}
/* The point counter-clockwise to given point */
{
return THIS->points_[0];
}
{
return THIS->points_[0];
}
+ g_assert_not_reached ();
+ /* Return a value to silence some compilers */
+ return NULL;
}
/* The neighbor clockwise to given point */
}
/* The neighbor clockwise to given point */
void
p2t_sweep_destroy (P2tSweep* THIS)
{
void
p2t_sweep_destroy (P2tSweep* THIS)
{
/* Clean up memory */
for (i = 0; i < THIS->nodes_->len; i++)
{
/* Clean up memory */
for (i = 0; i < THIS->nodes_->len; i++)
{
void
p2t_sweep_sweep_points (P2tSweep *THIS, P2tSweepContext *tcx)
{
void
p2t_sweep_sweep_points (P2tSweep *THIS, P2tSweepContext *tcx)
{
for (i = 1; i < p2t_sweepcontext_point_count (tcx); i++)
{
P2tPoint* point = p2t_sweepcontext_get_point (tcx, i);
for (i = 1; i < p2t_sweepcontext_point_count (tcx); i++)
{
P2tPoint* point = p2t_sweepcontext_get_point (tcx, i);
- /*throw new RuntimeException("[Unsupported] Opposing point on constrained edge");*/
- assert (0);
+ g_error ("[Unsupported] Opposing point on constrained edge");
+ /* Return a value to silence some compilers */
+ return NULL;
void
p2t_sweepcontext_init (P2tSweepContext* THIS, P2tPointPtrArray polyline)
{
void
p2t_sweepcontext_init (P2tSweepContext* THIS, P2tPointPtrArray polyline)
{
THIS->front_ = NULL;
THIS->head_ = NULL;
THIS->front_ = NULL;
THIS->head_ = NULL;
p2t_sweepcontext_destroy (P2tSweepContext* THIS)
{
GList* iter;
p2t_sweepcontext_destroy (P2tSweepContext* THIS)
{
GList* iter;
/* Clean up memory */
p2t_point_free (THIS->head_);
/* Clean up memory */
p2t_point_free (THIS->head_);
void
p2t_sweepcontext_add_hole (P2tSweepContext *THIS, P2tPointPtrArray polyline)
{
void
p2t_sweepcontext_add_hole (P2tSweepContext *THIS, P2tPointPtrArray polyline)
{
p2t_sweepcontext_init_edges (THIS, polyline);
for (i = 0; i < polyline->len; i++)
{
p2t_sweepcontext_init_edges (THIS, polyline);
for (i = 0; i < polyline->len; i++)
{
void
p2t_sweepcontext_init_triangulation (P2tSweepContext *THIS)
{
void
p2t_sweepcontext_init_triangulation (P2tSweepContext *THIS)
{
double xmax = point_index (THIS->points_, 0)->x, xmin = point_index (THIS->points_, 0)->x;
double ymax = point_index (THIS->points_, 0)->y, ymin = point_index (THIS->points_, 0)->y;
double dx, dy;
double xmax = point_index (THIS->points_, 0)->x, xmin = point_index (THIS->points_, 0)->x;
double ymax = point_index (THIS->points_, 0)->y, ymin = point_index (THIS->points_, 0)->y;
double dx, dy;
#include "edge.h"
#include "vedge.h"
#include "edge.h"
#include "vedge.h"
-#include "cdt.h"
-#include "utils.h"
+#include "rcdt.h"
+#include "rutils.h"
/**
* Flip-Fix all the virtual edges inside the given set
/**
* Flip-Fix all the virtual edges inside the given set
#include <math.h>
#include <glib.h>
#include <math.h>
#include <glib.h>
#include "point.h"
#include "edge.h"
#include "point.h"
#include "edge.h"
#include <math.h>
#include <glib.h>
#include <math.h>
#include <glib.h>
#include "rmath.h"
#include "point.h"
#include "rmath.h"
#include "point.h"
#include "triangle.h"
#include "mesh.h"
#include "triangle.h"
#include "mesh.h"
#include "cluster.h"
#include "vedge.h"
#include "cluster.h"
#include "vedge.h"
{
P2trCluster *startCluster = p2tr_cluster_get_for (P2TR_EDGE_START(s), s);
P2trCluster *endCluster = p2tr_cluster_get_for (s->end, s);
{
P2trCluster *startCluster = p2tr_cluster_get_for (P2TR_EDGE_START(s), s);
P2trCluster *endCluster = p2tr_cluster_get_for (s->end, s);
+ P2trCluster *S_NOREF = NULL;
GList *iter;
gboolean permitted = FALSE;
GList *iter;
gboolean permitted = FALSE;
#define __P2TC_REFINE_DELAUNAY_TERMINATOR_H__
#include <glib.h>
#define __P2TC_REFINE_DELAUNAY_TERMINATOR_H__
#include <glib.h>
#include "refiner.h"
#include "vedge.h"
#include "refiner.h"
#include "vedge.h"
#include "mesh.h"
#include "point.h"
#include "mesh.h"
#include "point.h"
#include <stdio.h>
#include <glib.h>
#include "vector2.h"
#include <stdio.h>
#include <glib.h>
#include "vector2.h"
#include "triangulation.h"
/**
#include "triangulation.h"
/**
#ifndef __P2TC_REFINE_PSLG_H__
#define __P2TC_REFINE_PSLG_H__
#ifndef __P2TC_REFINE_PSLG_H__
#define __P2TC_REFINE_PSLG_H__
#include "vector2.h"
#include "line.h"
#include "bounded-line.h"
#include "vector2.h"
#include "line.h"
#include "bounded-line.h"
#include "edge.h"
#include "triangle.h"
#include "edge.h"
#include "triangle.h"
#include "visibility.h"
#include "cdt-flipfix.h"
#include "visibility.h"
#include "cdt-flipfix.h"
P2trVEdgeSet *new_edges = p2tr_vedge_set_new ();
P2trVEdgeSet *new_edges = p2tr_vedge_set_new ();
rmesh->mesh = p2tr_mesh_new ();
rmesh->outline = p2tr_pslg_new ();
rmesh->mesh = p2tr_mesh_new ();
rmesh->outline = p2tr_pslg_new ();
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __P2TC_REFINE_CDT_H__
-#define __P2TC_REFINE_CDT_H__
+#ifndef __P2TC_REFINE_RCDT_H__
+#define __P2TC_REFINE_RCDT_H__
#include <poly2tri-c/p2t/poly2tri.h>
#include "mesh.h"
#include <poly2tri-c/p2t/poly2tri.h>
#include "mesh.h"
#ifndef __P2TC_REFINE_H__
#define __P2TC_REFINE_H__
#ifndef __P2TC_REFINE_H__
#define __P2TC_REFINE_H__
#include "rmath.h"
#include "vector2.h"
#include "rmath.h"
#include "vector2.h"
#include "vtriangle.h"
#include "cluster.h"
#include "vtriangle.h"
#include "cluster.h"
#include "refiner.h"
#endif
#include "refiner.h"
#endif
#include "delaunay-terminator.h"
#include "refiner.h"
#include "delaunay-terminator.h"
#include "refiner.h"
#define __P2TC_REFINE_REFINER_H__
#include <glib.h>
#define __P2TC_REFINE_REFINER_H__
#include <glib.h>
typedef struct P2trRefiner_ P2trRefiner;
typedef struct P2trRefiner_ P2trRefiner;
#include <stdarg.h>
#include <glib.h>
#include <stdarg.h>
#include <glib.h>
GList*
p2tr_utils_new_reversed_pointer_list (int count, ...)
GList*
p2tr_utils_new_reversed_pointer_list (int count, ...)
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __P2TC_REFINE_UTILS_H__
-#define __P2TC_REFINE_UTILS_H__
+#ifndef __P2TC_REFINE_RUTILS_H__
+#define __P2TC_REFINE_RUTILS_H__
#ifdef __cplusplus
extern "C"
#ifdef __cplusplus
extern "C"
#include <math.h>
#include <glib.h>
#include <math.h>
#include <glib.h>
#include "rmath.h"
#include "point.h"
#include "rmath.h"
#include "point.h"
#define __P2TC_REFINE_VEDGE_H__
#include <glib.h>
#define __P2TC_REFINE_VEDGE_H__
#include <glib.h>
#include "triangulation.h"
/**
#include "triangulation.h"
/**
guint line_count)
{
P2trPSLG *edges = p2tr_pslg_new ();
guint line_count)
{
P2trPSLG *edges = p2tr_pslg_new ();
gboolean result;
for (i = 0; i < line_count; i++)
gboolean result;
for (i = 0; i < line_count; i++)
gint dest_len,
P2trImageConfig *config)
{
gint dest_len,
P2trImageConfig *config)
{
- gint x, y, n = dest_len;
+ guint x, y, n = dest_len;
P2trUVT *uvt = dest;
P2trTriangle *tr_prev = NULL;
P2trVector2 pt;
P2trUVT *uvt = dest;
P2trTriangle *tr_prev = NULL;
P2trVector2 pt;