Skip to content

Commit

Permalink
[examples] SDL: fix concat and replace t with p sig
Browse files Browse the repository at this point in the history
really need to revert  0a8cc07 remove support for deprecated "t" nci signatures
  • Loading branch information
Reini Urban committed Mar 6, 2014
1 parent 15db84b commit 4541272
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
11 changes: 7 additions & 4 deletions runtime/parrot/library/SDL.pir
Expand Up @@ -93,6 +93,7 @@ In fact, don't count on it sticking around. It may not. Then again, it might.
.local string sdlpath
sdlpath = env['SDLLIBPATH']
if sdlpath == '' goto default_locations
print "SDLLIBPATH="
say sdlpath
loadlib libsdl, sdlpath
if libsdl goto OK
Expand Down Expand Up @@ -121,10 +122,10 @@ failed:
throw $P0
branch OK
OK_HINT1:
printerr "Hint: create a link from libSDL-1.2.so to libSDL.so to disable the error messages.\n"
printerr "Hint: use -X or export SDLLIBPATH or create a link from libSDL-1.2.so to libSDL.so to disable the error messages.\n"
branch OK
OK_HINT2:
printerr "Hint: create a link from libSDL-1.2.so.0 to libSDL_image.so to disable the error messages.\n"
printerr "Hint: use -X or export SDLLIBPATH or create a link from libSDL-1.2.so.0 to libSDL_image.so to disable the error messages.\n"
OK:

.local string c_func_name
Expand Down Expand Up @@ -158,9 +159,11 @@ failed:
set_hll_global ['SDL'; 'NCI'], 'WaitEvent', sdl_function
dlfunc sdl_function, libsdl, 'SDL_PollEvent', 'ip'
set_hll_global ['SDL'; 'NCI'], 'PollEvent', sdl_function
dlfunc sdl_function, libsdl, 'SDL_GetKeyName', 'ti'
#was 'ti'
dlfunc sdl_function, libsdl, 'SDL_GetKeyName', 'pi'
set_hll_global ['SDL'; 'NCI'], 'GetKeyName', sdl_function
dlfunc sdl_function, libsdl, 'SDL_GetError', 'tv'
#was 'tv'
dlfunc sdl_function, libsdl, 'SDL_GetError', 'pv'
set_hll_global ['SDL'; 'NCI'], 'GetError', sdl_function
dlfunc sdl_function, libsdl, 'SDL_SetColorKey', 'ipii'
set_hll_global ['SDL'; 'NCI'], 'SetColorKey', sdl_function
Expand Down
4 changes: 1 addition & 3 deletions runtime/parrot/library/SDL/Event.pir
Expand Up @@ -95,9 +95,7 @@ this directly, unless you're working with raw SDL calls.

.local pmc layout
.local string ename

ename = 'Event::'
concat ename, name
ename = concat 'Event::', name

layout = fetch_layout( ename )
assign event, layout
Expand Down
8 changes: 2 additions & 6 deletions runtime/parrot/library/SDL/EventHandler.pir
Expand Up @@ -110,9 +110,7 @@ remainder - sorry.
key_name = event.'event_keyname'()
.local string key_method_name
key_method_name = 'key_down_'
concat key_method_name, key_name
key_method_name = concat 'key_down_', key_name
.local int can_handle
can can_handle, self, key_method_name
Expand Down Expand Up @@ -145,9 +143,7 @@ want to override the C<key_up_*> methods instead.
key_name = event.'event_keyname'()
.local string key_method_name
key_method_name = 'key_up_'
concat key_method_name, key_name
key_method_name = concat 'key_up_', key_name
.local int can_handle
can can_handle, self, key_method_name
Expand Down

0 comments on commit 4541272

Please sign in to comment.