style(cpp): separate multiple variable declarations (#4795)

This commit is contained in:
David Lane
2026-03-01 09:02:17 -05:00
committed by GitHub
parent 2b7af2119d
commit 188f1e2959
19 changed files with 134 additions and 65 deletions

View File

@@ -188,7 +188,8 @@ namespace cuda {
stream_t stream;
frame_t hwframe;
int width, height;
int height;
int width;
// When height and width don't change, it's not necessary to use linear interpolation
bool linear_interpolation;
@@ -447,7 +448,8 @@ namespace cuda {
egl::nv12_t nv12;
AVPixelFormat sw_format;
int width, height;
int height;
int width;
std::uint64_t sequence;
egl::rgb_t rgb;
@@ -455,7 +457,8 @@ namespace cuda {
registered_resource_t y_res;
registered_resource_t uv_res;
int offset_x, offset_y;
int offset_x;
int offset_y;
};
std::unique_ptr<platf::avcodec_encode_device_t> make_avcodec_encode_device(int width, int height, bool vram) {

View File

@@ -69,8 +69,11 @@ namespace cuda {
stream_t make_stream(int flags = 0);
struct viewport_t {
int width, height;
int offsetX, offsetY;
int height;
int width;
int offsetX;
int offsetY;
};
class tex_t {

View File

@@ -361,7 +361,8 @@ namespace egl {
return nullptr;
}
int major, minor;
int major;
int minor;
if (!eglInitialize(display.get(), &major, &minor)) {
BOOST_LOG(error) << "Couldn't initialize EGL display: ["sv << util::hex(eglGetError()).to_string_view() << ']';
return nullptr;

View File

@@ -266,8 +266,10 @@ namespace egl {
class cursor_t: public platf::img_t {
public:
int x, y;
int src_w, src_h;
int src_h;
int src_w;
int x;
int y;
unsigned long serial;
@@ -329,9 +331,12 @@ namespace egl {
gl::program_t program[3];
gl::buffer_t color_matrix;
int out_width, out_height;
int in_width, in_height;
int offsetX, offsetY;
int out_height;
int out_width;
int in_height;
int in_width;
int offsetX;
int offsetY;
// Pointer to the texture to be converted to nv12
int loaded_texture;

View File

@@ -296,14 +296,20 @@ namespace platf {
struct cursor_t {
// Public properties used during blending
bool visible = false;
std::int32_t x, y;
std::uint32_t dst_w, dst_h;
std::uint32_t src_w, src_h;
std::uint32_t dst_h;
std::uint32_t dst_w;
std::uint32_t src_h;
std::uint32_t src_w;
std::int32_t x;
std::int32_t y;
std::vector<std::uint8_t> pixels;
unsigned long serial;
// Private properties used for tracking cursor changes
std::uint64_t prop_src_x, prop_src_y, prop_src_w, prop_src_h;
std::uint64_t prop_src_x;
std::uint64_t prop_src_y;
std::uint64_t prop_src_h;
std::uint64_t prop_src_w;
std::uint32_t fb_id;
};
@@ -1133,8 +1139,10 @@ namespace platf {
std::chrono::nanoseconds delay;
int img_width, img_height;
int img_offset_x, img_offset_y;
int img_height;
int img_width;
int img_offset_x;
int img_offset_y;
int plane_id;
int crtc_id;
@@ -1317,7 +1325,8 @@ namespace platf {
gl::ctx.BindTexture(GL_TEXTURE_2D, rgb->tex[0]);
// Don't remove these lines, see https://github.com/LizardByte/Sunshine/issues/453
int w, h;
int h;
int w;
gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
BOOST_LOG(debug) << "width and height: w "sv << w << " h "sv << h;

View File

@@ -398,7 +398,8 @@ namespace va {
egl::sws_t sws;
egl::nv12_t nv12;
int width, height;
int height;
int width;
};
class va_ram_t: public va_t {
@@ -455,7 +456,8 @@ namespace va {
std::uint64_t sequence;
egl::rgb_t rgb;
int offset_x, offset_y;
int offset_x;
int offset_y;
};
/**
@@ -531,7 +533,8 @@ namespace va {
vaSetErrorCallback(display.get(), __log, &error);
vaSetErrorCallback(display.get(), __log, &info);
int major, minor;
int major;
int minor;
auto status = vaInitialize(display.get(), &major, &minor);
if (status) {
BOOST_LOG(error) << "Couldn't initialize va display: "sv << vaErrorStr(status);
@@ -595,7 +598,8 @@ namespace va {
return false;
}
int major, minor;
int major;
int minor;
auto status = vaInitialize(display.get(), &major, &minor);
if (status) {
BOOST_LOG(error) << "Couldn't initialize va display: "sv << vaErrorStr(status);

View File

@@ -206,7 +206,8 @@ namespace wl {
gl::ctx.BindTexture(GL_TEXTURE_2D, (*rgb_opt)->tex[0]);
// Don't remove these lines, see https://github.com/LizardByte/Sunshine/issues/453
int w, h;
int h;
int w;
gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
gl::ctx.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
BOOST_LOG(debug) << "width and height: w "sv << w << " h "sv << h;