sonarlint generic files in src/video

This commit is contained in:
Jasmine Iwanek
2023-07-31 17:31:15 -04:00
parent 0cc00a6b0f
commit b8993e3282
2 changed files with 22 additions and 16 deletions

View File

@@ -38,7 +38,7 @@
#include <86box/vid_mda.h> #include <86box/vid_mda.h>
#include <86box/vid_xga_device.h> #include <86box/vid_xga_device.h>
typedef struct { typedef struct video_card_t {
const device_t *device; const device_t *device;
int flags; int flags;
} VIDEO_CARD; } VIDEO_CARD;

View File

@@ -311,10 +311,10 @@ video_take_screenshot_monitor(const char *fn, uint32_t *buf, int start_x, int st
png_bytep *b_rgb = NULL; png_bytep *b_rgb = NULL;
FILE *fp = NULL; FILE *fp = NULL;
uint32_t temp = 0x00000000; uint32_t temp = 0x00000000;
blit_data_t *blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr; const blit_data_t *blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
/* create file */ /* create file */
fp = plat_fopen((char *) fn, (char *) "wb"); fp = plat_fopen(fn, (const char *) "wb");
if (!fp) { if (!fp) {
video_log("[video_take_screenshot] File %s could not be opened for writing", fn); video_log("[video_take_screenshot] File %s could not be opened for writing", fn);
return; return;
@@ -424,7 +424,7 @@ video_transform_copy(void *__restrict _Dst, const void *__restrict _Src, size_t
#endif #endif
{ {
uint32_t *dest_ex = (uint32_t *) _Dst; uint32_t *dest_ex = (uint32_t *) _Dst;
uint32_t *src_ex = (uint32_t *) _Src; const uint32_t *src_ex = (const uint32_t *) _Src;
_Size /= sizeof(uint32_t); _Size /= sizeof(uint32_t);
@@ -496,8 +496,8 @@ pixel_to_color(uint8_t *pixels32, uint8_t pos)
uint32_t temp; uint32_t temp;
temp = *(pixels32 + pos) & 0x03; temp = *(pixels32 + pos) & 0x03;
switch (temp) { switch (temp) {
case 0:
default: default:
case 0:
return 0x00; return 0x00;
case 1: case 1:
return 0x07; return 0x07;
@@ -774,23 +774,27 @@ hline(bitmap_t *b, int x1, int y, int x2, uint32_t col)
} }
void void
blit(bitmap_t *src, bitmap_t *dst, int x1, int y1, int x2, int y2, int xs, int ys) blit(UNUSED(bitmap_t *src), UNUSED(bitmap_t *dst), UNUSED(int x1), UNUSED(int y1), UNUSED(int x2), UNUSED(int y2), UNUSED(int xs), UNUSED(int ys))
{ {
//
} }
void void
stretch_blit(bitmap_t *src, bitmap_t *dst, int x1, int y1, int xs1, int ys1, int x2, int y2, int xs2, int ys2) stretch_blit(UNUSED(bitmap_t *src), UNUSED(bitmap_t *dst), UNUSED(int x1), UNUSED(int y1), UNUSED(int xs1), UNUSED(int ys1), UNUSED(int x2), UNUSED(int y2), UNUSED(int xs2), UNUSED(int ys2))
{ {
//
} }
void void
rectfill(bitmap_t *b, int x1, int y1, int x2, int y2, uint32_t col) rectfill(UNUSED(bitmap_t *b), UNUSED(int x1), UNUSED(int y1), UNUSED(int x2), UNUSED(int y2), UNUSED(uint32_t col))
{ {
//
} }
void void
set_palette(PALETTE p) set_palette(UNUSED(PALETTE p))
{ {
//
} }
void void
@@ -1115,8 +1119,10 @@ uint32_t
video_color_transform(uint32_t color) video_color_transform(uint32_t color)
{ {
uint8_t *clr8 = (uint8_t *) &color; uint8_t *clr8 = (uint8_t *) &color;
/* if (!video_grayscale && !invert_display) #if 0
return color; */ if (!video_grayscale && !invert_display)
return color;
#endif
if (video_grayscale) { if (video_grayscale) {
if (video_graytype) { if (video_graytype) {
if (video_graytype == 1) if (video_graytype == 1)
@@ -1129,7 +1135,7 @@ video_color_transform(uint32_t color)
case 2: case 2:
case 3: case 3:
case 4: case 4:
color = (uint32_t) shade[video_grayscale][color]; color = shade[video_grayscale][color];
break; break;
default: default:
clr8[3] = 0; clr8[3] = 0;