mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
fpi-context: Make fpi_get_driver_types to return an array
No need to create one all the times and the fill it with what we need.
This commit is contained in:
11
meson.build
11
meson.build
@@ -151,21 +151,20 @@ drivers_type_func = []
|
||||
drivers_type_list += '#include <glib-object.h>'
|
||||
drivers_type_list += '#include "fpi-context.h"'
|
||||
drivers_type_list += ''
|
||||
drivers_type_func += 'void fpi_get_driver_types (GArray *drivers)'
|
||||
drivers_type_func += 'GArray *'
|
||||
drivers_type_func += 'fpi_get_driver_types (void)'
|
||||
drivers_type_func += '{'
|
||||
drivers_type_func += ' GArray *drivers = g_array_new (TRUE, FALSE, sizeof (GType));'
|
||||
drivers_type_func += ' GType t;'
|
||||
drivers_type_func += ''
|
||||
idx = 0
|
||||
foreach driver: drivers
|
||||
drivers_type_list += 'extern GType (fpi_device_' + driver + '_get_type) (void);'
|
||||
drivers_type_func += ' t = fpi_device_' + driver + '_get_type ();'
|
||||
drivers_type_func += ' g_array_append_val (drivers, t);'
|
||||
if idx != drivers.length() - 1
|
||||
drivers_type_func += ''
|
||||
idx += 1
|
||||
endif
|
||||
drivers_type_func += ''
|
||||
endforeach
|
||||
drivers_type_list += ''
|
||||
drivers_type_func += ' return drivers;'
|
||||
drivers_type_func += '}'
|
||||
|
||||
root_inc = include_directories('.')
|
||||
|
||||
Reference in New Issue
Block a user