| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This reverts commit f606183a010fbec4382acb728882cc0eddbaf7f7.
See https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/9#note_409979
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> Certain types like GIConv and GdkAtom are pointers internally but don't
> look like pointers when referenced. They have the form.
>
> typedef struct _X *X;
>
> Parse these as structures/records but mark them in the gir with a 'disguised'
> attribute so that we know that they need special handling.
Additionally, stop relaying on disguised attribute when deciding whether
to render a page. Check number of fields instead, so as to avoid
introducing large regression in the docs.
Fixes #101.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide partial support for multi-dimensional arrays by representing
them as flattened one dimensional array with size that is equal to
product of sizes in each dimension. Previously only the first dimension
would be actually used.
This should be sufficient to ensure that those fields have layout
compatible with C, without using nested array types that are currently
unsupported by vapigen
Issue #255.
|
|
|
|
|
|
|
|
| |
This also reverts workaround introduced to support this use case in
f77cfc4275b1fba4f9fedea6e40b00e0ebbe142c, since it is no longer
necessary.
Fixes issue #141.
|
|
|
|
|
|
|
|
|
|
| |
Neither `_create_source_type` nor `_create_complete_source_type`
actually support fixed size arrays, so previously generated C types were
incorrect.
Remove C types from array fields instead of producing incorrect ones.
Fixes issue #145.
|
|
|
|
|
|
|
|
|
| |
With !45 special casing of bool in the lexer was removed which previously allowed the usage of
bool without including stdbool.h. This breaks scanning of graphene headers
which guarded the stdbool include with __GI_SCANNER__ (I haven't figured out why).
Add back the special handling for bool in the lexer and also map it to gboolean like
_Bool as if stdbool.h was included.
|
|
|
|
| |
We only support 3.4+ now.
|
|
|
|
|
|
|
|
|
|
|
| |
Some documentation tool (as hotdoc[0]) need to have information about
symbol declaration and documentation positions in the source files
to be able to do smart indexing (automatically build the documenation
index).
[0] https://hotdoc.github.io/
Fixes #175
|
|
|
|
|
|
|
|
|
| |
Configure option gir_dir_prefix is used to configure install dir for
.gir files, so add its value to include file search paths.
Fix for flake8 and meson-test at same time.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
g-i includes an old version of pep8 and pyflakes and uses that
during "make check".
It (1) doesn't catch all cases newer versions of pycodestyle/pyflakes catch
and (2) doesn't test all Python files (3) doesn't work with meson.
Instead of updating just remove them and depend on flake8 instead.
To run the checks simply run flake8 in the root dir.
This also makes it possible to run those checks when using meson and
not autotools.
To not get test suite failures on flake8 updates move the checks from
"make check" to an extra "make check.quality" target.
|
|
|
|
|
|
|
|
| |
On OS X, the output of sed as reported back to Python has a newline at
the end. It seems like a good idea to strip whitespace from the symbol
and identifier filter commands anyhow, so strip() the result.
https://bugzilla.gnome.org/show_bug.cgi?id=752468
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows
Instead of passing the filter commands to the shell, split them with the shlex module.
This gives us more control and a more similar behaviour on unix/win32 systems.
I could only find two users in Debian which just call python with some script, so
this seems safe to me.
Adjust the tests accordingly and use the running python executable to test the
functionality as we can be sure that's available on all platforms. Also add a
new test for the symbol filter commadn which wasn't tested before.
|
|
|
|
| |
See !24 for the discussion
|
|\
| |
| |
| |
| |
| |
| | |
Perform array to pointer adjustment in function parameters.
Closes #189
See merge request GNOME/gobject-introspection!8
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A declaration of a parameter as "array of type" shall be adjusted to
"qualified pointer to type". This change performs this adjustment.
For example, this makes parameters of following functions equivalent:
```
void f1(const char s[]);
void f2(const char s[10]);
void f3(const char *s);
```
Fixes issue #189.
|
|/
|
|
| |
Fixes issue #184.
|
|
|
|
|
|
|
|
| |
On OS X, the output of sed as reported back to Python has a newline at
the end. It seems like a good idea to strip whitespace from the symbol
and identifier filter commands anyhow, so strip() the result.
See #139.
|
|
|
|
|
|
|
|
|
|
|
| |
We now reuse _create_type_from_base instead of reimplementing
it in a semi-broken way in transformer, and use complete_ctype
when writing it out if available.
This incidentally allows us to remove a test where the comment
acknowledged the non-optimal behaviour.
https://bugzilla.gnome.org/show_bug.cgi?id=779959
|
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=760682
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
|
|
|
|
|
|
| |
We need to encode the identifier-filter command to bytes, and decode its
outputs to ascii in order for it to work on Python 3.x.
https://bugzilla.gnome.org/show_bug.cgi?id=757126
|
|
|
|
|
|
|
|
|
|
| |
g-ir-scanner now supports something like this:
typedef void my_callback(int);
Notice how my_callback is not a pointer.
https://bugzilla.gnome.org/show_bug.cgi?id=755645
|
|
|
|
|
|
|
| |
They're just internal bits for users of C, shouldn't be part of the
API.
https://bugzilla.gnome.org/show_bug.cgi?id=755882
|
|
|
|
|
|
|
|
| |
Use key function instead of cmp for list.sort which is compatible
with both Python 2 and 3. Make sure a list is returned from split
function. Don't use identity comparison "is" on strings.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add unicode_literals future import which turns any string literal
into a unicode string. Return unicode strings from the Python C extension
module. Force writing of annotations (g-ir-annotation-tool) to output utf8
encoded data to stdout.
This is an initial pass at following the "unicode sandwich"
model of programming (http://nedbatchelder.com/text/unipain.html)
needed for supporting Python 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
| |
Replace occurances of "%r" (repr) in format strings where the intended
behaviour is to output a quoted string "'foo'" with explicit usage
of "'%s'". This is needed to move the codebase to unicode literals
in order to upgrade to Python 3. Python 2 unicode strings are expanded
with repr formatting prefixed with a "u" as in "u'foo'" which causes
failures for various text formatting scenarios.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Use future import "print_function" and update relevant uses of print
as a function call. See: PEP 3105
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
| |
Import Python 3 compatible "true division" from the future (PEP 238).
This changes the Python 2 classic division which uses floor division
on integers to true division. Verfied we don't actually use the
division operator anywhere in the code base so this a safety for
supporting both Python 2 and 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
| |
Use absolute_import to ensure Python 3 compatibility of the code base.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Replace usage of iteritems() and itervalues() with items() and values()
respectively.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
| |
Convert the results map() calls to a list for Python 3 compatibility.
In Python 3, map() returns an iterable "map object" which does not
allow indexing or iteration more than once.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Atk has a "typedef GSList AtkAttributeSet", which causes
an ast.Alias() targeting a ast.List(). The latter has a
target_fundamental of '<list>', which cannot be looked
up in ast.type_names (because it's not a real fundamental
type), and that breaks the build.
It turns out that we don't need to find the fundamental
type and then the fundamental type node - the target
field of the ast.Alias already points to the desired
type node.
https://bugzilla.gnome.org/show_bug.cgi?id=755681
|
|
|
|
|
| |
Updated from:
https://raw.githubusercontent.com/jcrocholl/pep8/1.6.2/pep8.py
|
|
|
|
|
|
| |
we haven't been emitting the warning for about six
years (see 7dbbda9abea9882d2c98726f382a905fa8738706)
so remove the leftovers...
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extract cache and data dir lookup code into documented
get_user_cache_dir() and get_system_data_dirs() functions.
Note that previously, the data dirs code did not fall
back to '/usr/local/share:/usr/share' when the XDG_DATA_DIRS
environment variable was either not set or empty, as required
by the XDG Base Directory Specification.
https://bugzilla.gnome.org/show_bug.cgi?id=747770
|
|
|
|
|
|
|
|
|
|
| |
Add the command line flag --symbol-filter-cmd to g-ir-scanner
which allows running symbol names through a filtering shell
command. The symbol is sent as stdin to the filter command
and expects a filtered result written to stdout.
https://bugzilla.gnome.org/show_bug.cgi?id=744534
Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
|
|
|
|
|
|
|
|
|
| |
It was assumed that cache store was always working, this
also removes a round trip to the cache store. So performance
should also get a small boost.
https://bugzilla.gnome.org/show_bug.cgi?id=746231
Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
|
|
|
|
|
|
|
|
|
| |
Add the command line flag --identifier-filter-cmd to g-ir-scanner which
allows running identifier names through a filtering shell command. The
identifier is sent as stdin to the filter command and expects a filtered
result written to stdout.
https://bugzilla.gnome.org/show_bug.cgi?706898
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove GInitiallyUnowned special case in gdumpparser where fields are
copied from GObject. Add generic solution where anytime we have multiple
typedef structs, the fields become shared:
typedef struct _Foo Foo;
typedef struct _Foo Bar;
struct _Foo {...};
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
|
| |
Move exception handling of various symbol/identifier stripping into the
outer level parse function. This removes a lot of embedded try excepts
peppered throughout the code by letting exceptions flow to the top level
where they can be handled just as gracefully.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
|
| |
Remove the caching of typedefs in Transformer._typedef_ns. This is no longer
used due to the added _tag_ns cache which store tags rather than typedefs.
Remove adding of callback typdefs to the typedef_ns since these were not
being used anyhow.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
| |
Generalize _create_tag_ns_struct for both structs and unions. Remove
_create_compound newer struct parsing code has completely replaced it.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
| |
Add _create_member_struct for the parsing of nested structs. This is
precursory work to remove the member/anonymous flag from other struct/union
creation code and allow simplification of those code paths.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
|
| |
Add structs parsed from C's "tag namespace" into their own cache for lookup
by typdef parsing. This fixes issues where a typedef declared after a
struct would not have a correct name. This also cleans up the need for
special casing struct tags prefixed with an underscore.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
|
|
|
|
|
|
|
|
| |
Aliasing TRUE or FALSE is not very common, but done occasionally
for extra clarity. Namely G_SOURCE_REMOVE / G_SOURCE_CONTINUE are
self-explanatory, unlike the "raw" booleans.
https://bugzilla.gnome.org/show_bug.cgi?id=719566
|
|
|
|
| |
tests/warn/unkown-parameter.h:41 still passes with this...
|
|
|
|
|
| |
Last call sites where removed in 36aa515f1036978ced8d4ffb808260844f7229e0
about 3 years ago.
|
|
|
|
|
| |
Updated from:
https://raw.github.com/jcrocholl/pep8/1.4.6/pep8.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Version in our tree is a wee bit outdated. For example,
later work will introduce an utf8 encoded python source
file which our old pep8.py does not yet understand (yeah,
it really was *that* ancient)...
Updated from:
https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py
Takes 552c1f1525e37a30376790151c1ba437776682c5,
f941537d1c0a40f0906490ed160db6c79af572d3,
5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and
a17f157e19bd6792c00321c8020dca5e5a281f45 into account...
https://bugzilla.gnome.org/show_bug.cgi?id=699535
|
|
|
|
|
|
|
| |
The transformer doesn't need the annotations, so why are
we giving it to it?
https://bugzilla.gnome.org/show_bug.cgi?id=699854
|
|
|
|
|
|
| |
It's more readable and as an added bonus Python 3 compatible.
https://bugzilla.gnome.org/show_bug.cgi?id=697616
|