diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-03-01 21:36:12 +0100 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-03-03 22:07:45 +0100 |
commit | 50dfb465658a5c1705cac51a31f145fee8b6b168 (patch) | |
tree | c5ebae7ac13589e4ef74138076792faa25ba46ec /giscanner/annotationparser.py | |
parent | 7e41a4c31acf729cba6e071692d03779eba77eea (diff) | |
download | gobject-introspection-50dfb465658a5c1705cac51a31f145fee8b6b168.tar.gz |
scanner: allow (array zero-terminated) instead of (array zero-terminated=1)
What we already had:
- (array zero-terminated=1) > array which is NULL terminated
- (array zero-terminated=0) > array which is not NULL terminated
- (array) > array which is not NULL terminated
- (array zero-terminated=X) > array which is not NULL terminated
where X can be anything
What this patch adds:
- (array zero-terminated) > array which is NULL terminated
https://bugzilla.gnome.org/show_bug.cgi?id=657754
Diffstat (limited to 'giscanner/annotationparser.py')
-rw-r--r-- | giscanner/annotationparser.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index afeca9ce..907039c4 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -652,7 +652,7 @@ class GtkDocAnnotatable(object): return for option, value in options.items(): - if option in [OPT_ARRAY_ZERO_TERMINATED, OPT_ARRAY_FIXED_SIZE]: + if option == OPT_ARRAY_FIXED_SIZE: try: int(value) except (TypeError, ValueError): @@ -663,6 +663,11 @@ class GtkDocAnnotatable(object): warn('invalid "%s" annotation option "%s" value "%s", must be an integer' % (ann_name, option, value), position) + elif option == OPT_ARRAY_ZERO_TERMINATED: + if value is not None and value not in ['0', '1']: + warn('invalid "%s" annotation option "%s" value "%s", must be 0 or 1' % + (ann_name, option, value), + position) elif option == OPT_ARRAY_LENGTH: if value is None: warn('"%s" annotation option "length" needs a value' % (ann_name, ), |