Revision: 42073
http://brlcad.svn.sourceforge.net/brlcad/?rev=42073&view=rev
Author: brlcad
Date: 2011-01-11 08:49:32 +0000 (Tue, 11 Jan 2011)
Log Message:
-----------
more size_t quellage
Modified Paths:
--------------
brlcad/trunk/src/mged/animedit.c
brlcad/trunk/src/mged/chgtree.c
brlcad/trunk/src/mged/edars.c
brlcad/trunk/src/mged/edsol.c
brlcad/trunk/src/mged/titles.c
brlcad/trunk/src/mged/usepen.c
Modified: brlcad/trunk/src/mged/animedit.c
===================================================================
--- brlcad/trunk/src/mged/animedit.c 2011-01-11 08:33:42 UTC (rev 42072)
+++ brlcad/trunk/src/mged/animedit.c 2011-01-11 08:49:32 UTC (rev 42073)
@@ -2328,7 +2328,7 @@
}
if (BU_LIST_IS_EMPTY(&hp->j_head)) {
- int i, j;
+ size_t i, j;
int startjoint;
startjoint = -1;
if (joint_debug & DEBUG_J_SOLVE) {
@@ -2337,7 +2337,7 @@
}
for (BU_LIST_FOR(jp, joint, &joint_head)) {
if (hp->j_set.path.type == ARC_LIST) {
- for (i=0; i<= hp->j_set.path.arc_last; i++) {
+ for (i=0; i <= (size_t)hp->j_set.path.arc_last; i++) {
if (strcmp(jp->name, hp->j_set.path.arc[i]) == 0) {
BU_GETSTRUCT(jh, jointH);
jh->l.magic = MAGIC_JOINT_HANDLE;
@@ -2356,12 +2356,12 @@
hp->effector.path.fp_names[i]->d_namep)==0) break;
}
if (i+jp->path.arc_last >= hp->effector.path.fp_len) continue;
- for (j=1; j<=jp->path.arc_last;j++) {
+ for (j=1; j <= (size_t)jp->path.arc_last;j++) {
if (strcmp(jp->path.arc[j],
hp->effector.path.fp_names[i+j]->d_namep)
!= 0) break;
}
- if (j>jp->path.arc_last) {
+ if (j>(size_t)jp->path.arc_last) {
if (joint_debug & DEBUG_J_SOLVE) {
Tcl_AppendResult(INTERP, "part_solve: found ",
jp->name, "\n", (char *)NULL);
@@ -3410,7 +3410,7 @@
struct joint *
findjoint(const struct db_full_path *pathp)
{
- int i, j;
+ size_t i, j;
struct joint *jp;
int best;
struct joint *bestjp = NULL;
@@ -3427,7 +3427,7 @@
for (i=0; i< pathp->fp_len; i++) {
int good=1;
if (jp->path.arc_last+i >= pathp->fp_len) break;
- for (j=0; j<=jp->path.arc_last;j++) {
+ for (j=0; j<=(size_t)jp->path.arc_last;j++) {
if ((*pathp->fp_names[i+j]->d_namep != *jp->path.arc[j]) ||
(strcmp(pathp->fp_names[i+j]->d_namep, jp->path.arc[j])
!=0)) {
good=0;
@@ -3435,7 +3435,7 @@
}
}
- if (good && j>best) {
+ if (good && (long)j>best) {
best = j;
bestjp = jp;
}
Modified: brlcad/trunk/src/mged/chgtree.c
===================================================================
--- brlcad/trunk/src/mged/chgtree.c 2011-01-11 08:33:42 UTC (rev 42072)
+++ brlcad/trunk/src/mged/chgtree.c 2011-01-11 08:49:32 UTC (rev 42073)
@@ -283,7 +283,7 @@
(void)chg_state(ST_O_PICK, ST_O_PATH, "internal change of state");
/* Select the matrix */
- sprintf(number, "%d", lhs.fp_len);
+ sprintf(number, "%lu", lhs.fp_len);
new_argv[0] = "matpick";
new_argv[1] = number;
new_argv[2] = NULL;
Modified: brlcad/trunk/src/mged/edars.c
===================================================================
--- brlcad/trunk/src/mged/edars.c 2011-01-11 08:33:42 UTC (rev 42072)
+++ brlcad/trunk/src/mged/edars.c 2011-01-11 08:49:32 UTC (rev 42073)
@@ -52,7 +52,7 @@
point_t pick_pt,
vect_t dir)
{
- int i, j;
+ size_t i, j;
int pt_no;
int closest_i=0, closest_j=0;
fastf_t min_dist_sq=MAX_FASTF;
Modified: brlcad/trunk/src/mged/edsol.c
===================================================================
--- brlcad/trunk/src/mged/edsol.c 2011-01-11 08:33:42 UTC (rev 42072)
+++ brlcad/trunk/src/mged/edsol.c 2011-01-11 08:49:32 UTC (rev 42073)
@@ -1951,7 +1951,7 @@
{
struct rt_arbn_internal *arbn =
(struct rt_arbn_internal *)ip->idb_ptr;
- int i, j, k;
+ size_t i, j, k;
int good_vert = 0;
RT_ARBN_CK_MAGIC(arbn);
@@ -1959,7 +1959,7 @@
for (j=i+1; j<arbn->neqn; j++) {
for (k=j+1; k<arbn->neqn; k++) {
if (!bn_mkpoint_3planes(mpt, arbn->eqn[i],
arbn->eqn[j], arbn->eqn[k])) {
- int l;
+ size_t l;
good_vert = 1;
for (l=0; l<arbn->neqn; l++) {
@@ -4164,9 +4164,6 @@
}
}
- if (i < 0)
- i = 0;
-
if (i > 255)
i = 255;
@@ -4193,9 +4190,6 @@
}
}
- if (i < 0)
- i = 0;
-
if (i > 255)
i = 255;
@@ -4307,7 +4301,7 @@
{
struct rt_bot_internal *bot =
(struct rt_bot_internal *)es_int.idb_ptr;
- int face_no;
+ size_t face_no;
RT_BOT_CK_MAGIC(bot);
@@ -4340,7 +4334,7 @@
if (!inpara)
break;
- face_no = -1;
+ face_no = (size_t)-1;
for (i=0; i < bot->num_faces; i++) {
if (bot_verts[0] == bot->faces[i*3] &&
bot_verts[1] == bot->faces[i*3+1] &&
@@ -4350,7 +4344,7 @@
break;
}
}
- if (face_no < 0) {
+ if (face_no == (size_t)-1) {
bu_log("Cannot find face with vertices %d %d %d!\n",
V3ARGS(bot_verts));
break;
@@ -4414,7 +4408,7 @@
(struct rt_bot_internal *)es_int.idb_ptr;
char fmode[10];
const char *radio_result;
- int face_no;
+ size_t face_no;
int ret_tcl;
RT_BOT_CK_MAGIC(bot);
@@ -4435,10 +4429,10 @@
if (atoi(Tcl_GetStringResult(INTERP)))
break;
- face_no = -2;
+ face_no = (size_t)-2;
} else {
/* setting thickness for just one face */
- face_no = -1;
+ face_no = (size_t)-1;
for (i=0; i < bot->num_faces; i++) {
if (bot_verts[0] == bot->faces[i*3] &&
bot_verts[1] == bot->faces[i*3+1] &&
@@ -4448,14 +4442,14 @@
break;
}
}
- if (face_no < 0) {
+ if (face_no == (size_t)-1 || face_no == (size_t)-2) {
bu_log("Cannot find face with vertices %d %d %d!\n",
V3ARGS(bot_verts));
break;
}
}
- if (face_no > -1)
+ if (face_no != (size_t)-1)
sprintf(fmode, " %d", BU_BITTEST(bot->face_mode,
face_no)?1:0);
else
sprintf(fmode, " %d", BU_BITTEST(bot->face_mode, 0)?1:0);
@@ -4472,7 +4466,7 @@
}
radio_result = Tcl_GetVar(INTERP, "_bot_fmode_result",
TCL_GLOBAL_ONLY);
- if (face_no > -1) {
+ if (face_no != (size_t)-1) {
if (atoi(radio_result))
BU_BITSET(bot->face_mode, face_no);
else
@@ -4528,7 +4522,7 @@
struct bu_bitv *new_bitv;
new_bitv = bu_bitv_new(bot->num_faces);
- for (i=0; i<face_no; i++) {
+ for (i=0; i<(size_t)face_no; i++) {
if (BU_BITTEST(bot->face_mode, i))
BU_BITSET(new_bitv, i);
}
@@ -5986,7 +5980,7 @@
if (es_ars_crv >= 0 && es_ars_col >= 0) {
es_ars_col++;
- if (es_ars_col >= ars->pts_per_curve)
+ if ((size_t)es_ars_col >= ars->pts_per_curve)
es_ars_col = 0;
VMOVE(es_pt, &ars->curves[es_ars_crv][es_ars_col*3]);
VSCALE(selected_pt, es_pt, base2local);
@@ -6036,7 +6030,7 @@
if (es_ars_crv >= 0 && es_ars_col >= 0) {
es_ars_crv++;
- if (es_ars_crv >= ars->ncurves)
+ if ((size_t)es_ars_crv >= ars->ncurves)
es_ars_crv = 0;
VMOVE(es_pt, &ars->curves[es_ars_crv][es_ars_col*3]);
VSCALE(selected_pt, es_pt, base2local);
@@ -6092,12 +6086,12 @@
"new curves");
for (i=0; i<ars->ncurves+1; i++) {
- int j, k;
+ size_t j, k;
curves[i] = (fastf_t *)bu_malloc(ars->pts_per_curve * 3 *
sizeof(fastf_t),
"new curves[i]");
- if (i <= es_ars_crv)
+ if (i <= (size_t)es_ars_crv)
k = i;
else
k = i - 1;
@@ -6131,13 +6125,13 @@
"new curves");
for (i=0; i<ars->ncurves; i++) {
- int j, k;
+ size_t j, k;
curves[i] = (fastf_t *)bu_malloc((ars->pts_per_curve + 1) *
3 * sizeof(fastf_t),
"new curves[i]");
for (j=0; j<ars->pts_per_curve+1; j++) {
- if (j <= es_ars_col)
+ if (j <= (size_t)es_ars_col)
k = j;
else
k = j - 1;
@@ -6170,7 +6164,7 @@
break;
}
- if (es_ars_crv == 0 || es_ars_crv == ars->ncurves-1) {
+ if (es_ars_crv == 0 || (size_t)es_ars_crv == ars->ncurves-1) {
bu_log("Cannot delete first or last curve\n");
break;
}
@@ -6180,9 +6174,9 @@
k = 0;
for (i=0; i<ars->ncurves; i++) {
- int j;
+ size_t j;
- if (i == es_ars_crv)
+ if (i == (size_t)es_ars_crv)
continue;
curves[k] = (fastf_t *)bu_malloc(ars->pts_per_curve * 3 *
sizeof(fastf_t),
@@ -6201,7 +6195,7 @@
ars->curves = curves;
ars->ncurves--;
- if (es_ars_crv >= ars->ncurves)
+ if ((size_t)es_ars_crv >= ars->ncurves)
es_ars_crv = ars->ncurves - 1;
}
break;
@@ -6218,7 +6212,7 @@
break;
}
- if (es_ars_col == 0 || es_ars_col == ars->ncurves - 1) {
+ if (es_ars_col == 0 || (size_t)es_ars_col == ars->ncurves - 1) {
bu_log("Cannot delete first or last column\n");
break;
}
@@ -6232,7 +6226,7 @@
"new curves");
for (i=0; i<ars->ncurves; i++) {
- int j, k;
+ size_t j, k;
curves[i] = (fastf_t *)bu_malloc((ars->pts_per_curve - 1) *
3 * sizeof(fastf_t),
@@ -6240,7 +6234,7 @@
k = 0;
for (j=0; j<ars->pts_per_curve; j++) {
- if (j == es_ars_col)
+ if (j == (size_t)es_ars_col)
continue;
curves[i][k*3] = ars->curves[i][j*3];
@@ -6257,7 +6251,7 @@
ars->curves = curves;
ars->pts_per_curve--;
- if (es_ars_col >= ars->pts_per_curve)
+ if ((size_t)es_ars_col >= ars->pts_per_curve)
es_ars_col = ars->pts_per_curve - 1;
}
break;
@@ -6971,7 +6965,8 @@
struct rt_bot_internal *bot = (struct rt_bot_internal
*)es_int.idb_ptr;
point_t start_pt, tmp;
vect_t dir;
- int i, hits, ret_tcl;
+ size_t i;
+ int hits, ret_tcl;
int v1, v2, v3;
point_t pt1, pt2, pt3;
struct bu_vls vls;
Modified: brlcad/trunk/src/mged/titles.c
===================================================================
--- brlcad/trunk/src/mged/titles.c 2011-01-11 08:33:42 UTC (rev 42072)
+++ brlcad/trunk/src/mged/titles.c 2011-01-11 08:49:32 UTC (rev 42073)
@@ -215,7 +215,7 @@
void
dotitles(struct bu_vls *overlay_vls)
{
- int i = 0;
+ size_t i = 0;
/* for menu computations */
int x = 0;
@@ -258,7 +258,7 @@
bu_vls_init(&path_lhs);
bu_vls_init(&path_rhs);
- for (i = 0; i < ipathpos; i++) {
+ for (i = 0; i < (size_t)ipathpos; i++) {
dp = DB_FULL_PATH_GET(dbfp, i);
if (dp && dp->d_namep) {
bu_vls_printf(&path_lhs, "/%s", dp->d_namep);
@@ -362,7 +362,7 @@
color_scheme->cs_geo_label[0],
color_scheme->cs_geo_label[1],
color_scheme->cs_geo_label[2], 1, 1.0);
- for (i=0; i<num_lines; i++)
+ for (i=0; i<(size_t)num_lines; i++)
DM_DRAW_LINE_2D(dmp,
GED2PM1(((int)(lines[i*2][X]*GED_MAX))),
GED2PM1(((int)(lines[i*2][Y]*GED_MAX)) *
dmp->dm_aspect),
@@ -425,7 +425,7 @@
if (illump != SOLID_NULL &&
(STATE==ST_O_PATH || STATE==ST_O_PICK || STATE==ST_S_PICK)) {
for (i=0; i < illump->s_fullpath.fp_len; i++) {
- if (i == ipathpos && STATE == ST_O_PATH) {
+ if (i == (size_t)ipathpos && STATE == ST_O_PATH) {
DM_SET_FGCOLOR(dmp,
color_scheme->cs_state_text1[0],
color_scheme->cs_state_text1[1],
@@ -594,7 +594,7 @@
/* Illuminated path */
bu_vls_strcat(&vls, " Path: ");
for (i=0; i < illump->s_fullpath.fp_len; i++) {
- if (i == ipathpos &&
+ if (i == (size_t)ipathpos &&
(STATE == ST_O_PATH || STATE == ST_O_EDIT))
bu_vls_strcat(&vls, "/__MATRIX__");
bu_vls_printf(&vls, "/%s",
Modified: brlcad/trunk/src/mged/usepen.c
===================================================================
--- brlcad/trunk/src/mged/usepen.c 2011-01-11 08:33:42 UTC (rev 42072)
+++ brlcad/trunk/src/mged/usepen.c 2011-01-11 08:49:32 UTC (rev 42073)
@@ -121,7 +121,7 @@
if (STATE == ST_O_PATH) {
if (argc == 1 || *argv[1] == 'f') {
++ipathpos;
- if (ipathpos >= illump->s_fullpath.fp_len)
+ if ((size_t)ipathpos >= illump->s_fullpath.fp_len)
ipathpos = 0;
} else if (*argv[1] == 'b') {
--ipathpos;
@@ -234,7 +234,7 @@
struct ged_display_list *next_gdlp;
struct solid *sp;
char *cp;
- int j;
+ size_t j;
int illum_only = 0;
CHECK_DBI_NULL;
@@ -289,7 +289,7 @@
} else {
ipathpos = atoi(argv[1]);
if (ipathpos < 0) ipathpos = 0;
- else if (ipathpos >= illump->s_fullpath.fp_len)
+ else if ((size_t)ipathpos >= illump->s_fullpath.fp_len)
ipathpos = illump->s_fullpath.fp_len-1;
}
got:
@@ -299,13 +299,13 @@
next_gdlp = BU_LIST_PNEXT(ged_display_list, gdlp);
FOR_ALL_SOLIDS(sp, &gdlp->gdl_headSolid) {
- for (j = 0; j <= ipathpos; j++) {
+ for (j = 0; j <= (size_t)ipathpos; j++) {
if (DB_FULL_PATH_GET(&sp->s_fullpath, j) !=
DB_FULL_PATH_GET(&illump->s_fullpath, j))
break;
}
/* Only accept if top of tree is identical */
- if (j == ipathpos+1)
+ if (j == (size_t)ipathpos+1)
sp->s_iflag = UP;
else
sp->s_iflag = DOWN;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits