Include what these files use

UnitTest.h's EXPECT_ macros all call printf and EXPECT_EQ_MEM calls memcmp, but
it included neither <cstdio> nor <cstring> - it has been relying on whatever the
including file happened to pull in first, and TestMpegCsc was the first not to.
The same shape in sceMpegbase.cpp and sceVideocodec.cpp, which use std::min,
std::move and memcpy without saying where they come from.

Also drop an abs() from TestMpegCsc rather than include <cstdlib> for one
subtraction.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-09-18 11:59:48 -06:00
1 parent 8fa0826bdb
commit 5c5c7dec86
4 files changed
+12 -3

No files matched your search

+3
View File
@@ -20,7 +20,10 @@
// mpeg.prx drives these directly, so they have to be real for the firmware module to run in place
// of our sceMpeg HLE.
#include <algorithm>
#include <cstring>
#include <map>
#include <utility>
#include <vector>
#include "Common/Serialize/Serializer.h"
+2
View File
@@ -26,7 +26,9 @@
// by looking at sceMpegBaseYCrCbCopy output on a real PSP.
#include <algorithm>
#include <cstring>
#include <map>
#include <utility>
#include <vector>
#include "Common/Serialize/Serializer.h"
+5 -3
View File
@@ -23,8 +23,9 @@
// MpegCscRange has something to be wrong against that isn't itself. The speed half reports
// megapixels per second for a 480x272 frame, the size a PSP movie actually is.
#include <cmath>
#include <cstdio>
#include <cstring>
#include <utility>
#include <vector>
#include "Common/CommonTypes.h"
@@ -351,8 +352,9 @@ bool TestMpegCsc() {
memcpy(&a, &sws[off], bpp);
memcpy(&b, &ref[off], bpp);
for (int ch = 0; ch < 3; ch++) {
const int d = abs((int)((a >> shifts[ch]) & masks[ch]) -
(int)((b >> shifts[ch]) & masks[ch]));
const int va = (int)((a >> shifts[ch]) & masks[ch]);
const int vb = (int)((b >> shifts[ch]) & masks[ch]);
const int d = va > vb ? va - vb : vb - va;
worst = worst > d ? worst : d;
total += d;
count++;
+2
View File
@@ -1,6 +1,8 @@
#pragma once
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
inline bool rel_equal(float a, float b, float precision) {