Skip to content

Commit

Permalink
fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Aug 26, 2023
1 parent ef3be73 commit eefac3e
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ u32 RGFW_keyStrToKeyCode(char* key) {
return XStringToKeysym(key);
#endif
#ifdef RGFW_WINDOWS
if (sizeof(key)/sizeof(char) > 1) {
if (key[1]) {
struct{char* key; i32 code;} keyStrs[] = {
{"Super_L", VK_LWIN},
{"Super_R", VK_RWIN},
Expand Down Expand Up @@ -2072,8 +2072,6 @@ wglChoosePixelFormatARB_type *wglChoosePixelFormatARB;
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002

RGFW_window* RGFW_createWindow(const char* name, i32 x, i32 y, i32 w, i32 h, u64 args) {
static char RGFW_trashed = 0;

#ifdef RGFW_WGL_LOAD
if (wglinstance == NULL) {
wglinstance = LoadLibraryA("opengl32.dll");
Expand All @@ -2085,12 +2083,10 @@ RGFW_window* RGFW_createWindow(const char* name, i32 x, i32 y, i32 w, i32 h, u64
}
#endif

if (name == "") name = (char*)" ";
if (name[0] == 0) name = (char*)" ";

RGFW_window* win = (RGFW_window*)malloc(sizeof(RGFW_window));

i32 pf;

u32* r = RGFW_window_screenSize(win);

if (RGFW_FULLSCREEN & args) {
Expand Down Expand Up @@ -2131,7 +2127,8 @@ RGFW_window* RGFW_createWindow(const char* name, i32 x, i32 y, i32 w, i32 h, u64

RegisterClassA(&Class);

DWORD window_style = WS_MAXIMIZEBOX | WS_MINIMIZEBOX | window_style;
DWORD window_style = 0;
window_style = WS_MAXIMIZEBOX | WS_MINIMIZEBOX | window_style;

if (!(RGFW_NO_BORDER & args))
window_style |= WS_CAPTION | WS_SYSMENU | WS_BORDER;
Expand Down Expand Up @@ -2290,8 +2287,6 @@ RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) {

MSG msg = {};

i32 setButton = 0;

if (win->event.droppedFilesCount) {
i32 i;
for (i = 0; i < win->event.droppedFilesCount; i++)
Expand Down Expand Up @@ -2620,13 +2615,10 @@ const char* RGFW_window_readClipboard(RGFW_window* win) {
void RGFW_window_writeClipboard(RGFW_window* win, const char* text, u32 textLen) {
if (!RGFW_ValidWindowCheck(win, (char*)"RGFW_window_writeClipboard")) return;

i32 characterCount;
HANDLE object;
WCHAR* buffer;

MultiByteToWideChar(CP_UTF8, 0, text, -1, NULL, textLen);
if (!characterCount)
return;

object = GlobalAlloc(GMEM_MOVEABLE, textLen * sizeof(WCHAR));
if (!object)
Expand Down

0 comments on commit eefac3e

Please sign in to comment.