Commit Graph

2998 Commits

Author SHA1 Message Date
Christian Hergert
52e44ddec2 datetime: avoid using __year
These were left over from when the inline functions where implemented
as macros.  They are no longer needed and where clashing with the
global __year anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=50076
2010-09-06 11:50:30 +01:00
Emmanuele Bassi
64300c0cc4 datetime: Add get_week_of_year()
https://bugzilla.gnome.org/show_bug.cgi?id=628029

Based on a patch by: Joseph Pingenot

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-06 11:50:30 +01:00
Emmanuele Bassi
70ef2e3bf6 datetime: Rename internal method
Use add_ymd(), to reflect the order of the arguments.
2010-09-06 11:50:30 +01:00
Emmanuele Bassi
959886d95e build: Fix warnings caused by missing includes 2010-09-06 11:43:04 +01:00
Matthias Clasen
f13d561211 More header inclusion cleanup 2010-09-05 00:23:03 -04:00
Emmanuele Bassi
581e68b7d3 gmain: Define _GNU_SOURCE before including glibconfig.h
As it pulls in unistd.h from something else.
2010-09-04 18:15:15 +01:00
Emmanuele Bassi
ca7dee5949 Build fixes for the fall-out of the inclusion changes 2010-09-04 18:04:34 +01:00
Emmanuele Bassi
b1dbcc4023 gtimer: Fix a compilation warning 2010-09-04 18:03:33 +01:00
Emmanuele Bassi
82db1446b3 Add missing gstrfuncs.h include
For g_strdup() and friends.
2010-09-04 17:22:18 +01:00
Matthias Clasen
04077ff5c5 More include cleanups 2010-09-03 23:03:14 -04:00
Matthias Clasen
dc2e46b2aa Don't include glib.h in other headers 2010-09-03 21:24:40 -04:00
Matthias Clasen
2effb8d0ea Remove excessive header includes 2010-09-03 21:20:07 -04:00
Matthias Clasen
7c68050451 Remove excessive header includes 2010-09-03 21:15:45 -04:00
Matthias Clasen
aad1921651 Don't include glib.h in other headers 2010-09-03 21:12:03 -04:00
Matthias Clasen
349aec676c Remove excessive header inclusions 2010-09-03 20:57:05 -04:00
Matthias Clasen
633f438300 Remove excessive header inclusions 2010-09-03 20:55:17 -04:00
Matthias Clasen
7ddd2100c3 Remove excessive header inclusions 2010-09-03 20:53:37 -04:00
Matthias Clasen
5681809448 Remove excessive header inclusions 2010-09-03 20:51:08 -04:00
Matthias Clasen
a376d9f4c8 Remove some unneeded headers 2010-09-03 20:46:40 -04:00
Matthias Clasen
92c577eeff Remove eexcessive header inclusions 2010-09-03 20:44:59 -04:00
Matthias Clasen
0a9eb80798 Remove redundant header inclusions 2010-09-03 20:41:52 -04:00
Matthias Clasen
6e3b14e155 Remove redundant header inclusions 2010-09-03 20:38:30 -04:00
Matthias Clasen
c5049d86f9 Remove redundant header inclusions 2010-09-03 20:34:15 -04:00
Matthias Clasen
96d87da379 Remove redundant header inclusions 2010-09-03 20:30:54 -04:00
Matthias Clasen
3e2f1e3825 Remove redundant header inclusions
and some whitespace cleanup.
2010-09-03 20:27:45 -04:00
Matthias Clasen
8f81ee86ee Remove redundant header inclusions 2010-09-03 20:15:16 -04:00
Matthias Clasen
d95c6b8834 Remove redundant header inclusions 2010-09-03 20:12:09 -04:00
Matthias Clasen
1409bbab67 Remove redundant header inclusions 2010-09-03 20:05:27 -04:00
Matthias Clasen
9471902d4d Remove redundant header inclusions 2010-09-03 20:01:55 -04:00
Matthias Clasen
ebcdbd9555 Remove redundant header inclusions
and clean up some whitespace
2010-09-03 19:49:34 -04:00
Matthias Clasen
9b3fb41a5e Remove redundant header inclusions
and clean up some whitespace
2010-09-03 19:41:49 -04:00
Matthias Clasen
156a3f7195 Whitespace cleanup 2010-09-03 19:38:56 -04:00
Matthias Clasen
8300820f7b Remove redundant header inclusions 2010-09-03 19:37:54 -04:00
Matthias Clasen
5d4ef36f91 Whitespace cleanup 2010-09-03 19:34:28 -04:00
Matthias Clasen
489b780bb9 Remove redundant header inclusions 2010-09-03 19:32:02 -04:00
Tor Lillqvist
6ddef375c8 Recuce DLL hijack risk on Windows
Don't call LoadLibrary() on shell32.dll or kernel32.dll. kernel32.dll
is always loaded. Shell32.dll is also already loaded as glib links to
functions in it. So just call GetModuleHandle() on them.

For mlang.dll in win_iconv.c and winhttp.dll in gwinhttpvfs.c, always
try loading them from a complete path, from the Windows system
directory.

Use the "tool help" API to enumerate modules in gmodule-win32.c. It is
present in all Windows versions since Windows 2000, which is all we
support anyway. Thus no need to look that API up dynamically. Just
link to it normally. We can bin the fallback code that attempts to use
the psapi API.
2010-09-02 22:36:47 +03:00
Jon Nordby
fb15dde6c1 docs: Inline docs from tmpl/memory.smgl 2010-09-01 09:48:16 +02:00
Jens Georg
db7ddcc195 Improve parsing of date-only iso8601 strings 2010-08-26 18:18:52 +03:00
Emmanuele Bassi
9a61fb2c64 datetime: Re-use add_dmy()
Avoid code duplication.
2010-08-26 12:58:19 +01:00
Tor Lillqvist
3c86a77ae5 Fix Win32 build 2010-08-26 12:41:46 +03:00
Matthias Clasen
ca26f9a502 Make this thing work 2010-08-26 00:16:30 -04:00
Matthias Clasen
b52cdaf2f0 Improve g_file_set_contents docs
Mention that the temporary filename is longer than the passed-in
filename, so people can avoid passing a name that is already
NAME_MAX long.
2010-08-26 00:00:56 -04:00
Matthias Clasen
8803182f4a Guarantee that g_get_tmp_dir () doesn't return an empty string
If it does, g_file_open_tmp() would be in trouble. Pointed
out by Morten Welinder in bug 627969.
2010-08-25 20:04:45 -04:00
Emmanuele Bassi
08877ee0dc datetime: Fix a thinko
We need to check if a year is a leap one *after* we increased it with
the given value, not before.
2010-08-25 23:08:18 +01:00
Emmanuele Bassi
026375b395 datetime: Avoid excessive copies in add_full()
The current implementation of g_date_time_add_full() creates multiple
GDateTime temporary objects and unrefs them immediately; even with the
slice allocator this could result in a performance bottleneck,
especially if the atomic integer operations fall back to slow paths.

We can isolate the components of the add_full() operation and create
internal modifiers that operate on an existing GDateTime; this brings
down the number of GDateTime copies created from six to one.

While at it, the test suite for add_full() should have more checks for
roll-over of months and days.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-25 23:04:42 +01:00
Emmanuele Bassi
99621efbd5 docs: Reword the datetime short description 2010-08-25 16:23:34 +01:00
Emmanuele Bassi
5e65ed4e44 datetime: Fix leap year check
Remove a FIXME and an approximation when computing the seconds from
the Unix epoch.
2010-08-25 13:42:48 +01:00
Emmanuele Bassi
2952e908e4 datetime: Fix coding style 2010-08-25 12:24:54 +01:00
Emmanuele Bassi
0a59ab6e85 datetime: Use %Z for the timezone name
We should try and follow strftime(3) for the format control characters
as much as possible.
2010-08-25 12:14:04 +01:00
Emmanuele Bassi
b4c0b958af datetime: Fix the format documentation
The %x format is for the preferred date, and the %X format is for the
preferred time.
2010-08-25 12:09:16 +01:00
Emmanuele Bassi
9a39b1d705 datetime: Clean up macros and unused variables
The most complex macros should be converted to inlined functions,
instead, to guarantee some type safety.
2010-08-25 12:06:47 +01:00
Emmanuele Bassi
0f87f09397 datetime: Remove the translation marker for a warning message 2010-08-25 00:27:49 +01:00
Thiago Santos
e1f13ee9ed Add GDateTime to GLib
GDateTime is an opaque data type containing a date and time
representation. It's immutable once created and reference
counted.

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

Based on the code by: Christian Hergert <chris@dronelabs.com>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-24 23:41:21 +01:00
Emmanuele Bassi
3cee971db5 Add C_() to glibintl.h 2010-08-24 22:48:15 +01:00
Cody Russell
0a9bfa1c7d Add const to _pcre_ucp_othercase() definition in pcre_internal.h 2010-08-23 12:34:53 -05:00
Matthias Clasen
780d6bfa88 Improve testutils test coverage 2010-08-23 00:38:19 -04:00
Matthias Clasen
fa6926e5d4 Improve printf test coverage 2010-08-23 00:38:19 -04:00
Matthias Clasen
7d970fadbc Improve GDate test coverate 2010-08-23 00:38:19 -04:00
Dan Winship
8f5ec0dad3 Fix misc compiler warnings in (mostly) test programs 2010-08-19 18:24:53 -04:00
Christian Persch
a35efb0939 G_OPTION_FLAG_NO_ARG is only for callback options
Bug #627252.
2010-08-18 15:32:07 +02:00
Matthias Clasen
789c0cc877 Fix a doc format issue 2010-08-16 15:30:04 -04:00
Simon McVittie
c29d800d84 GVariant: be more explicit about adopting and returning floating refs
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=622770
2010-08-13 22:42:24 -04:00
Matthias Clasen
e02571e93b Add bug references to some tests 2010-08-13 21:23:23 -04:00
Matthias Clasen
63d19f0656 Fix doc format errors 2010-08-13 21:11:19 -04:00
Havoc Pennington
106bde0a8f GAsyncQueue: use g_queue_init() not g_queue_new()
By using g_queue_init() instead of g_queue_new(), we can avoid
a separate memory allocation.

Bug 626704
2010-08-13 00:33:04 -04:00
Matthias Clasen
733d209b14 Move GRegex docs inline 2010-08-08 23:55:11 -04:00
Matthias Clasen
c3e5b3cca8 Whitespace cleanup 2010-08-08 23:55:11 -04:00
Matthias Clasen
de3c6efa22 Remove two redundant comments 2010-08-08 23:55:11 -04:00
Matthias Clasen
b5bda64a73 Fix up a doc typo 2010-08-08 23:55:11 -04:00
Matthias Clasen
f5a5863975 Minor cleanup
The definition is now present in pcre.h
2010-08-08 23:55:11 -04:00
Matthias Clasen
def0dc01f7 Move GConvert docs inline 2010-08-08 23:55:11 -04:00
Matthias Clasen
f9a4b4ecc7 Add introspection annotations in gregex.c
Also, make the new getters follow the style of other GRegex getters,
and take a const GRegex *.
2010-08-08 21:32:04 -04:00
Matthias Clasen
14e0ad7c53 Don't compile some unused functions in gio/xdgmime/ 2010-08-08 21:32:04 -04:00
Matthias Clasen
7acdaf6f1d Don't compile an unused function 2010-08-08 21:32:04 -04:00
Matthias Clasen
3fd1fc4f9a Trivial typo fix 2010-08-08 21:32:04 -04:00
Matthias Clasen
c9916d64b1 Improve regex test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
bbd1d2a724 Improve regex test coverage 2010-08-08 01:12:05 -04:00
Matthias Clasen
6ada7532b5 Drop some unused code
Some functions in pcre_get.c are not used.
2010-08-08 01:12:05 -04:00
Ryan Lortie
01cae84e47 Bug 578295 - gtester has a race condition
Deal with the race in GMainLoop by installing a do-nothing timeout.
2010-08-07 19:59:36 -04:00
Ryan Lortie
80046f36e0 gitignore update 2010-08-06 16:42:36 -04:00
Ryan Lortie
5e044a943c typo fix: Dist the data for the test cases
change 'dist_hook:' to 'dist-hook:'
2010-08-06 13:11:20 -04:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
Ryan Lortie
78f7f14b34 Don't dist 'glibconfig.h'
This is causing very serious problems when doing out-of-tree builds from
tarballs on architectures that are different from the architecture that
the tarball was created on.

This commit breaks the build in those cases, but I'll fix that in the
next commits.

https://bugzilla.gnome.org/show_bug.cgi?id=626107
2010-08-06 10:53:07 -04:00
Ryan Lortie
25c6bdc22a error test case: don't double-free the source
g_propagate_prefixed_error() frees the source already, don't
g_error_free() it.
2010-08-06 10:29:32 -04:00
Hannes Müller
a1b015f7b7 avoid warning in gutils.h when using gcc with -Wconversion
https://bugzilla.gnome.org/show_bug.cgi?id=619026
2010-08-05 23:18:45 +02:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00
Matthias Clasen
008615f999 Test an option handling corner-case 2010-08-05 02:24:26 -04:00
Matthias Clasen
e2657d8dce Add a not about arguments beginning with dashes 2010-08-05 02:24:25 -04:00
David Zeuthen
5e6f762d61 GVariant: validate that passed string is UTF-8
As discussed with Ryan on IRC.

This check is crucial because it guarantees that
g_variant_get_string() will _always_ return valid UTF-8. Except in
cases where the programmer used unsafe API such as
g_variant_new_from_data() and setting @trusted to TRUE.

In fact, this check revealed a flaw in my polkit gdbus port

 (lt-polkitd:11632): GLib-CRITICAL **: g_variant_new_string: assertion
 `g_utf8_validate (string, len, NULL)' failed

and with this I could easily find the problem by using gdb(1) and
G_DBUS=fatal-warnings.

Without this check we'd pass the non-UTF8 string all the way to the
message bus and the bus would then disconnect us. So instead I was
seeing

  g_dbus_connection_real_closed: Remote peer vanished with error:
  Underlying GIOStream returned 0 bytes on an async read
  (g-io-error-quark, 0). Exiting.

and then SIGTERM as raised by g_dbus_connection_real_closed() and my
polkitd process would exit. This behavior is much harder to debug than
failing early (as this patch implements).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 13:38:50 -04:00
Matthias Clasen
9b96e31968 Don't assert too much 2010-08-03 10:25:54 -04:00
Matthias Clasen
e4b5104003 Move bookmarkfile tests to the test framework 2010-08-03 10:25:54 -04:00
Emmanuele Bassi
b3de028a43 Update the Git ignore files 2010-08-03 14:21:02 +01:00
Mark Wielaard
f8ec75620d Don't add (extra) DESTDIR to tapsetdir for tapset_DATA.
https://bugzilla.gnome.org/show_bug.cgi?id=625876
2010-08-03 08:04:58 -04:00
Stef Walter
e7c7e46cf2 Add comment to g_date_set_time_val about local timezone.
Local time zone is used in conversion during g_date_set_time_val().
We now mention this in the documentation.

Fixes bug #625500
2010-08-01 07:22:11 +02:00
Matthias Clasen
ce7463a87b improve scanner api test coverage 2010-07-31 02:39:53 -04:00
Matthias Clasen
6d41af0f72 Improve tree test coverage 2010-07-31 02:15:03 -04:00
Matthias Clasen
a946577826 Improve keyfile test coverage 2010-07-31 02:14:51 -04:00
Matthias Clasen
ef4690c6c9 Test some GError functionality explicitly 2010-07-31 02:14:28 -04:00
Matthias Clasen
a4d0038c28 Add a test for g_variant_builder_add_parsed 2010-07-31 02:14:01 -04:00
Matthias Clasen
3c0f77a499 Fix a typo 2010-07-31 02:07:38 -04:00
Matthias Clasen
12e47411c3 Improve string test coverage 2010-07-31 00:56:11 -04:00
Matthias Clasen
dd25bdeff1 Improve byte array test coverage 2010-07-31 00:55:57 -04:00
Matthias Clasen
5f89498f07 improve printf tests coverage 2010-07-30 19:51:21 -04:00
Matthias Clasen
9100828185 Improve option context test coverage 2010-07-30 19:51:21 -04:00
Matthias Clasen
027905c27a Improve array test coverage 2010-07-30 19:51:21 -04:00
Matthias Clasen
03be0d7237 Move markup parse tests to the test framework 2010-07-30 19:51:21 -04:00
Matthias Clasen
60932b2f3d Improve regex test coverage 2010-07-30 19:51:20 -04:00
Matthias Clasen
154880b2ad Remove duplicate utf8 strreverse test
Also add some tests for find next/prev char.
2010-07-30 19:51:19 -04:00
Matthias Clasen
0e48b7ea7c Improve strfuncs test coverage a bit 2010-07-30 19:51:19 -04:00
Matthias Clasen
c617e94cf1 Improve option context test coverage a bit 2010-07-30 19:51:19 -04:00
Matthias Clasen
c4dd9fa41b Move markup collect tests to the test framework 2010-07-30 19:51:19 -04:00
Matthias Clasen
13ac9f94fd Add some more GFile tests 2010-07-30 19:51:19 -04:00
Matthias Clasen
b4ed2af52f Improve GNode test coverage a bit 2010-07-30 19:51:19 -04:00
Matthias Clasen
568eeeafe1 Add some logging tests 2010-07-30 19:51:18 -04:00
Matthias Clasen
2b113e4a9a Silence log handler tests 2010-07-30 19:51:18 -04:00
Matthias Clasen
b91cde6140 Improve tree test coverage 2010-07-30 19:51:18 -04:00
Matthias Clasen
c972d4df64 Move markup escape tests to test framework 2010-07-30 19:51:18 -04:00
Matthias Clasen
a804e22ed0 More pattern tests 2010-07-30 19:51:18 -04:00
Matthias Clasen
d3f0031361 Add tests for g_utf8_strreverse 2010-07-30 19:51:18 -04:00
Matthias Clasen
caa9453b72 Fix a warning 2010-07-30 19:51:18 -04:00
Matthias Clasen
d0750c9d6e Don't leak in converter test 2010-07-30 19:51:18 -04:00
Matthias Clasen
9d93dc5554 Remove some unused pcre code 2010-07-30 19:51:17 -04:00
Matthias Clasen
9fc3c980cc Add some volume monitor tests
Although not much of this is easily testable.
2010-07-30 19:51:17 -04:00
Matthias Clasen
e5a72ae3c4 Move queue tests to the test framework 2010-07-30 19:51:17 -04:00
Behdad Esfahbod
8f80ff02af Bug 624968 - div by zero in g_malloc_n family 2010-07-21 16:11:35 -04:00
Tomeu Vizoso
44cf10adce Add annotations for g_variant_new_strv and g_variant_get_strv 2010-07-15 17:05:00 +02:00
Ryan Lortie
3a8ab85d96 rename configure.in to configure.ac 2010-07-13 11:59:16 -04:00
Ryan Lortie
92df91590f trivial whitespace fix 2010-07-12 17:31:03 -04:00
Ryan Lortie
7791fce38a Fix some glib docs warnings
Remove some symbols from glib-sections.txt that gtk-doc has no idea
about.

Add proper callback typedefs for GTester (gtk-doc dislikes inline
function types).

Fix some other minor issues.
2010-07-12 16:56:52 -04:00
Matthias Clasen
dc8cf867c8 Don't return FALSE when a pointer is expected
Pointed out in bug 623956
2010-07-12 16:35:18 -04:00
Ryan Lortie
83d67bf2e7 move glibconfig.h to glib/ 2010-07-12 15:33:05 -04:00
Matthias Clasen
358b9d6ac7 Move main loop docs inline 2010-07-10 23:56:45 -04:00
Matthias Clasen
ab8cb652c8 Fix a typo 2010-07-10 23:56:45 -04:00
Matthias Clasen
e57291efdc Move docs for atomic operations inline 2010-07-10 23:56:45 -04:00
Matthias Clasen
e8503fddee Move GAsyncQueue docs inline 2010-07-10 23:56:45 -04:00
Colin Walters
d2fe46b476 Annotate all custom GIO GSource using g_source_set_name
Naming the sources allows easier debugging with e.g. SystemTap
probes.

https://bugzilla.gnome.org/show_bug.cgi?id=620536
2010-07-10 20:09:34 -04:00
Matthias Clasen
7568bb66f9 use proper feature test macros for isnan
Problem pointed out in bug 581354
2010-07-10 20:02:48 -04:00
Ryan Lortie
d44ae96cb1 GVariant: fix some more leaks in error cases 2010-07-10 19:15:59 -04:00
Ryan Lortie
90c49a0654 move the g_free() from the last commit down
It is needed for the error message...
2010-07-10 19:15:59 -04:00
Ryan Lortie
48a04f9303 GVariant: don't leak during type inferencing 2010-07-10 16:56:51 -04:00
Matthias Clasen
cc44ef148c Improve some GNode docs
See bug 561248
2010-07-08 19:26:25 -04:00
Matthias Clasen
ac342a8d0c Expand the g_sprintf docs
As requested in bug 576833.
2010-07-08 19:23:42 -04:00
Matthias Clasen
7cfa23b177 Add a note about l10n to the g_strconcat docs
As requested in bug 576854
2010-07-08 19:03:18 -04:00
Matthias Clasen
e0f2d0f28e Comment out an unused function
it is causing warnings, so it needs to die...bug 622600
2010-07-08 16:32:08 -04:00
Ryan Lortie
a00fa340cb base64: remove unnecessary assertions
Allow base64 encoding/decoding of empty strings.
2010-07-07 22:18:47 -04:00
Matthias Clasen
ddb919245c forgotten file 2010-07-07 22:03:02 -04:00
Ryan Lortie
2e53e50244 glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
Ryan Lortie
c243905c95 .gitignore updates 2010-07-07 16:52:41 -04:00
Ryan Lortie
32ce3e051a fix trivial copy/paste error in bytestring docs 2010-07-07 16:32:46 -04:00
Ryan Lortie
d9e90c3894 GVariant: improve bytestring support
- add G_VARIANT_TYPE_BYTESTRING, _BYTESTRING_ARRAY, _STRING_ARRAY

 - remove g_variant_{new,get}_byte_array functions

 - add g_variant_{new,get,dup}_bytestring{,_array} functions

 - remove undocumented support for deserialising arrays of objectpaths
   or signature strngs using g_variant_get_strv()

 - add and document new format strings '^ay', '^&ay', '^aay' and '^a&ay'

 - update GApplication to use the new API

 - update GSettings binding code to use the new API

 - add tests
2010-07-07 16:25:48 -04:00