Skip to content

Commit

Permalink
Address a couple clang static analyzer warnings in MGED
Browse files Browse the repository at this point in the history
Count jump looks like it is quite a bit more than can be accounted for by just
MGED build.  Looking at the CI log, the install request was for clang 14 but
the CMake configure is reporting clang 18.1.3. That'll do it...
  • Loading branch information
starseeker committed Jan 22, 2025
1 parent 567651a commit c25290f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/mged/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ copy_v4_solid(struct db_i *_dbip, struct directory *proto, struct clone_state *s
if ((dp == RT_DIR_NULL) || (db_alloc(_dbip, dp, proto->d_len) < 0)) {
Tcl_AppendResult(s->interp, "An error has occurred while adding a new object to the database.\n", (char *)NULL);
Tcl_AppendResult(s->interp, ERROR_RECOVERY_SUGGESTION, (char *)NULL);
return;
}

/* get an in-memory reference to the object being copied */
Expand Down
6 changes: 2 additions & 4 deletions src/mged/edsol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,6 @@ label_edited_solid(
const mat_t xform,
struct rt_db_internal *ip)
{
int npl = 0;

// TODO - is es_int the same as ip here? If not, why not?
RT_CK_DB_INTERNAL(ip);

Expand All @@ -1334,12 +1332,12 @@ label_edited_solid(
}
// If there is no editing-aware labeling, use standard librt labels
if (OBJ[ip->idb_type].ft_labels) {
npl = OBJ[ip->idb_type].ft_labels(pl, max_pl, xform, &s->s_edit.es_int, &s->tol.tol);
OBJ[ip->idb_type].ft_labels(pl, max_pl, xform, &s->s_edit.es_int, &s->tol.tol);
return;
}

// If we have nothing, NULL the string
pl[npl].str[0] = '\0';
pl[0].str[0] = '\0';
}


Expand Down
9 changes: 6 additions & 3 deletions src/mged/track.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ f_amtrack(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[
MGED_CK_CMD(ctp);
struct mged_state *s = ctp->s;

int item_default = 1000; /* GIFT region ID */
int mat_default = 1; /* GIFT material code */
int los_default = 100; /* Line-of-sight estimate */
// TODO - need to confirm the actual intent of this code is to have the
// assignments to default made in subsequent function logic persist beyond
// one call to f_amtrack.
static int item_default = 1000; /* GIFT region ID */
static int mat_default = 1; /* GIFT material code */
static int los_default = 100; /* Line-of-sight estimate */

fastf_t fw[3], lw[3], iw[3], dw[3], tr[3];
char solname[12], regname[12], grpname[9], oper[3];
Expand Down

0 comments on commit c25290f

Please sign in to comment.