Revision: 42088
http://brlcad.svn.sourceforge.net/brlcad/?rev=42088&view=rev
Author: brlcad
Date: 2011-01-11 21:37:35 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
make ars parameters be unsigned size_t types as well.
Modified Paths:
--------------
brlcad/trunk/include/rtgeom.h
brlcad/trunk/src/librt/primitives/ars/ars.c
brlcad/trunk/src/librt/primitives/ars/ars_mirror.c
Modified: brlcad/trunk/include/rtgeom.h
===================================================================
--- brlcad/trunk/include/rtgeom.h 2011-01-11 21:26:23 UTC (rev 42087)
+++ brlcad/trunk/include/rtgeom.h 2011-01-11 21:37:35 UTC (rev 42088)
@@ -164,8 +164,8 @@
*/
struct rt_ars_internal {
unsigned long magic;
- int ncurves;
- int pts_per_curve;
+ size_t ncurves;
+ size_t pts_per_curve;
fastf_t **curves;
};
#define RT_ARS_CK_MAGIC(_p) BU_CKMAG(_p, RT_ARS_INTERNAL_MAGIC,
"rt_ars_internal")
Modified: brlcad/trunk/src/librt/primitives/ars/ars.c
===================================================================
--- brlcad/trunk/src/librt/primitives/ars/ars.c 2011-01-11 21:26:23 UTC (rev
42087)
+++ brlcad/trunk/src/librt/primitives/ars/ars.c 2011-01-11 21:37:35 UTC (rev
42088)
@@ -146,7 +146,7 @@
{
struct rt_ars_internal *ari;
union record *rp;
- register int i, j;
+ register size_t i, j;
vect_t base_vect;
int currec;
@@ -224,9 +224,9 @@
struct rt_ars_internal *arip;
union record *rec;
point_t base_pt;
- int per_curve_grans;
- int cur; /* current curve number */
- int gno; /* current granule number */
+ size_t per_curve_grans;
+ size_t cur; /* current curve number */
+ size_t gno; /* current granule number */
RT_CK_DB_INTERNAL(ip);
if (dbip) RT_CK_DBI(dbip);
@@ -254,7 +254,7 @@
gno = 1;
for (cur=0; cur<arip->ncurves; cur++) {
register fastf_t *fp;
- int npts;
+ size_t npts;
int left;
fp = arip->curves[cur];
@@ -301,7 +301,7 @@
rt_ars_import5(struct rt_db_internal *ip, const struct bu_external *ep, const
fastf_t *mat, const struct db_i *dbip)
{
struct rt_ars_internal *ari;
- register int i, j;
+ register size_t i, j;
register unsigned char *cp;
vect_t tmp_vec;
register fastf_t *fp;
@@ -358,7 +358,7 @@
struct rt_ars_internal *arip;
unsigned char *cp;
vect_t tmp_vec;
- int cur; /* current curve number */
+ size_t cur; /* current curve number */
RT_CK_DB_INTERNAL(ip);
if (ip->idb_type != ID_ARS) return -1;
@@ -380,7 +380,7 @@
for (cur=0; cur<arip->ncurves; cur++) {
register fastf_t *fp;
- int npts;
+ size_t npts;
fp = arip->curves[cur];
for (npts=0; npts < arip->pts_per_curve; npts++) {
@@ -404,16 +404,15 @@
int
rt_ars_describe(struct bu_vls *str, const struct rt_db_internal *ip, int
verbose, double mm2local)
{
- register int j;
+ register size_t i, j;
register struct rt_ars_internal *arip =
(struct rt_ars_internal *)ip->idb_ptr;
char buf[256];
- int i;
RT_ARS_CK_MAGIC(arip);
bu_vls_strcat(str, "arbitrary rectangular solid (ARS)\n");
- sprintf(buf, "\t%d curves, %d points per curve\n",
+ sprintf(buf, "\t%lu curves, %lu points per curve\n",
arip->ncurves, arip->pts_per_curve);
bu_vls_strcat(str, buf);
@@ -431,7 +430,7 @@
for (i=0; i < arip->ncurves; i++) {
register fastf_t *v = arip->curves[i];
- sprintf(buf, "\tCurve %d:\n", i);
+ sprintf(buf, "\tCurve %lu:\n", i);
bu_vls_strcat(str, buf);
for (j=0; j < arip->pts_per_curve; j++) {
sprintf(buf, "\t\t(%g, %g, %g)\n",
@@ -457,7 +456,7 @@
rt_ars_ifree(struct rt_db_internal *ip)
{
register struct rt_ars_internal *arip;
- register int i;
+ register size_t i;
RT_CK_DB_INTERNAL(ip);
arip = (struct rt_ars_internal *)ip->idb_ptr;
@@ -483,9 +482,9 @@
int
rt_ars_tess(struct nmgregion **r, struct model *m, struct rt_db_internal *ip,
const struct rt_tess_tol *UNUSED(ttol), const struct bn_tol *tol)
{
- register int i;
- register int j;
- register int k;
+ register size_t i;
+ register size_t j;
+ register size_t k;
struct rt_ars_internal *arip;
struct shell *s;
struct vertex **verts;
@@ -629,7 +628,7 @@
bu_free((char *)verts, "rt_ars_tess *verts[]");
/* kill any degenerate faces that may have been created */
- for (i=0; i<BU_PTBL_END(&kill_fus); i++) {
+ for (i=0; i<(size_t)BU_PTBL_END(&kill_fus); i++) {
fu = (struct faceuse *)BU_PTBL_GET(&kill_fus, i);
NMG_CK_FACEUSE(fu);
(void)nmg_kfu(fu);
@@ -1151,8 +1150,8 @@
int
rt_ars_plot(struct bu_list *vhead, struct rt_db_internal *ip, const struct
rt_tess_tol *UNUSED(ttol), const struct bn_tol *UNUSED(tol))
{
- register int i;
- register int j;
+ register size_t i;
+ register size_t j;
struct rt_ars_internal *arip;
BU_CK_LIST_HEAD(vhead);
@@ -1189,7 +1188,7 @@
rt_ars_get(struct bu_vls *logstr, const struct rt_db_internal *intern, const
char *attr)
{
register struct rt_ars_internal *ars=(struct rt_ars_internal
*)intern->idb_ptr;
- int i, j;
+ size_t i, j;
RT_ARS_CK_MAGIC(ars);
@@ -1258,7 +1257,7 @@
rt_ars_adjust(struct bu_vls *logstr, struct rt_db_internal *intern, int argc,
const char **argv)
{
struct rt_ars_internal *ars;
- int i, j, k;
+ size_t i, j, k;
int len;
fastf_t *array;
Modified: brlcad/trunk/src/librt/primitives/ars/ars_mirror.c
===================================================================
--- brlcad/trunk/src/librt/primitives/ars/ars_mirror.c 2011-01-11 21:26:23 UTC
(rev 42087)
+++ brlcad/trunk/src/librt/primitives/ars/ars_mirror.c 2011-01-11 21:37:35 UTC
(rev 42088)
@@ -52,8 +52,8 @@
point_t mirror_pt;
fastf_t ang;
- int i;
- int j;
+ size_t i;
+ size_t j;
fastf_t *tmp_curve;
static point_t origin = {0.0, 0.0, 0.0};
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits