Tor Lillqvist
548ddd5fe9
Fix build on Windows and possibly other non-Linux platforms
...
Include glibconfig.h in files that test G_OS_WIN32. Include headers
for GLib APIs used conditionally where needed.
2010-09-06 15:57:32 +03:00
Emmanuele Bassi
2aa135ee3d
Whitespace fixes
2010-09-06 12:26:40 +01:00
Damien Lespiau
43098d0038
datetime: Rename shadowing variables
...
timezone and tzname shadow variables declared in time.h. Let's rename
them to time_zone and tz_name then.
https://bugzilla.gnome.org/show_bug.cgi?id=628839
2010-09-06 11:51:11 +01:00
Thiago Santos
875ad12345
gdatetime: Use proleptic gregorian
...
Use Proleptic Gregorian calendar instead of the Julian calendar
as the internal representation.
https://bugzilla.gnome.org/show_bug.cgi?id=50076
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com >
2010-09-06 11:50:30 +01:00
Christian Hergert
6bb89501cf
datetime: use g_utf8_next_char() to walk utf8 string
...
Previously, the format string was iterated many times by
walking to the given offset in the string repeatedly.
This patch instead walks the string using g_utf8_next_char().
Additionally, the character for lookups was a char and could
loose content. This uses gunichar instead.
https://bugzilla.gnome.org/show_bug.cgi?id=50076
2010-09-06 11:50:30 +01:00
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