From aab6f298b3d34c3e7d15ee662323faf528e880a6 Mon Sep 17 00:00:00 2001 From: Brad Barber <bradb@shore.net> Date: Mon, 4 Jan 2010 21:35:19 -0500 Subject: [PATCH] Fix QhullPoints for size_t casts. Revert amorilia's datatyping of old_qhstat and tempstack (needs further review). Fix spacing on output and remove blank line on error --- cpp/QhullPoints.cpp | 4 ++-- cpp/QhullPoints.h | 4 ++-- src/Changes.txt | 4 ++++ src/libqhull.c | 6 +++--- src/libqhull.h | 2 +- src/mem.h | 6 +++--- src/poly2.c | 10 ++++------ src/stat.c | 6 +++--- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/cpp/QhullPoints.cpp b/cpp/QhullPoints.cpp index e9f1480..7123289 100644 --- a/cpp/QhullPoints.cpp +++ b/cpp/QhullPoints.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoints.cpp#18 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoints.cpp#19 $$Change: 1145 $ +** $DateTime: 2010/01/04 21:10:14 $$Author: bbarber $ ** ****************************************************************************/ diff --git a/cpp/QhullPoints.h b/cpp/QhullPoints.h index 50df2f9..ad93237 100644 --- a/cpp/QhullPoints.h +++ b/cpp/QhullPoints.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2010 C.B. Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoints.h#26 $$Change: 1139 $ -** $DateTime: 2010/01/03 11:20:29 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoints.h#27 $$Change: 1145 $ +** $DateTime: 2010/01/04 21:10:14 $$Author: bbarber $ ** ****************************************************************************/ diff --git a/src/Changes.txt b/src/Changes.txt index 60b06fc..682ec63 100644 --- a/src/Changes.txt +++ b/src/Changes.txt @@ -90,6 +90,10 @@ To do - Add test of user_eg3, etc. - Add vcproj for qconvex, etc. - Review all ptr_intT + - Change tabs to spaces in src/*.c *.h + - Reconsider old_qhstat data type (amorilia) + libqhull.h: qhstatT *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ + mem.h: setT *tempstack; /* stack of temporary memory, managed by users */ - Run qhull regression tests diff --git a/src/libqhull.c b/src/libqhull.c index 492dc44..c985695 100644 --- a/src/libqhull.c +++ b/src/libqhull.c @@ -11,8 +11,8 @@ see qhull_a.h for internal functions copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/libqhull.c#3 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/libqhull.c#4 $$Change: 1147 $ + $DateTime: 2010/01/04 21:29:16 $$Author: bbarber $ */ #include "qhull_a.h" @@ -1353,7 +1353,7 @@ Convex hull of %d points in %d-d:\n\n", size, qh hull_dim); cpu= (float)qh hulltime; cpu /= (float)qh_SECticks; wval_(Wcpu)= cpu; - qh_fprintf(fp, 9333, " CPU seconds to compute hull(after input): %2.4g\n", cpu); + qh_fprintf(fp, 9333, " CPU seconds to compute hull (after input): %2.4g\n", cpu); } if (qh RERUN) { if (!qh PREmerge && !qh MERGEexact) diff --git a/src/libqhull.h b/src/libqhull.h index f9a9093..43f0e95 100644 --- a/src/libqhull.h +++ b/src/libqhull.h @@ -751,7 +751,7 @@ struct qhT { realT last_newhigh; unsigned lastreport; /* for qh_buildtracing */ int mergereport; /* for qh_tracemerging */ - qhstatT *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ + void *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ setT *old_tempstack; /* for saving qhmem.tempstack in save_qhull */ int ridgeoutnum; /* number of ridges for 4OFF output (qh_printbegin,etc) */ }; diff --git a/src/mem.h b/src/mem.h index 62ac64f..8bd98f7 100644 --- a/src/mem.h +++ b/src/mem.h @@ -12,8 +12,8 @@ qh_errexit(qhmem_ERRqhull, NULL, NULL) otherwise copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/mem.h#26 $$Change: 1144 $ - $DateTime: 2010/01/04 18:23:37 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/mem.h#27 $$Change: 1148 $ + $DateTime: 2010/01/04 21:34:40 $$Author: bbarber $ */ #ifndef qhDEFmem @@ -115,7 +115,7 @@ struct qhmemT { /* global memory management variables */ void *curbuffer; /* current buffer, linked by offset 0 */ void *freemem; /* free memory in curbuffer */ int freesize; /* size of freemem in bytes */ - setT *tempstack; /* stack of temporary memory, managed by users */ + void *tempstack; /* stack of temporary memory, managed by users */ FILE *ferr; /* file for reporting errors, only user is qh_fprintf() */ int IStracing; /* =5 if tracing memory allocations */ int cntquick; /* count of quick allocations */ diff --git a/src/poly2.c b/src/poly2.c index eb37615..49fdbe6 100644 --- a/src/poly2.c +++ b/src/poly2.c @@ -9,8 +9,8 @@ frequently used code is in poly.c copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly2.c#36 $$Change: 1144 $ - $DateTime: 2010/01/04 18:23:37 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly2.c#37 $$Change: 1147 $ + $DateTime: 2010/01/04 21:29:16 $$Author: bbarber $ */ #include "qhull_a.h" @@ -328,8 +328,7 @@ void qh_check_points(void) { total= (float)qh num_facets * (float)qh num_points; if (total >= qh_VERIFYdirect && !qh maxoutdone) { if (!qh_QUICKhelp && qh SKIPcheckmax && qh MERGING) - qh_fprintf(qh ferr, 7075, "\n\ -qhull input warning: merging without checking outer planes('Q5' or 'Po').\n\ + qh_fprintf(qh ferr, 7075, "qhull input warning: merging without checking outer planes('Q5' or 'Po').\n\ Verify may report that a point is outside of a facet.\n"); qh_check_bestdist(); }else { @@ -339,8 +338,7 @@ Verify may report that a point is outside of a facet.\n"); testouter= False; if (!qh_QUICKhelp) { if (qh MERGEexact) - qh_fprintf(qh ferr, 7076, "\n\ -qhull input warning: exact merge ('Qx'). Verify may report that a point\n\ + qh_fprintf(qh ferr, 7076, "qhull input warning: exact merge ('Qx'). Verify may report that a point\n\ is outside of a facet. See qh-optq.htm#Qx\n"); else if (qh SKIPcheckmax || qh NOnearinside) qh_fprintf(qh ferr, 7077, "\n\ diff --git a/src/stat.c b/src/stat.c index 0661125..530d148 100644 --- a/src/stat.c +++ b/src/stat.c @@ -7,8 +7,8 @@ see qh-stat.htm and stat.h copyright (c) 1993-2010 The Geometry Center. - $Id: //product/qhull/main/rel/src/stat.c#25 $$Change: 1137 $ - $DateTime: 2010/01/02 21:58:11 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/stat.c#26 $$Change: 1147 $ + $DateTime: 2010/01/04 21:29:16 $$Author: bbarber $ */ #include "qhull_a.h" @@ -45,7 +45,7 @@ void qh_allstatA(void) { zdef_(wmin, Wmindenom, "min. denominator in hyperplane computation", -1); qhstat precision= qhstat next; /* call qh_precision for each of these */ - zzdef_(zdoc, Zdoc3, "precision problems(corrected unless 'Q0' or an error)", -1); + zzdef_(zdoc, Zdoc3, "precision problems (corrected unless 'Q0' or an error)", -1); zzdef_(zinc, Zcoplanarridges, "coplanar half ridges in output", -1); zzdef_(zinc, Zconcaveridges, "concave half ridges in output", -1); zzdef_(zinc, Zflippedfacets, "flipped facets", -1); -- GitLab