Skip to content

Commit

Permalink
Fixed "pure virtual method called" error, and "dereferencing type-pun…
Browse files Browse the repository at this point in the history
…ned pointer" warning
  • Loading branch information
jenniferliddle committed Jul 22, 2013
1 parent 92685c6 commit 7f92e55
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ INSTALLLIB=/software/varinf/lib
INSTALLBIN=/software/varinf/bin
STLPORT_INC=/software/solexa/pkg/STLport/current/stlport
STLPORT_LIB=/software/solexa/pkg/STLport/current/build/lib/obj/gcc/so
#STLPORT_INC=/software/varinf/lib/STLport/include/stlport
#STLPORT_LIB=/software/varinf/lib/STLport/lib
PERL_CORE=/usr/lib/perl/5.8.8/CORE
PERL_CORE=/software/perl-5.8.8/lib/5.8.8/x86_64-linux-thread-multi/CORE

Expand Down Expand Up @@ -91,11 +93,11 @@ manifest: manifest.o Manifest.o
g2i: g2i.o Gtc.o Manifest.o win2unix.o Sim.o json/json_reader.o json/json_writer.o json/json_value.o utilities.o plink_binary.o
$(CC) $(LDFLAGS) -o $@ $^ -lstlport

#b2i: b2i.o Manifest.o b2base.o # "b2" code needs ssl library;
# $(CC) $(LDFLAGS) -lssl -o $@ $^ -lstlport # pick this up from /usr/lib
b2i: b2i.o Manifest.o b2base.o # "b2" code needs ssl library;
$(CC) $(LDFLAGS) -lssl -o $@ $^ -lstlport -lssl # pick this up from /usr/lib

#b2g: b2g.o Manifest.o b2base.o
# $(CC) $(LDFLAGS) -lssl -o $@ $^ -lstlport # Ditto.
b2g: b2g.o Manifest.o b2base.o
$(CC) $(LDFLAGS) -lssl -o $@ $^ -lstlport -lssl # Ditto.

gtc_process: Gtc.o Manifest.o gtc_process.o
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
Expand Down
13 changes: 7 additions & 6 deletions Sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ void Sim::open(string fname)
magic = buff;

this->filename = fname;
infile->read(buff,1); version = *(uint8_t*)buff;
infile->read(buff,2); sampleNameSize = *(uint16_t*)buff;
infile->read(buff,4); numSamples = *(uint32_t*)buff;
infile->read(buff,4); numProbes = *(uint32_t*)buff;
infile->read(buff,1); numChannels = *(uint8_t*)buff;
infile->read(buff,1); numberFormat = *(uint8_t*)buff;
// read SIM header
infile->read((char*)&version,1);
infile->read((char*)&sampleNameSize,2);
infile->read((char*)&numSamples,4);
infile->read((char*)&numProbes,4);
infile->read((char*)&numChannels,1);
infile->read((char*)&numberFormat,1);

// calculate and store record length
recordLength = numProbes * numChannels;
Expand Down
5 changes: 0 additions & 5 deletions data/-

This file was deleted.

14 changes: 7 additions & 7 deletions g2i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@

using namespace std;

Json::Value root; // will contains the root value after parsing.
Json::Reader reader;

hash_map<string,string> gtcHash; // <sample_name, filename>
Manifest *manifest = new Manifest();
Expand Down Expand Up @@ -483,7 +481,6 @@ void createBedFile(string fname, vector<string>infiles)
}
genotypes.push_back(call);
}
if (verbose) cerr << "SNP Count = " << pb->snps.size() << endl;
pb->write_individual(genotypes);
genotypes.clear();
}
Expand Down Expand Up @@ -777,21 +774,24 @@ int main(int argc, char *argv[])
case 'i': ifstream f; string s;
f.open(optarg);
if (strstr(optarg,".json")) {
Json::Value root; // will contains the root value after parsing.
Json::Reader reader;
bool parsingSuccessful = reader.parse( f, root );
if ( !parsingSuccessful ) {
std::cout << "Failed to parse json file\n" << reader.getFormatedErrorMessages() << endl;
return 0;
}
for ( unsigned int index = 0; index < root.size(); ++index ) { // Iterates over the sequence elements.
sampleNames.push_back(root[index]["uri"].asString());
// cerr << "Gender Code = [" << root[index]["gender_code"] << "]" << endl;
char buffer[8];
// if (root[index]["gender_code"]) sprintf(buffer,"%d",root[index]["gender_code"].asInt());
// else strcpy(buffer,"-9");
sprintf(buffer,"%d",root[index]["gender_code"].asInt());
gender_code.push_back(buffer);
infiles.push_back(root[index]["result"].asString());
cerr << root[index]["uri"].asString() << "\t" << root[index]["result"].asString() << "\t" << root[index]["gender_code"].asInt() << endl;
if (verbose) {
cerr << root[index]["uri"].asString() << "\t"
<< root[index]["result"].asString() << "\t"
<< root[index]["gender_code"].asInt() << endl;
}
}
} else {
while (f >> s) infiles.push_back(s);
Expand Down

0 comments on commit 7f92e55

Please sign in to comment.