Commit Graph

12553 Commits

Author SHA1 Message Date
Ryan Lortie
5a85fe0e37 GVariant: fix string validation
String validation was done by checking if the string was valid utf8 and
ensuring that the first non-utf8 character was the last character (ie:
the nul terminator).

No check was actually done to make sure that this byte actually
contained a nul, however, so it was possible that you could have a
string like "hello\xff" with length 6 that would correctly validate.

Fix that, and test it.
2012-07-09 12:47:31 -04:00
Stef Walter
3b0f1cc432 Fix up GObject interface documentation
* Document how to override interfaces already implemented
   in a base class, and also call those base class implementations
   from a derived reimplementation.
 * Don't recomend people use base_init() style functions to
   initialize interface signals and properties, use default_init()
   aka class_init() instead (as G_DEFINE_INTERFACE() uses).
 * The above solves the interface init called multiple times
   problem, so remove some needless naysaying about that.
 * Document default_init() in the interface initialization discussion
 * Linkify more stuff.
 * Remove some crud and typos

https://bugzilla.gnome.org/show_bug.cgi?id=675504
2012-07-09 17:47:39 +02:00
Fran Diéguez
2cf9608d48 Updated Galician translations 2012-07-09 15:05:04 +02:00
Antoine Jacoutot
f9a6a97470 OpenBSD: explicitely define nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL condition.
2012-07-08 19:23:18 +02:00
Torsten Schönfeld
a511a706de gio: Add type macros for GFileAttributeInfoList and GFileAttributeMatcher
https://bugzilla.gnome.org/show_bug.cgi?id=616892
2012-07-08 00:47:01 +02:00
David Zeuthen
c09bf3e6b9 gdbus-codegen: improve casting a tiny wee bit
The in commit b79fbc5c3f for fixing
-Wstrict-aliasing warnings was a little too brutal, make it a bit
better.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-07 17:10:46 -04:00
Christian Persch
53b3175cfa regex: Add new GRegexError code from PCRE 8.31 2012-07-07 22:08:08 +02:00
Christian Persch
2188a5e59c regex: Enable fixed test
This problem was fixed in PCRE 8.31, so uncomment the test.
2012-07-07 22:08:08 +02:00
Christian Persch
9457833010 regex: Import PCRE 8.31
https://bugzilla.gnome.org/show_bug.cgi?id=679193
2012-07-07 22:08:02 +02:00
Ryan Lortie
f66052fc87 GVariant: support comparing booleans
g_variant_compare() is documented as working on booleans but somehow
this case was missed.  Add it and test it.

Problem discovered by Charles Kerr.
2012-07-06 17:29:30 -04:00
David Zeuthen
b79fbc5c3f gdbus-codegen: neuter warnings when using -Wstrict-aliasing
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-06 13:49:28 -04:00
David Zeuthen
d728eae85f gdbus-codegen: don't shadow variable
This avoids a warning when building with -Wshadow

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-06 13:49:28 -04:00
Ryan Lortie
ed492a5de2 GSettings: be more careful about keys names with /
Prevent attempts to access keys ending with slashes that exist in the
schema file as references to child schemas.

Also: don't emit change signals for these same keys.
2012-07-06 13:44:17 -04:00
Kjartan Maraas
52a6d7022a Updated Norwegian bokmål translation 2012-07-06 19:11:26 +02:00
Dan Winship
ee9aae5dcf Clarify the GLIB_VERSION_MIN_REQUIRED/MAX_ALLOWED docs
https://bugzilla.gnome.org/show_bug.cgi?id=674898
2012-07-06 12:10:42 -04:00
Dan Winship
40f0f66151 Deal with GLIB_VERSION_MIN_REQUIRED/MAX_ALLOWED being a "future" value
If GLIB_VERSION_MIN_REQUIRED or GLIB_VERSION_MAX_ALLOWED was defined
to a future value, we were essentially treating it as
GLIB_VERSION_0_0. Fix to treat it as being in the future instead.

https://bugzilla.gnome.org/show_bug.cgi?id=674898
2012-07-06 12:10:42 -04:00
Colin Walters
4ac0d78d5d GString: Tweak documentation, add g_string_free_to_bytes()
The docs for GString should really mention GByteArray, and what makes
it different.  Drop the comparison to Java which is dated and actually
inaccurate (because StringBuffer operates on Unicode).

While we're here, add g_string_free_to_bytes(), which further
complements the spread of GBytes-based API.  For example, one can
create a buffer using GString, then send it off via
g_output_stream_write_bytes().

https://bugzilla.gnome.org/show_bug.cgi?id=677064
2012-07-06 10:19:12 -04:00
David Zeuthen
d72116d8b7 gdbus-codegen: Don't generate invalid GObject property names
For a D-Bus property with name "Type" (fairly common), we used to
generate a GObject property with name "type-" and C accessors
get_type_() (to avoid clashing with the GType getter), set_type_()
(for symmetri).

However, the rules for GObject property names are fairly rigid and
specifically prohibit names ending in a dash.

Therefore change things so the chosen GObject property name is "type"
but preserve the naming rules for the C getter and setter (for the
same reasons: avoiding name clashing and symmetri).

This change does break the API of generated code (but only on the
GObject property level, the C symbols are not changed) but strictly
speaking the behavior was undefined since "type-" was an invalid
GObject property name.

Also add a test case for this.

Bug 679473.

https://bugzilla.gnome.org/show_bug.cgi?id=679473

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
2012-07-06 09:26:41 -04:00
Emmanuele Bassi
2a87010831 Constify collect and lcopy strings in GTypeValueTable
This avoids warnings when creating idiomatic value tables, like:

  static const GTypeValueTable _clutter_shader_float_value_table = {
    clutter_value_init_shader_float,
    clutter_value_free_shader_float,
    clutter_value_copy_shader_float,
    clutter_value_peek_pointer,
    "ip",
    clutter_value_collect_shader_float,
    "pp",
    clutter_value_lcopy_shader_float
  };

Because the strings are literals. And, really: nobody should be using
allocated values for the collection and lcopy strings.

https://bugzilla.gnome.org/show_bug.cgi?id=671545
2012-07-05 23:27:35 -04:00
Matthias Clasen
ab4cc22ba5 Improve the g_dir_read_name documentation
This function can return NULL in error cases as well. Document
this, and explain how to discriminate the cases.
https://bugzilla.gnome.org/show_bug.cgi?id=639771
2012-07-05 22:25:49 -04:00
Piotr Drąg
f416ece103 Updated POTFILES.in 2012-07-04 04:25:41 +02:00
Matthias Clasen
04af05fd1f Drop unneeded includes 2012-07-03 21:14:41 -04:00
Matthias Clasen
32192ee9e4 Split gcontenttype.c
Instead of a giant #if G_OS_WIN32 #else #endif around the entire
file, just split it into gcontenttype.c and gcontenttype-win32.c.
2012-07-03 21:13:32 -04:00
Marc-André Lureau
af3b1674cd win32: fix build after bug 674452 2012-07-03 21:01:31 -04:00
Ryan Lortie
5d7fa1c783 GObject docs fixup 2012-07-03 15:40:44 -04:00
Rico Tzschichholz
72660997bc glib/deprecated: Fix some version typos 2012-07-03 21:22:16 +02:00
Nilamdyuti Goswami
be249ac6ae Assamese translation updated 2012-07-03 21:01:59 +05:30
Alexander Shopov
45c48bffdd Updated Bulgarian translation 2012-07-03 16:55:12 +03:00
Neil Roberts
489b947c3b Fix the 'Since' tag for G_SOURCE_{REMOVE,CONTINUE}
The Since tag for these was saying 2.28 but it was actually added in
2.31. It looks like all of the Since tags list stable version numbers
so this patch bumps that up to 2.32.

https://bugzilla.gnome.org/show_bug.cgi?id=679258
2012-07-02 18:44:49 +01:00
Christian Persch
938c28b36b regex: Require PCRE 8.13
Bump the required version for external PCRE to 8.13, to fix the build
with external PCRE.
2012-07-02 18:02:15 +02:00
Daniel Mustieles
b5b1179d3f Updated Spanish translation 2012-07-02 17:34:59 +02:00
Daniel Mustieles
4b787aa31d Updated Spanish translation 2012-07-02 17:29:02 +02:00
Daniel Mustieles
1519d6b894 Fixed a a «big bug» in a string ;-) 2012-07-02 17:24:45 +02:00
Christian Persch
7483315f83 regex: Fix unicode othercasing
Reorder the toupper/tolower calls when othercaseing, so this
function is bug-for-bug compatible with the pcre internal tables.

https://bugzilla.gnome.org/show_bug.cgi?id=678273
2012-07-02 15:59:39 +02:00
Christian Persch
a2f54a3408 regex: Add FIRSTLINE compile flag
This option exists since PCRE 6.0.
2012-07-02 15:59:39 +02:00
Christian Persch
e99e34f65f regex: Add NOTEMPTY_ATSTART match option
Since PCRE 8.00 it supports a variant of PCRE_NOTEMPTY that works
similarly except that it only applies to the start of the matched string
but permits empty matches further in.
2012-07-02 15:59:39 +02:00
Christian Persch
1171215014 regex: Add PARTIAL_HARD match option
Since PCRE 8.00 it supports a new partial matching method PCRE_PARTIAL_HARD.
2012-07-02 15:59:39 +02:00
Christian Persch
0a2967030a regex: Add JavaScript compat mode
Since PCRE 7.7, there's a flag that changes the behaviour to be more
JavaScript compatible. Since it's no effort to expose it, just do so.
2012-07-02 15:59:39 +02:00
Christian Persch
e5550a24db regex: Don't leak internal PCRE options
g_regex_get_compile_get_compile_flags() and g_regex_get_match_flags()
were leaking PCRE flags that don't exist in the corresponding
public GRegexCompileFlags and GRegexMatchFlags; this change masks
these internal flags.
2012-07-02 15:59:39 +02:00
Christian Persch
26d91ddc08 regex: Add BSR_ANYCRLF and BSR_ANY match options
These flags override the compile option at match time. They use PCRE_BSR_ANYCRLF
and PCRE_BSR_UNICODE, resp., which make \R match only CR, LF and CRLF, or any
Unicode newline character or character sequences, resp.
2012-07-02 15:59:39 +02:00
Christian Persch
88ac3839f5 regex: Add BSR_ANYCRLF compile option
When this flag is set, \R only matches CR, LF and CRLF.
2012-07-02 15:59:39 +02:00
Christian Persch
86a04a05e6 regex: Fix newline definition for system PCRE
While we PCRE_BSR_UNICODE is the default in the internal PCRE, that may
not be true for the system one. Force the PCRE_BSR_UNICODE flag on it.
2012-07-02 15:59:39 +02:00
Christian Persch
91ba8ae156 regex: Don't return from inside a g_once_init_enter/leave block
When using the system PCRE, and it was compiled with incompatible options,
the code was returning from inside a g_once_init_enter/leave block without
calling g_once_init_leave().
2012-07-02 15:59:38 +02:00
Christian Persch
69a12e3275 regex: Add accessor for PCRE_INFO_HASCRORLF
This flag is new in PCRE 7.3, and checks whether there is an explicit
CR or LF reference in the pattern.
2012-07-02 15:59:34 +02:00
Christian Persch
7ada976516 regex: Remove message for unused error code
Since PCRE 7.3 the PCRE_ERROR_NULLWSLIMIT error is not returned anymore.
2012-07-02 14:17:34 +02:00
Christian Persch
592531019e regex: Add NEWLINE_ANYCRLF match option
This PCRE option is new in PCRE 7.1.
2012-07-02 14:17:34 +02:00
Christian Persch
c8c049b177 regex: Add NEWLINE_ANYCRLF compile option
The PCRE_NEWLINE_ANYCRLF option is new in PCRE 7.1. With it set, the only
only newline sequences recognised are CR, LF and CRLF.
2012-07-02 14:17:34 +02:00
Christian Persch
7e8b5ea442 regex: Assert that our flags values are the same as PCRE's
We rely on those flags having the same values as PCRE's (so we can pass
them right through), so assert this at compile time.
2012-07-02 14:17:34 +02:00
Simon Feltman
03611f7c06 Updated codegen to work with python3.
Most changes were just replacing usage of "has_key" with "in".
Also updated the sorting function which was simplified and
changed to a "key" function instead of "cmp" (which is no longer
supported in python3. Verified everything builds with
python 2.7 and 3.

https://bugzilla.gnome.org/show_bug.cgi?id=678066
2012-07-01 11:14:54 -04:00
Christian Persch
6d5484b296 regex: Handle PCRE_ERROR_RECURSIONLOOP
Was missing from the error conversion routine.
2012-07-01 14:00:11 +02:00