@@ -143,7 +143,7 @@ info_push_transfer (lua_State *L, GITransfer transfer)
143143#define H (n1 , n2 ) \
144144 else if (transfer == GI_TRANSFER_ ## n1) \
145145 { \
146- lua_pushstring (L, #n2); \
146+ lua_pushliteral (L, #n2); \
147147 return 1; \
148148 }
149149 H (NOTHING , none )
@@ -177,7 +177,7 @@ info_index (lua_State *L)
177177 {
178178#define H (n1 , n2 ) \
179179 case GI_INFO_TYPE_ ## n1: \
180- lua_pushstring (L, #n2); \
180+ lua_pushliteral (L, #n2); \
181181 return 1;
182182
183183 H (FUNCTION , function )
@@ -435,11 +435,20 @@ info_index (lua_State *L)
435435 if (strcmp (prop , "direction" ) == 0 )
436436 {
437437 GIDirection dir = g_arg_info_get_direction (* info );
438- if (dir == GI_DIRECTION_OUT )
439- lua_pushstring (L , g_arg_info_is_caller_allocates (* info )
440- ? "out-caller-alloc" : "out" );
441- else
442- lua_pushstring (L , dir == GI_DIRECTION_IN ? "in" : "inout" );
438+ switch (dir ) {
439+ case GI_DIRECTION_IN :
440+ lua_pushliteral (L , "in" );
441+ break ;
442+ case GI_DIRECTION_OUT :
443+ if (g_arg_info_is_caller_allocates (* info ))
444+ lua_pushliteral (L , "out-caller-alloc" );
445+ else
446+ lua_pushliteral (L , "out" );
447+ break ;
448+ case GI_DIRECTION_INOUT :
449+ lua_pushliteral (L , "inout" );
450+ break ;
451+ }
443452 return 1 ;
444453 }
445454 if (strcmp (prop , "transfer" ) == 0 )
@@ -536,7 +545,7 @@ info_index (lua_State *L)
536545 {
537546#define H (n1 , n2 ) \
538547 case GI_ARRAY_TYPE_ ## n1: \
539- lua_pushstring (L, #n2); \
548+ lua_pushliteral (L, #n2); \
540549 return 1;
541550
542551 H (C , c )
0 commit comments