Skip to content

Commit

Permalink
Don't initialize arrays that get initialized later.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Jul 30, 2018
1 parent 3fedc07 commit 6e94b72
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/utility/kmers-writer.C
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ kmerCountFileWriter::finishIteration(void) {
void
kmerCountFileWriter::mergeIterations(uint32 oi) {
kmerCountFileReaderBlock inBlocks[_iteration + 1];
FILE *inFiles [_iteration + 1] = { NULL };
FILE *inFiles [_iteration + 1];

{
char *fileName = constructBlockName(_outName, oi, _numFiles, 0, false);
Expand All @@ -468,6 +468,8 @@ kmerCountFileWriter::mergeIterations(uint32 oi) {

// Open the input files, allocate blocks.

inFiles[0] = NULL;

for (uint32 ii=1; ii <= _iteration; ii++)
inFiles[ii] = openInputBlock(_outName, oi, _numFiles, ii);

Expand All @@ -494,10 +496,10 @@ kmerCountFileWriter::mergeIterations(uint32 oi) {

// Load each block from each file, merge, and write.

uint32 p[_iteration+1] = {0}; // Position in s[] and c[]
uint64 l[_iteration+1] = {0}; // Number of entries in s[] and c[]
uint64 *s[_iteration+1] = {0}; // Pointer to the suffixes for piece x
uint32 *c[_iteration+1] = {0}; // Pointer to the counts for piece x
uint32 p[_iteration+1]; // Position in s[] and c[]
uint64 l[_iteration+1]; // Number of entries in s[] and c[]
uint64 *s[_iteration+1]; // Pointer to the suffixes for piece x
uint32 *c[_iteration+1]; // Pointer to the counts for piece x

for (uint32 bb=0; bb<_numBlocks; bb++) {
uint64 totnKmers = 0;
Expand Down

0 comments on commit 6e94b72

Please sign in to comment.