diff options
Diffstat (limited to 'sdl2')
| -rw-r--r-- | sdl2/image/image.ha | 4 | ||||
| -rw-r--r-- | sdl2/keyboard.ha | 2 | ||||
| -rw-r--r-- | sdl2/video.ha | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/sdl2/image/image.ha b/sdl2/image/image.ha index 32f8f3d..b4af99e 100644 --- a/sdl2/image/image.ha +++ b/sdl2/image/image.ha @@ -27,7 +27,7 @@ export @symbol("IMG_Quit") fn IMG_Quit() void; // Load an image from a file path. export fn IMG_Load(file: str) (*sdl2::SDL_Surface | sdl2::error) = { - const file = c::fromstr(file); + const file = c::fromstr(file)!; defer free(file); return sdl2::wrapptr(_IMG_Load(file))?: *sdl2::SDL_Surface; }; @@ -40,7 +40,7 @@ export fn IMG_LoadTexture( SDL_Renderer: *sdl2::SDL_Renderer, file: str, ) (*sdl2::SDL_Texture | sdl2::error) = { - const file = c::fromstr(file); + const file = c::fromstr(file)!; defer free(file); return sdl2::wrapptr(_IMG_LoadTexture(SDL_Renderer, file))?: *sdl2::SDL_Texture; }; diff --git a/sdl2/keyboard.ha b/sdl2/keyboard.ha index b9759dd..02cedae 100644 --- a/sdl2/keyboard.ha +++ b/sdl2/keyboard.ha @@ -635,7 +635,7 @@ export type SDL_Keysym = struct { @symbol("SDL_GetKeyFromName") fn _SDL_GetKeyFromName(name: *const c::char) SDL_Keycode; export fn SDL_GetKeyFromName(name: str) (SDL_Keycode | error) = { - const name = c::fromstr(name); + const name = c::fromstr(name)!; defer free(name); const sym = _SDL_GetKeyFromName(name); if (sym == SDL_Keycode::UNKNOWN) { diff --git a/sdl2/video.ha b/sdl2/video.ha index 2627b48..72ed96f 100644 --- a/sdl2/video.ha +++ b/sdl2/video.ha @@ -78,7 +78,7 @@ export fn SDL_CreateWindow( h: int, flags: SDL_WindowFlags, ) (*SDL_Window | error) = { - let title = c::fromstr(title); + let title = c::fromstr(title)!; defer free(title); return wrapptr(_SDL_CreateWindow(title, x, y, w, h, flags))?: *SDL_Window; }; |
