README is updated
Modify cigar format, using 'X' for mismatches
Publication is on PLoS ONE
Merge branch 'master' of github.com:mengyao/Complete-Striped-Smith-Waterman-Library

Conflicts:
	README
CIGAR staring: 'M' is replaced by '=' in the C++ module.
A new constructor of Filter
Filter(const bool& pos, const bool& cigar, const uint16_t& score, const uint16_t& dis);
Added static and const where appropriate.

Marked internal functions as static not to export them and for compiler
to be able to optimize them more aggressively.
Placed data tables in .rodata section by declaring them static const.
Avoid explicit extern C while including ssw.h
before merge ahippo's change
Merge branch 'master' of https://github.com/ahippo/Complete-Striped-Smith-Waterman-Library

some functions and data are announced as static
strip trailing whitespaces
Makefile tweaks

added compilation of example.c.
treat compilation warnings as errors.
ssw_test depends on kseq.h too.
Added compilation of C++ version and example.
Fixed compilation warnings in ssw_cpp.cpp

ssw_cpp.cpp: In function ‘int {anonymous}::CalculateNumberMismatch(StripedSmithWaterman::Alignment*, const int8_t*, const int8_t*)’:
ssw_cpp.cpp:156:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
ssw_cpp.cpp:183:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
ssw_cpp.cpp:189:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Output soft clipping for new cigar format too.

The new cigar format was introduced in
18cb19f692dc24ff84fed31e8e35e150e3c55599.
It distinguishes between a match ('=') and a mismatch('X') instead
of simply outputting 'M'.
But it lacked output of soft clipping.
Fix this by coping a part of ConvertAlignment() into
CalculateNumberMismatch().

Example cigar strings:
old (before 18cb):             9S13M1S
new (after 18cb):              1X1=1X3=1X1=1X2=2X
new fixed (after this change): 9S1X1=1X3=1X1=1X2=2X1S

old (before 18cb):             122S14M36S
new (after 18cb):              3=1X2=1X2=3X1=1X
new fixed (after this change): 122S3=1X2=1X2=3X1=1X36S
Fixed memory leaks in example.c

Reported by valrgind as
12 bytes in 1 blocks are indirectly lost in loss record 1 of 5
    at 0x4C2A1C0: malloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x403ACA: ssw_align (ssw.c:708)
    by 0x400980: main (example.c:146)

52 (40 direct, 12 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 5
    at 0x4C28070: calloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x402554: ssw_align (ssw.c:785)
    by 0x400980: main (example.c:146)

80 bytes in 1 blocks are indirectly lost in loss record 1 of 3
    at 0x4C2A1C0: malloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x401CFF: ssw_init (ssw.c:99)
    by 0x40091F: main (example.c:142)

160 bytes in 1 blocks are indirectly lost in loss record 2 of 3
    at 0x4C2A1C0: malloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x402291: ssw_init (ssw.c:353)
    by 0x40091F: main (example.c:142)

288 (48 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 3
    at 0x4C28070: calloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x401B00: ssw_init (ssw.c:742)
    by 0x40091F: main (example.c:142)
Fixed memory leaks in ssw_cpp in case of non-default translation matrix.

The leak was reported by valgrind as:
128 bytes in 1 blocks are definitely lost in loss record 1 of 1
   at 0x4C294E0: operator new[](unsigned long) (in vgpreload_memcheck-amd64-linux.so)
   by 0x404CD8: StripedSmithWaterman::Aligner::Aligner(signed char const*, int const&, signed char const*, int const&) (ssw_cpp.cpp:288)

Also fixed a leak in Rebuild().

Got rid of matrix_built_ -- check translation_matrix_ pointer for NULL
instead.
Got rid of default_matrix_ too as the actual logic using it was wrong --
instead always perform a full copy of the translation matrix (even in
case of default one).
Added helper functions to convert from/to bam CIGAR integers.

There are lots of open-coded convertions from and to bam CIGAR integers
throughout the codebase.
Some of them were introduced in commit
18cb19f692dc24ff84fed31e8e35e150e3c55599 Modify cigar format, using 'X' for mismatches,
which are in fact wrong and produce clang warnings like the following:
ssw_cpp.cpp:114:54: error: use of logical '||' with constant operand [-Werror,-Wconstant-logical-operand]
    uint32_t match = ((*length_M << 4) & 0xfffffff0) || (bam_EQUAL_operator & 0x0000000f);

Actually, printing the contents of new_cigar_string alongside new_cigar array in
CalculateNumberMismatch() function gets the following:
new_cigar_string 4=1X4=1I5=
new_cigar        { 0x1, 0x1, 0x1, 0x11, 0x1 }
which is obviously wrong.

After the change the new_cigar_string and new_cigar in the same place
are as follows:
new_cigar_string 4=1X4=1I5=
new_cigar        { 0x47, 0x18, 0x47, 0x11, 0x57 }
which looks correct.