Skip to content

Commit

Permalink
Fix warning: blockSize may be used uninitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
andriytk committed Sep 4, 2024
1 parent e061934 commit aeb69a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions c_src/cauchycoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ERL_NIF_TERM CauchyCoding::doDecode(vector<ERL_NIF_TERM> blockList, vector<int>
throw std::invalid_argument("Blocks should be unique");
}

size_t blockSize;
size_t blockSize = 0;

ErlNifBinary blocks[k + m];
for(size_t i = 0; i < blockIdList.size(); ++i) {
Expand Down Expand Up @@ -165,7 +165,7 @@ vector<ERL_NIF_TERM> CauchyCoding::doRepair(vector<ERL_NIF_TERM> blockList, vect
throw std::invalid_argument("Blocks should be unique");
}

size_t blockSize;
size_t blockSize = 0;

ErlNifBinary blocks[k + m];
for(size_t i = 0; i < blockIdList.size(); ++i) {
Expand Down
4 changes: 2 additions & 2 deletions c_src/irscoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ERL_NIF_TERM IRSCoding::doDecode(vector<ERL_NIF_TERM> blockList, vector<int> blo
throw std::invalid_argument("Blocks should be unique");
}

size_t blockSize;
size_t blockSize = 0;
unsigned char* availBlocks[k + m];

ErlNifBinary blocks[k + m];
Expand Down Expand Up @@ -147,7 +147,7 @@ vector<ERL_NIF_TERM> IRSCoding::doRepair(vector<ERL_NIF_TERM> blockList, vector<
throw std::invalid_argument("Blocks should be unique");
}

size_t blockSize;
size_t blockSize = 0;
unsigned char* availBlocks[k + m];

ErlNifBinary blocks[k + m];
Expand Down
4 changes: 2 additions & 2 deletions c_src/liberationcoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ERL_NIF_TERM LiberationCoding::doDecode(vector<ERL_NIF_TERM> blockList, vector<i
throw std::invalid_argument("Blocks should be unique");
}

size_t blockSize;
size_t blockSize = 0;

ErlNifBinary blocks[k + m];
for(size_t i = 0; i < blockIdList.size(); ++i) {
Expand Down Expand Up @@ -162,7 +162,7 @@ vector<ERL_NIF_TERM> LiberationCoding::doRepair(vector<ERL_NIF_TERM> blockList,
throw std::invalid_argument("Blocks should be unique");
}

size_t blockSize;
size_t blockSize = 0;

ErlNifBinary blocks[k + m];
for(size_t i = 0; i < blockIdList.size(); ++i) {
Expand Down

0 comments on commit aeb69a8

Please sign in to comment.