diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-08 21:30:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-09 09:52:23 +0100 |
commit | a75b8e11664b14884fafac32f1dba678537cd3dc (patch) | |
tree | 85c003c3269c3685caf3c334f95b4c6ec59d1075 /solenv/bin | |
parent | 8cac3565f9d556dc8515fb9d747be7d2975d51d4 (diff) |
make factory a little more legible
Change-Id: I555e01ede3d8ce2a08f67c3ce6fc686861ea6519
Reviewed-on: https://gerrit.libreoffice.org/63139
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'solenv/bin')
-rwxr-xr-x | solenv/bin/native-code.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index ebdba44a6aba..8bde580dda5a 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -638,15 +638,16 @@ for constructor in sorted(full_constructor_map.keys()): print ('') for entry in sorted(custom_widgets): print ('void make' + entry + '();') -print ('static struct { const char *name; void(*func)(); } custom_widgets[] = {') +print ('typedef void (*custom_widget_func)();') +print ('static struct { const char *name; custom_widget_func func; } custom_widgets[] = {') for entry in sorted(custom_widgets): print (' { "make' + entry + '", make' + entry + ' },') print ('};') print ('') print (""" -void (*lo_get_custom_widget_func(const char* name))() +custom_widget_func lo_get_custom_widget_func(const char* name) { - for (int i = 0; i < sizeof(custom_widgets) / sizeof(custom_widgets[0]); i++) + for (size_t i = 0; i < sizeof(custom_widgets) / sizeof(custom_widgets[0]); i++) if (strcmp(name, custom_widgets[i].name) == 0) return custom_widgets[i].func; return nullptr; |