Skip to content

Commit b14df3a

Browse files
authored
CodeQL suppression syntax fix (#567)
1 parent c1f67a4 commit b14df3a

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Audio/SoundCommon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ void DirectX::CreateADPCM(
592592
adpcm->wNumCoef = MSADPCM_NUM_COEFFICIENTS;
593593

594594
static ADPCMCOEFSET aCoef[7] = { { 256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} };
595-
memcpy(&adpcm->aCoef, aCoef, sizeof(aCoef)); // [CodeQL.SM01947]: Code scanner doesn't understand the 0-length MSVC array extension. MSADPCM_FORMAT_EXTRA_BYTES includes this memory.
595+
memcpy(&adpcm->aCoef, aCoef, sizeof(aCoef)); // CodeQL [SM01947] Code scanner doesn't understand the 0-length MSVC array extension. MSADPCM_FORMAT_EXTRA_BYTES includes this memory.
596596

597597
assert(IsValid(wfx));
598598
}

Audio/WaveBankReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ namespace
250250
fmt->wNumCoef = MSADPCM_NUM_COEFFICIENTS;
251251

252252
static ADPCMCOEFSET aCoef[7] = { { 256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} };
253-
memcpy(&fmt->aCoef, aCoef, sizeof(aCoef)); // [CodeQL.SM01947]: Code scanner doesn't understand the 0-length MSVC array extension. MSADPCM_FORMAT_EXTRA_BYTES includes this memory.
253+
memcpy(&fmt->aCoef, aCoef, sizeof(aCoef)); // CodeQL [SM01947] Code scanner doesn't understand the 0-length MSVC array extension. MSADPCM_FORMAT_EXTRA_BYTES includes this memory.
254254
}
255255
};
256256

Src/ModelLoadCMO.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ std::unique_ptr<Model> Model::CreateFromCMO(
150150
if (dataSize < usedSize)
151151
throw std::runtime_error("End of file");
152152

153-
auto meshName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // [CodeQL.SM02986]: The cast here is intentional.
153+
auto meshName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // CodeQL [SM02986] The cast here is intentional to interpret the string in the buffer.
154154

155155
usedSize += sizeof(wchar_t)*(*nName);
156156
if (dataSize < usedSize)
@@ -182,7 +182,7 @@ std::unique_ptr<Model> Model::CreateFromCMO(
182182
if (dataSize < usedSize)
183183
throw std::runtime_error("End of file");
184184

185-
auto matName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // [CodeQL.SM02986]: The cast here is intentional.
185+
auto matName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // CodeQL [SM02986] The cast here is intentional to interpret the string in the buffer.
186186

187187
usedSize += sizeof(wchar_t)*(*nName);
188188
if (dataSize < usedSize)
@@ -204,7 +204,7 @@ std::unique_ptr<Model> Model::CreateFromCMO(
204204
if (dataSize < usedSize)
205205
throw std::runtime_error("End of file");
206206

207-
auto psName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // [CodeQL.SM02986]: The cast here is intentional.
207+
auto psName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // CodeQL [SM02986] The cast here is intentional to interpret the string in the buffer.
208208

209209
usedSize += sizeof(wchar_t)*(*nName);
210210
if (dataSize < usedSize)
@@ -219,7 +219,7 @@ std::unique_ptr<Model> Model::CreateFromCMO(
219219
if (dataSize < usedSize)
220220
throw std::runtime_error("End of file");
221221

222-
auto txtName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // [CodeQL.SM02986]: The cast here is intentional.
222+
auto txtName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // CodeQL [SM02986] The cast here is intentional to interpret the string in the buffer.
223223

224224
usedSize += sizeof(wchar_t)*(*nName);
225225
if (dataSize < usedSize)
@@ -458,7 +458,7 @@ std::unique_ptr<Model> Model::CreateFromCMO(
458458
if (dataSize < usedSize)
459459
throw std::runtime_error("End of file");
460460

461-
auto boneName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // [CodeQL.SM02986]: The cast here is intentional.
461+
auto boneName = reinterpret_cast<const wchar_t*>(static_cast<const void*>(meshData + usedSize)); // CodeQL [SM02986] The cast here is intentional to interpret the string in the buffer.
462462

463463
usedSize += sizeof(wchar_t) * (*nName);
464464
if (dataSize < usedSize)

0 commit comments

Comments
 (0)