<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gjs.git/modules/cairo-pdf-surface.cpp, branch includes</title>
<subtitle>gitlab.gnome.org: GNOME/gjs.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/'/>
<entry>
<title>CI: Fix IWYU includes</title>
<updated>2020-09-20T19:24:08+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2020-09-20T05:14:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=19e519aad8ffc65e39c6095575ed66ff8d257cca'/>
<id>19e519aad8ffc65e39c6095575ed66ff8d257cca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: Use C++17 attributes</title>
<updated>2020-08-06T01:15:31+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2020-08-01T20:46:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=a4d40792f6b39772197137d7737b3f4daf2022f0'/>
<id>a4d40792f6b39772197137d7737b3f4daf2022f0</id>
<content type='text'>
Now that we depend on C++17, we can use these attributes that are part
of the language, instead of relying on macros to make them portable.
(GJS_USE still needs to be defined for public header files, which may be
compiled in C.)

Attributes which are new in C++17 are [[maybe_unused]], [[nodiscard]],
and [[fallthrough]].

[skip cpplint] because cpplint doesn't deal with C++ attributes:
https://github.com/google/styleguide/issues/165
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we depend on C++17, we can use these attributes that are part
of the language, instead of relying on macros to make them portable.
(GJS_USE still needs to be defined for public header files, which may be
compiled in C.)

Attributes which are new in C++17 are [[maybe_unused]], [[nodiscard]],
and [[fallthrough]].

[skip cpplint] because cpplint doesn't deal with C++ attributes:
https://github.com/google/styleguide/issues/165
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Define Symbol.toStringTag names on all our custom classes</title>
<updated>2020-07-28T04:32:26+00:00</updated>
<author>
<name>Evan Welsh</name>
<email>noreply@evanwelsh.com</email>
</author>
<published>2020-07-05T23:58:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=065df98260317e2e8c4b9ec843e16b9d931e22b3'/>
<id>065df98260317e2e8c4b9ec843e16b9d931e22b3</id>
<content type='text'>
SpiderMonkey 78 will stop using the JSClass.name string as the string
tag. For backwards compatibility, we should make sure the string tag
doesn't change.

See: GNOME/gjs#329
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SpiderMonkey 78 will stop using the JSClass.name string as the string
tag. For backwards compatibility, we should make sure the string tag
doesn't change.

See: GNOME/gjs#329
</pre>
</div>
</content>
</entry>
<entry>
<title>cairo: Use cairo_surface_t as the private pointer for Cairo.Surface</title>
<updated>2020-05-23T14:38:43+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2020-05-03T16:09:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=9303ffa4f7187d64bc94bff19e954781d5c2b194'/>
<id>9303ffa4f7187d64bc94bff19e954781d5c2b194</id>
<content type='text'>
Instead of allocating a separate private struct that allocates a
cairo_surface_t, use the cairo_surface_t directly as the private struct.
This makes the code simpler and saves 8 bytes per object.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of allocating a separate private struct that allocates a
cairo_surface_t, use the cairo_surface_t directly as the private struct.
This makes the code simpler and saves 8 bytes per object.
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Remove jsapi-wrapper.h</title>
<updated>2020-01-19T23:40:14+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2019-11-24T07:07:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=d783d40c8162ed94254bdb3762592cdbece6e5ba'/>
<id>d783d40c8162ed94254bdb3762592cdbece6e5ba</id>
<content type='text'>
With SpiderMonkey 68, it's no longer necessary to mark SpiderMonkey
header files as system headers, and it's also no longer necessary to
include &lt;js-config.h&gt; before any other header files, as SpiderMonkey
has sorted that out internally.

We remove jsapi-wrapper.h and define DEBUG directly in config.h instead
of indirectly in jsapi-wrapper.h via HAVE_SPIDERMONKEY_DEBUG.

This should reduce compile time, on average, because in most .h files
we now only need to include &lt;js/TypeDecls.h&gt;.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With SpiderMonkey 68, it's no longer necessary to mark SpiderMonkey
header files as system headers, and it's also no longer necessary to
include &lt;js-config.h&gt; before any other header files, as SpiderMonkey
has sorted that out internally.

We remove jsapi-wrapper.h and define DEBUG directly in config.h instead
of indirectly in jsapi-wrapper.h via HAVE_SPIDERMONKEY_DEBUG.

This should reduce compile time, on average, because in most .h files
we now only need to include &lt;js/TypeDecls.h&gt;.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: Fix header includes once and for all</title>
<updated>2019-06-09T06:11:29+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2019-06-01T06:40:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=01920362be26a2cb4e38b55cc211351391885d1d'/>
<id>01920362be26a2cb4e38b55cc211351391885d1d</id>
<content type='text'>
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.

IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.

We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously #include statements were a bit of a mess across the codebase.
This commit is the result of a pass by the IWYU (Include What You Use)
tool, which suggests headers to add or remove based on what is in the
file, and can also suggest forward-declaring classes instead of
including their headers, if they are only used as a pointer in a
particular file. Cleaning this up should in general speed up compile
times.

IWYU isn't perfect, it produces a number of false positives, so we don't
try to automate this process and we don't accept all of its
recommendations. We do add a script and configuration file to the tools/
directory so that IWYU can be every so often in the future.

We also clean up all the includes according to a consistent style, which
is now described clearly in the C++ style guide.
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: Remove C-style NULLs from some files</title>
<updated>2019-06-09T04:42:41+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2019-06-01T05:16:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=916677785ed17dc5dde965113820c695c95d936d'/>
<id>916677785ed17dc5dde965113820c695c95d936d</id>
<content type='text'>
In files where the IWYU tool would recommend including &lt;stddef.h&gt; only
for the symbol NULL, we instead remove usage of NULL in favour of
C++-style nullptr, or implicit conversion to bool.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In files where the IWYU tool would recommend including &lt;stddef.h&gt; only
for the symbol NULL, we instead remove usage of NULL in favour of
C++-style nullptr, or implicit conversion to bool.
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Introduce annotations for using return values</title>
<updated>2018-10-30T13:31:44+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip.chimento@gmail.com</email>
</author>
<published>2018-10-29T00:16:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=425b94d663e400b6dee9ed2ebd1c92738970b054'/>
<id>425b94d663e400b6dee9ed2ebd1c92738970b054</id>
<content type='text'>
This introduces two annotations to functions. GJS_USE is a macro for GCC
and Clang's "warn_unused_result" annotation, meaning that the return
value of a function must not be ignored. This allows us to catch some
cases where we are neglecting to do error checking.

The second annotation is GJS_JSAPI_RETURN_CONVENTION which for now is
identical to GJS_USE, but could be made into a custom annotation in the
future which a static analyzer plugin could use to enforce further checks
at compile time. The "JSAPI return convention" is valid on functions that
return bool or a pointer type, and whose first parameter is JSContext*. If
false or nullptr is returned, then an exception must be pending at return
time on the passed-in JSContext. If true or a non-nullptr value is
returned, then no exception must be pending.

This commit only has the addition of the attributes, and a few fixes
mandated by the autoformatter, so it can be reviewed "lightly".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This introduces two annotations to functions. GJS_USE is a macro for GCC
and Clang's "warn_unused_result" annotation, meaning that the return
value of a function must not be ignored. This allows us to catch some
cases where we are neglecting to do error checking.

The second annotation is GJS_JSAPI_RETURN_CONVENTION which for now is
identical to GJS_USE, but could be made into a custom annotation in the
future which a static analyzer plugin could use to enforce further checks
at compile time. The "JSAPI return convention" is valid on functions that
return bool or a pointer type, and whose first parameter is JSContext*. If
false or nullptr is returned, then an exception must be pending at return
time on the passed-in JSContext. If true or a non-nullptr value is
returned, then no exception must be pending.

This commit only has the addition of the attributes, and a few fixes
mandated by the autoformatter, so it can be reviewed "lightly".
</pre>
</div>
</content>
</entry>
<entry>
<title>js: Use correct autoptr in gjs_string_to_filename()</title>
<updated>2017-07-18T15:27:17+00:00</updated>
<author>
<name>Philip Chimento</name>
<email>philip@endlessm.com</email>
</author>
<published>2017-07-13T17:43:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=9ddca8b4fa2c42205d578d9ee782586d5b492618'/>
<id>9ddca8b4fa2c42205d578d9ee782586d5b492618</id>
<content type='text'>
The return value of g_filename_from_utf8() (must be freed with g_free())
was getting assigned to a GjsAutoJSChar (which would be freed with
JS_free()). Instead gjs_string_to_filename() must have a GjsAutoChar
output parameter.

This requires changing gjs_parse_call_args() as well. We improve it by
allowing to pass in autoptrs for 's' or 'F' args instead of char**.

Fixes a few minor memory leaks, mostly in error paths in Cairo functions.

https://bugzilla.gnome.org/show_bug.cgi?id=785040
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The return value of g_filename_from_utf8() (must be freed with g_free())
was getting assigned to a GjsAutoJSChar (which would be freed with
JS_free()). Instead gjs_string_to_filename() must have a GjsAutoChar
output parameter.

This requires changing gjs_parse_call_args() as well. We improve it by
allowing to pass in autoptrs for 's' or 'F' args instead of char**.

Fixes a few minor memory leaks, mostly in error paths in Cairo functions.

https://bugzilla.gnome.org/show_bug.cgi?id=785040
</pre>
</div>
</content>
</entry>
<entry>
<title>modules/cairo-*-surface.cpp: Silence compiler warnings</title>
<updated>2017-05-24T18:34:27+00:00</updated>
<author>
<name>Chun-wei Fan</name>
<email>fanchunwei@src.gnome.org</email>
</author>
<published>2017-05-24T14:03:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gjs.git/commit/?id=418fabc8c9964490f3bf58146a647824c254cd12'/>
<id>418fabc8c9964490f3bf58146a647824c254cd12</id>
<content type='text'>
Since we moved to a using std::unique_ptr, the filename variables might
be seen by the compiler as possibly uninitialized, so just set them as
mullptr to silence the compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=783031
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we moved to a using std::unique_ptr, the filename variables might
be seen by the compiler as possibly uninitialized, so just set them as
mullptr to silence the compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=783031
</pre>
</div>
</content>
</entry>
</feed>
