libgraphics: fix warnings

- fix variable shadowing warnings
- fix variable assignment in the condition expression warnings
- fix my_error_mgr structure variables order to preserve space.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
This commit is contained in:
Vitalii Koshura 2024-09-10 02:26:24 +02:00
parent 3e3682ab3f
commit 70c95cdeaf
No known key found for this signature in database
GPG Key ID: CE0DB1726070A5A3
2 changed files with 6 additions and 6 deletions

View File

@ -71,7 +71,7 @@ void boinc_close_window_and_quit(const char* p) {
}
}
void SetupPixelFormat(HDC win_dc) {
void SetupPixelFormat(HDC dc) {
int nPixelFormat;
char buf[256];
@ -98,11 +98,11 @@ void SetupPixelFormat(HDC win_dc) {
// chooses the best pixel format
//
nPixelFormat = ChoosePixelFormat(win_dc, &pfd);
nPixelFormat = ChoosePixelFormat(dc, &pfd);
// set pixel format to device context.
//
if (!SetPixelFormat(win_dc, nPixelFormat, &pfd)) {
if (!SetPixelFormat(dc, nPixelFormat, &pfd)) {
fprintf(stderr,
"%s ERROR: Couldn't set pixel format for device context (0x%x).\n",
boinc_msg_prefix(buf, sizeof(buf)), GetLastError()
@ -468,14 +468,14 @@ void boinc_set_windows_icon(const char* icon16, const char* icon48) {
LONGLONG ic;
HWND hWnd = FindWindow("BOINC_app",NULL);
if (ic = (LONGLONG)LoadIcon(instance, icon48)) {
if ((ic = (LONGLONG)LoadIcon(instance, icon48)) != 0) {
#ifdef _WIN64
SetClassLongPtr(hWnd, GCLP_HICON, (LONG_PTR)ic);
#else
SetClassLongPtr(hWnd, GCLP_HICON, (LONG)ic);
#endif
}
if (ic = (LONGLONG)LoadImage(instance, icon16, IMAGE_ICON, 16, 16, 0)) {
if ((ic = (LONGLONG)LoadImage(instance, icon16, IMAGE_ICON, 16, 16, 0)) != 0) {
#ifdef _WIN64
SetClassLongPtr(hWnd, GCLP_HICONSM, (LONG_PTR)ic);
#else

View File

@ -626,8 +626,8 @@ void DecodeJPG(jpeg_decompress_struct* cinfo, tImageJPG *pImageData) {
}
struct my_error_mgr {
struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
struct jpeg_error_mgr pub;
};
typedef struct my_error_mgr * my_error_ptr;