Skip to content

Commit

Permalink
Address -Werror=c++-compat compiler complaints in pdb-g.c
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Jan 13, 2025
1 parent 2bddee7 commit a84ecaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/proc-db/pdb-g.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ read_pdb(const char* filename)
}

num_alloc = MORE_ATOMS;
atoms = bu_malloc(num_alloc * sizeof(pdb_atom), "pdb_atom alloc");
atoms = (pdb_atom *)bu_malloc(num_alloc * sizeof(pdb_atom), "pdb_atom alloc");

while (bu_fgets(line, PDB_LINELEN, fp) != NULL) {
if (bu_strncasecmp(line, "HEADER", 6) == 0) {
header = bu_strdup(line);
} else if (bu_strncasecmp(line, "ATOM", 4) == 0 || bu_strncasecmp(line, "HETATM", 6) == 0) {
if (num_atoms >= num_alloc) {
num_alloc += MORE_ATOMS;
atoms = bu_realloc(atoms, num_alloc * sizeof(pdb_atom), "pdb_atom realloc");
atoms = (pdb_atom *)bu_realloc(atoms, num_alloc * sizeof(pdb_atom), "pdb_atom realloc");
}
pdb_atom* atom = &atoms[num_atoms];
bu_strlcpy(atom->record_type, line, sizeof(atom->record_type));
Expand All @@ -202,7 +202,7 @@ read_pdb(const char* filename)

fclose(fp);

pdb_data* data = bu_malloc(sizeof(pdb_data), "pdb_data alloc");
pdb_data* data = (pdb_data *)bu_malloc(sizeof(pdb_data), "pdb_data alloc");

data->header = header;
data->atoms = atoms;
Expand Down

0 comments on commit a84ecaa

Please sign in to comment.