diff options
| author | Autumn! <autumnull@posteo.net> | 2023-05-24 20:37:00 +0000 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2023-06-04 09:23:18 +0200 |
| commit | 3ca5d97376151d6f1a4a1787b6609c470a05a82c (patch) | |
| tree | 624e7cdf0711f30512b9ce03c67fd9356073b1ad /sdl2/keyboard.ha | |
| parent | added some missing bindings (diff) | |
| download | hare-chip8-3ca5d97376151d6f1a4a1787b6609c470a05a82c.tar.gz | |
Use types::c:: instead of char and strings::
Signed-off-by: Autumn! <autumnull@posteo.net>
Diffstat (limited to 'sdl2/keyboard.ha')
| -rw-r--r-- | sdl2/keyboard.ha | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sdl2/keyboard.ha b/sdl2/keyboard.ha index eb38afd..d42fa8a 100644 --- a/sdl2/keyboard.ha +++ b/sdl2/keyboard.ha @@ -1,4 +1,4 @@ -use strings; +use types::c; export type SDL_Scancode = enum uint { UNKNOWN = 0, @@ -632,14 +632,14 @@ export type SDL_Keysym = struct { unused: u32, }; -@symbol("SDL_GetKeyFromName") fn _SDL_GetKeyFromName(name: *const char) SDL_Keycode; +@symbol("SDL_GetKeyFromName") fn _SDL_GetKeyFromName(name: *const c::char) SDL_Keycode; export fn SDL_GetKeyFromName(name: str) (SDL_Keycode | error) = { - const name = strings::to_c(name); + const name = c::fromstr(name); defer free(name); const sym = _SDL_GetKeyFromName(name); if (sym == SDL_Keycode::UNKNOWN) { - return strings::fromc(SDL_GetError()): error; + return c::tostr(SDL_GetError()): error; }; return sym; }; |
