Skip to content

Commit 964c534

Browse files
committed
fix build warnings for GCC 15
1 parent 01fd98d commit 964c534

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

modules/text/src/erfilter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,7 @@ class dissimilarity {
18911891
N(_Num),
18921892
members(_members),
18931893
postprocessfn(NULL),
1894+
distfn(NULL),
18941895
V(NULL)
18951896
{
18961897
switch (method) {

modules/text/src/ocr_hmm_decoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class OCRHMMDecoderImpl : public OCRHMMDecoder
208208
vector<int> spaces_start;
209209
vector<int> spaces_end;
210210
int space_count=0;
211-
int last_one_idx;
211+
int last_one_idx=0;
212212

213213
int s_init = 0, s_end=vector_w.cols;
214214
for (int s=0; s<vector_w.cols; s++)
@@ -456,7 +456,7 @@ class OCRHMMDecoderImpl : public OCRHMMDecoder
456456
vector<int> spaces_start;
457457
vector<int> spaces_end;
458458
int space_count=0;
459-
int last_one_idx;
459+
int last_one_idx=0;
460460

461461
int s_init = 0, s_end=vector_w.cols;
462462
for (int s=0; s<vector_w.cols; s++)

modules/wechat_qrcode/src/zxing/common/bytematrix.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ void ByteMatrix::init(int _width, int _height) {
2626
}
2727
}
2828

29-
ByteMatrix::ByteMatrix(int dimension) { init(dimension, dimension); }
29+
ByteMatrix::ByteMatrix(int dimension) : bytes(nullptr) { init(dimension, dimension); }
3030

31-
ByteMatrix::ByteMatrix(int _width, int _height) { init(_width, _height); }
31+
ByteMatrix::ByteMatrix(int _width, int _height) : bytes(nullptr) { init(_width, _height); }
3232

33-
ByteMatrix::ByteMatrix(int _width, int _height, ArrayRef<char> source) {
33+
ByteMatrix::ByteMatrix(int _width, int _height, ArrayRef<char> source) : bytes(nullptr) {
3434
init(_width, _height);
35-
int size = _width * _height;
36-
memcpy(&bytes[0], &source[0], size);
35+
36+
if( bytes != nullptr)
37+
{
38+
const size_t size = _width * _height;
39+
memcpy(&bytes[0], &source[0], size);
40+
}
3741
}
3842

3943
ByteMatrix::~ByteMatrix() {

0 commit comments

Comments
 (0)