Skip to content

Commit 2f3ebe8

Browse files
author
Michael Hoopmann
authored
Merge pull request #9 from guoci/master
Bugfixes involving string literals and character literals
2 parents 96159b7 + a11ae8e commit 2f3ebe8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/MSReader.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class MSReader {
9393
void setPrecisionInt(int i);
9494
void setPrecisionMZ(int i);
9595
void writeFile(const char* c, bool text, MSObject& m);
96-
void writeFile(const char* c, MSFileFormat ff, MSObject& m, char* sha1Report='\0');
96+
void writeFile(const char* c, MSFileFormat ff, MSObject& m, const char* sha1Report="\0");
9797

9898
bool readMGFFile(const char* c, Spectrum& s); //Note, no random-access of MGF files.
9999
bool readMSTFile(const char* c, bool text, Spectrum& s, int scNum=0);
@@ -193,7 +193,7 @@ class MSReader {
193193
void sql_stmt(const char* stmt);
194194
bool executeSqlStmt(Spectrum& s, char* zSql);
195195
void appendFile(Spectrum& s);
196-
void writeSqlite(const char* c, MSObject& m, char* sha1Report);
196+
void writeSqlite(const char* c, MSObject& m, const char* sha1Report);
197197
void readChargeTable(int scanID, Spectrum& s);
198198
vector<int> estimateCharge(Spectrum& s);
199199
#endif

src/MSToolkit/MSReader.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ void MSReader::writeFile(const char* c, bool text, MSObject& m){
945945
fclose(fileOut);
946946
}
947947

948-
void MSReader::writeFile(const char* c, MSFileFormat ff, MSObject& m, char* sha1Report){
948+
void MSReader::writeFile(const char* c, MSFileFormat ff, MSObject& m, const char* sha1Report){
949949

950950
switch(ff){
951951
case mgf:
@@ -1006,7 +1006,7 @@ void MSReader::writeFile(const char* c, MSFileFormat ff, MSObject& m, char* sha1
10061006
}
10071007

10081008
#ifndef _NOSQLITE
1009-
void MSReader::writeSqlite(const char* c, MSObject& m, char* sha1Report)
1009+
void MSReader::writeSqlite(const char* c, MSObject& m, const char* sha1Report)
10101010
{
10111011

10121012
//open the database for write
@@ -1051,7 +1051,7 @@ void MSReader::writeSqlite(const char* c, MSObject& m, char* sha1Report)
10511051
string instrumentType="=";
10521052
for(int i=0; i<16; i++)
10531053
{
1054-
if(m.getHeader().header[i] != '\0')
1054+
if(*m.getHeader().header[i] != '\0')
10551055
{
10561056
string headerLine = m.getHeader().header[i];
10571057
if(headerLine.find("CreationDate") != string::npos)

0 commit comments

Comments
 (0)