Skip to content

Commit

Permalink
Bug #12264 Warnings & notices
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Aug 8, 2011
1 parent 9735dc6 commit a6eeb2f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
8 changes: 5 additions & 3 deletions Science/Chemistry/Atom_PDB.php
Expand Up @@ -158,10 +158,12 @@ class Science_Chemistry_Atom_PDB extends Science_Chemistry_Atom {
var $parent_residue; var $parent_residue;




function Science_Chemistry_Atom_PDB($atomrec, $residue="") { function Science_Chemistry_Atom_PDB(&$atomrec, &$residue="") {
// reference to containing residue // reference to containing residue
if (!empty($residue)) if (!empty($residue)) {
$this->parent_residue =& $residue; $this->parent_residue = $residue;
}

// process PDB atom record // process PDB atom record
// no error checking, assumes correct and standard record // no error checking, assumes correct and standard record
$this->VALID = true; $this->VALID = true;
Expand Down
8 changes: 4 additions & 4 deletions Science/Chemistry/Macromolecule_PDB.php
Expand Up @@ -45,8 +45,8 @@ class Science_Chemistry_Macromolecule_PDB extends Science_Chemistry_Macromolecul
* @see parseResidues() * @see parseResidues()
*/ */
function Science_Chemistry_Macromolecule_PDB($pdb, $records, $pdbfile="") { function Science_Chemistry_Macromolecule_PDB($pdb, $records, $pdbfile="") {
$this->pdb =& $pdb; $this->pdb = $pdb;
$this->pdbfile =& $pdbfile; $this->pdbfile = $pdbfile;
$this->parseResidues($records); $this->parseResidues($records);
} }


Expand All @@ -71,8 +71,8 @@ function parseResidues($records) {
} }


foreach ($res_atoms as $mol_id => $atoms_list) { foreach ($res_atoms as $mol_id => $atoms_list) {
$this->molecules[] =& new Science_Chemistry_Residue_PDB(&$this->pdb, $this->molecules[] =& new Science_Chemistry_Residue_PDB($this->pdb,
&$atoms_list, &$this); $atoms_list, $this);
$this->num_molecules++; $this->num_molecules++;
} }
return true; return true;
Expand Down
8 changes: 4 additions & 4 deletions Science/Chemistry/PDBFile.php
Expand Up @@ -124,7 +124,7 @@ function parseFile($arr, $usemeta) {
$header_re = "/^HEADER[[:space:]]+(([^[:space:]]+ )+)[[:space:]]+"; $header_re = "/^HEADER[[:space:]]+(([^[:space:]]+ )+)[[:space:]]+";
$header_re .= "([0-9]{2}-[A-Z]{3}-[0-9]{2,4})[[:space:]]+[A-Z0-9]{4}/"; $header_re .= "([0-9]{2}-[A-Z]{3}-[0-9]{2,4})[[:space:]]+[A-Z0-9]{4}/";


if (preg_match($header_re, $arr[0], &$regs)) { if (preg_match($header_re, $arr[0], $regs)) {
$this->class = trim($regs[1]); $this->class = trim($regs[1]);
// put date in a more standard format // put date in a more standard format
$tmp = explode("-", $regs[3]); $tmp = explode("-", $regs[3]);
Expand Down Expand Up @@ -164,7 +164,7 @@ function parseFile($arr, $usemeta) {
// the flag // the flag
if ($rectype == "ENDMDL") { if ($rectype == "ENDMDL") {
$this->macromolecules[] = new Science_Chemistry_Macromolecule_PDB($this->pdb, $this->macromolecules[] = new Science_Chemistry_Macromolecule_PDB($this->pdb,
$tmparr, &$this); $tmparr, $this);
$this->num_macromolecules++; $this->num_macromolecules++;
$flag = "endmodel"; $flag = "endmodel";
$tmparr = array(); $tmparr = array();
Expand All @@ -173,8 +173,8 @@ function parseFile($arr, $usemeta) {
// if we got to the end without hitting a MODEL ... ENDMDL pair // if we got to the end without hitting a MODEL ... ENDMDL pair
// add the only macromolecule in this file to the array // add the only macromolecule in this file to the array
if ($flag == "nomodel") { if ($flag == "nomodel") {
$this->macromolecules[] = new Science_Chemistry_Macromolecule_PDB(&$this->pdb, $this->macromolecules[] = new Science_Chemistry_Macromolecule_PDB($this->pdb,
&$tmparr, &$this); $tmparr, $this);
$this->num_macromolecules++; $this->num_macromolecules++;
} }
} }
Expand Down
6 changes: 4 additions & 2 deletions Science/Chemistry/Residue_PDB.php
Expand Up @@ -95,8 +95,10 @@ class Science_Chemistry_Residue_PDB extends Science_Chemistry_Molecule {
* @access public * @access public
*/ */
function Science_Chemistry_Residue_PDB($pdb, $atomrec_arr, $macromol="") { function Science_Chemistry_Residue_PDB($pdb, $atomrec_arr, $macromol="") {
for ($i=0; $i < count($atomrec_arr); $i++) for ($i=0; $i < count($atomrec_arr); $i++) {
$this->atoms[] = new Science_Chemistry_Atom_PDB(&$atomrec_arr[$i], &$this); $this->atoms[] = new Science_Chemistry_Atom_PDB($atomrec_arr[$i], $this);
}

if (!empty($this->atoms)) { if (!empty($this->atoms)) {
$this->VALID = true; $this->VALID = true;
$this->macromol =& $macromol; $this->macromol =& $macromol;
Expand Down

0 comments on commit a6eeb2f

Please sign in to comment.