Skip to content

Commit dc1bcd0

Browse files
committed
FIX: suppress compiler warnings
1 parent 6af517e commit dc1bcd0

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

src/core/u-compress.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ void BrotliDefaultFreeFunc(void* opaque, void* address) {
376376
size_t totalOut = 0;
377377
REBSER *output;
378378
REBYTE *out;
379-
REBYTE *inp;
379+
const uint8_t *inp;
380380

381381
if (level < 0)
382382
level = 6;
@@ -392,7 +392,7 @@ void BrotliDefaultFreeFunc(void* opaque, void* address) {
392392
availableOut = BrotliEncoderMaxCompressedSize(availableIn);
393393
output = Make_Binary((REBLEN)availableOut);
394394

395-
inp = BIN_HEAD(input) + index;
395+
inp = (const uint8_t*)(BIN_HEAD(input) + index);
396396
out = BIN_HEAD(output);
397397

398398
BrotliEncoderSetParameter(BrotliEncoder, BROTLI_PARAM_QUALITY, level); // Set compression quality (0-11)
@@ -452,7 +452,7 @@ static BrotliDecoderState *BrotliDecoder = NULL;
452452
uint8_t* nextOut = BIN_HEAD(output);
453453

454454
while (1) {
455-
res = BrotliDecoderDecompressStream(BrotliDecoder, &availableIn, &nextIn, &availableOut, &nextOut, &totalOut);
455+
res = BrotliDecoderDecompressStream(BrotliDecoder, &availableIn, (const uint8_t **)&nextIn, &availableOut, &nextOut, &totalOut);
456456
if (res == BROTLI_DECODER_RESULT_ERROR || res == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) goto error;
457457

458458
if (BrotliDecoderIsFinished(BrotliDecoder) || (limit > 0 && totalOut > limit)) {

src/os/win32/host-lib.c

+17-9
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ RL_LIB *RL; // Link back to reb-lib from embedded extensions (like for now: host
7474
// Semaphore lock to sync sub-task launch:
7575
static void *Task_Ready;
7676

77+
#ifdef REB_VIEW
78+
void Dispose_Windows(void);
79+
#endif
80+
7781

7882
/***********************************************************************
7983
**
@@ -422,7 +426,7 @@ static void *Task_Ready;
422426
// OS_Put_Str(title);
423427
// OS_Put_Str(":\n");
424428
// Use ASCII only (in case we are on non-unicode win32):
425-
MessageBoxA(NULL, content, title, MB_ICONHAND);
429+
MessageBoxA(NULL, (LPCSTR)content, (LPCSTR)title, MB_ICONHAND);
426430
}
427431
// OS_Put_Str(content);
428432
exit(100);
@@ -615,7 +619,7 @@ static void *Task_Ready;
615619
LARGE_INTEGER time;
616620

617621
if (!QueryPerformanceCounter(&time))
618-
OS_Crash(cb_cast("Missing resource"), "High performance timer");
622+
OS_Crash(cb_cast("Missing resource"), cb_cast("High performance timer"));
619623

620624
if (base == 0) return time.QuadPart; // counter (may not be time)
621625

@@ -1297,8 +1301,8 @@ static void *Task_Ready;
12971301
{
12981302
#define MAX_BRW_PATH 2044
12991303
long flag;
1300-
long len;
1301-
long type;
1304+
DWORD len;
1305+
DWORD type;
13021306
HKEY key;
13031307
REBCHR *path;
13041308
HWND hWnd = GetFocus();
@@ -1394,7 +1398,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
13941398
break;
13951399
}
13961400
if (lpData && set) {
1397-
SendMessage(hwnd, BFFM_SETSELECTION, lpLastBrowseFolder != lpData, lpData);
1401+
SendMessage(hwnd, BFFM_SETSELECTION, lpLastBrowseFolder != (LPITEMIDLIST)lpData, lpData);
13981402
}
13991403
return 0;
14001404
}
@@ -1414,11 +1418,15 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
14141418
bInfo.lpszTitle = fr->title; // Title of the dialog
14151419
bInfo.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
14161420
bInfo.lpfn = BrowseCallbackProc;
1421+
bInfo.iImage = -1;
14171422
// start in dir location is used /dir
1423+
if (dir) {
1424+
bInfo.lParam = (LPARAM)dir;
1425+
}
14181426
// else use last keeped result if used /keep
1419-
// else NULL if no /keep and /dir is there
1420-
bInfo.lParam = (dir) ? dir : (keep) ? lpLastBrowseFolder : NULL;
1421-
bInfo.iImage = -1;
1427+
else if (keep) {
1428+
bInfo.lParam = (LPARAM)lpLastBrowseFolder;
1429+
}
14221430

14231431
LPITEMIDLIST lpItem = SHBrowseForFolder( &bInfo);
14241432
if(lpItem == NULL) {
@@ -1428,7 +1436,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR
14281436
if (keep) {
14291437
// release last result if there was any
14301438
if(lpLastBrowseFolder)
1431-
CoTaskMemFree(lpLastBrowseFolder);
1439+
CoTaskMemFree((LPVOID)lpLastBrowseFolder);
14321440
// and store result for next request
14331441
lpLastBrowseFolder = lpItem;
14341442
}

src/os/win32/host-window.c

+1
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ void Paint_Window(HWND window);
12271227
BitmapInfo.bmiHeader.biClrImportant = 0;
12281228

12291229
hSourceBitmap = CreateDIBSection(hDC, &BitmapInfo, DIB_RGB_COLORS, (void**)&ppvBits, NULL, 0);
1230+
if (!hSourceBitmap) return NULL;
12301231

12311232
//Release the system display DC
12321233
ReleaseDC(NULL, hDC);

0 commit comments

Comments
 (0)