Skip to content

Commit a9623e3

Browse files
committed
Modernize code to C++17
1 parent c9a9942 commit a9623e3

File tree

4 files changed

+325
-423
lines changed

4 files changed

+325
-423
lines changed

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ssw.o: ssw.c ssw.h
5757
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
5858

5959
ssw_cpp.o: ssw_cpp.cpp ssw_cpp.h ssw.h
60-
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
60+
$(CXX) $(CPPFLAGS) -std=c++17 $(CXXFLAGS) -c -o $@ $<
6161

6262
clean:
6363
-rm -f $(LOBJS) $(LCPPOBJS) $(PROG) $(LIB) $(EXAMPLE) $(EXAMPLE_CPP) $(JAVA_LIB) $(JAVA_JAR) $(JAVA_OBJ) *~

src/example.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void PrintAlignment(const StripedSmithWaterman::Alignment& alignment);
2222
int main() {
2323
const string ref = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA";
2424
const string query = "CTGAGCCGGTAAATC";
25-
int32_t maskLen = strlen(query.c_str())/2;
25+
int32_t maskLen = query.size() / 2;
2626
maskLen = maskLen < 15 ? 15 : maskLen;
2727

2828
// Declares a default Aligner
@@ -32,7 +32,7 @@ int main() {
3232
// Declares an alignment that stores the result
3333
StripedSmithWaterman::Alignment alignment;
3434
// Aligns the query to the ref
35-
aligner.Align(query.c_str(), ref.c_str(), ref.size(), filter, &alignment, maskLen);
35+
aligner.Align(query, ref, filter, alignment, maskLen);
3636

3737
PrintAlignment(alignment);
3838

0 commit comments

Comments
 (0)