Formating review, using imperative mode in comments

This commit is contained in:
Ray
2026-03-03 22:40:34 +01:00
parent bf830c3f7b
commit b4746469d4
18 changed files with 164 additions and 161 deletions

View File

@ -181,7 +181,7 @@ typedef struct tagRGBQUAD {
#endif
#ifndef BI_ALPHABITFIELDS
// Bitmap not compressed and that the color table consists of four DWORD color masks,
// Bitmap not compressed and that the color table consists of four DWORD color masks,
// that specify the red, green, blue, and alpha components of each pixel
#define BI_ALPHABITFIELDS 0x0006
#endif
@ -216,7 +216,7 @@ static int GetPixelDataOffset(BITMAPINFOHEADER bih); // Get pixel data offset fr
unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long long int *dataSize)
{
unsigned char *bmpData = NULL;
if (OpenClipboardRetrying(NULL))
{
HGLOBAL clipHandle = (HGLOBAL)GetClipboardData(CF_DIB);
@ -231,7 +231,7 @@ unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long
if (clipDataSize >= sizeof(BITMAPINFOHEADER))
{
int pixelOffset = GetPixelDataOffset(*bmpInfoHeader);
// Create the bytes for a correct BMP file and copy the data to a pointer
//------------------------------------------------------------------------
BITMAPFILEHEADER bmpFileHeader = { 0 };
@ -245,10 +245,10 @@ unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long
bmpData = (unsigned char *)RL_MALLOC(sizeof(bmpFileHeader) + clipDataSize);
memcpy(bmpData, &bmpFileHeader, sizeof(bmpFileHeader)); // Add BMP file header data
memcpy(bmpData + sizeof(bmpFileHeader), bmpInfoHeader, clipDataSize); // Add BMP info header data
GlobalUnlock(clipHandle);
CloseClipboard();
TRACELOG(LOG_INFO, "Clipboad image acquired successfully");
//------------------------------------------------------------------------
}
@ -259,14 +259,14 @@ unsigned char *Win32GetClipboardImageData(int *width, int *height, unsigned long
CloseClipboard();
}
}
else
else
{
TRACELOG(LOG_WARNING, "Clipboard data failed to be locked");
GlobalUnlock(clipHandle);
CloseClipboard();
}
}
else
else
{
TRACELOG(LOG_WARNING, "Clipboard data is not an image");
CloseClipboard();
@ -286,7 +286,7 @@ static BOOL OpenClipboardRetrying(HWND hWnd)
{
static const int maxTries = 20;
static const int sleepTimeMS = 60;
for (int i = 0; i < maxTries; i++)
{
// Might be being hold by another process
@ -295,7 +295,7 @@ static BOOL OpenClipboardRetrying(HWND hWnd)
Sleep(sleepTimeMS);
}
return false;
}