Commit Graph

92 Commits

Author SHA1 Message Date
Philip Withnall
70ee43f1e9 glib: Add SPDX license headers automatically
Add SPDX license (but not copyright) headers to all files which follow a
certain pattern in their existing non-machine-readable header comment.

This commit was entirely generated using the command:
```
git ls-files glib/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs'
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-05-18 09:19:02 +01:00
Philip Withnall
7ab9359af0 gtimezone: Fix assertion failure when called with a huge offset
This looks like a regression from commit 3356934db5, but prior to that
commit there was always an assertion failure when calling
`g_time_zone_new_offset()` with an offset which is too large (such as 44
hours), ever since the function was added in commit cf24867b93.

It would be ideal if we could return a `NULL` timezone to indicate the
error, but that’s not part of the API for `g_time_zone_new_offset()`, so
we have to go with the dated and not-ideal approach of returning the UTC
timezone and letting the caller figure it out.

Another potential approach would be to reduce the `offset` modulo 24
hours. This makes the error less easily detectable than if returning
UTC, though, and still returns an invalid result: `+44:00` is not the
same timezone as `+20:00` (it’s one day further ahead).

Add a unit test.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2620
2022-03-16 12:52:13 +00:00
Loic Le Page
499cb2cd1a Fix non-initialized variable and signed/unsigned mismatch in glib/gtimezone.c 2022-02-18 10:53:35 +01:00
Tim Mooney
8cc71d35d0 Fix GDateTime timezone resolution for Illumos
Closes #2550
2022-01-14 22:39:56 -06:00
Emmanuel Fleury
6971f4f264 Fix signedness warnings in glib/gtimezone.c
glib/gtimezone.c: In function 'rules_from_windows_time_zone':
glib/gtimezone.c:926:56: warning: comparison of integer expressions of different signedness: 'int' and 'DWORD' {aka 'long unsigned int'}
       for (year = first, i = 0; *rules != NULL && year <= last; year++)
                                                        ^~
glib/gtimezone.c:946:20: warning: comparison of integer expressions of different signedness: 'int' and 'DWORD' {aka 'long unsigned int'}
           if (year > first && memcmp (&regtzi_prev, &regtzi, sizeof regtzi) == 0)
                    ^
glib/gtimezone.c: In function 'set_tz_name':
glib/gtimezone.c:1481:25: error: comparison of integer expressions of different signedness: 'int' and 'guint' {aka 'unsigned int'}
 1481 |   len = *pos - name_pos > size - 1 ? size - 1 : *pos - name_pos;
      |                         ^
glib/gtimezone.c:1481:49: error: operand of '?:' changes signedness from 'int' to 'guint' {aka 'unsigned int'} due to unsignedness of other operand
 1481 |   len = *pos - name_pos > size - 1 ? size - 1 : *pos - name_pos;
      |                                                 ^~~~~~~~~~~~~~~
glib/gtimezone.c: In function 'rules_from_identifier':
glib/gtimezone.c:1553:25: warning: comparison of integer expressions of different signedness: 'int' and 'guint' {aka 'unsigned int'}
           for (i = 0; i < rules_num - 1; i++)
                         ^
2021-10-19 18:44:20 +02:00
Philip Withnall
3356934db5 gtimezone: Deprecate g_time_zone_new()
Use `g_time_zone_new_identifier()` instead so you can get error
checking.

Adapt the tests to match.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #553
2020-11-21 23:11:23 +00:00
Philip Withnall
8105c36e84 gtimezone: Add new constructor which can report errors
Add a new variant of `g_time_zone_new()` which returns `NULL` on
failure to load a timezone, rather than silently returning UTC.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #553
2020-11-18 11:31:15 +00:00
Emmanuele Bassi
b5429b7e30 Merge branch 'six-days-to-eom' into 'master'
Fix the 6-days-until-the-end-of-the-month bug

Closes #2215

See merge request GNOME/glib!1683
2020-10-16 13:47:22 +00:00
Руслан Ижбулатов
da00779093 Fix the 6-days-until-the-end-of-the-month bug
The addition causes the date to shift
forward into 1st of the next month, because a 0-based offset
is compared to be "more than" the days in the month instead of "more than
or equal to".

This is triggered by corner-cases where transition date is 6 days
off the end of the month and our calculations put it at N+1th day of the
month (where N is the number of days in the month). The subtraction should
be triggered to move the date back a week, putting it 6 days off the end;
for example, October 25 for CET DST transition; but due to incorrect comparison
the date isn't shifted back, we add 31 days to October 1st and end up
at November 1st).

Fixes issue #2215.
2020-10-16 13:00:49 +00:00
António Fernandes
36e7b48ad5 Revert "gtimezone: Cache timezones based on the identifier they were created by"
This reverts commit 851241f19a.

That commit avoids a performance regression but introduces a behavior regression:
changes to /etc/localtime have no effect for the remaining of the application's
runtime.

With the optimization introduced by the previous commit, we can pass NULL to
g_time_zone_new() repeatedly with no performance drawback, so we no longer have
to workaround this case.

Fixes: #2224
2020-10-15 14:43:46 +01:00
António Fernandes
25e634b26b gtimezone: Cache default timezone indefinitely
We cache GTimeZone instances to avoid expensive construction when the
same id is requested again.

However, if the NULL id is passed to g_time_zone_new(), we always
construct a new instance for the default/fallback timezone.

With the recent introduction of some heavy calculations[1], repeated
instance construction in such cases has visible performance impact in
nautilus list view and other such GtkTreeView consumers.

To avoid this, cache reference to a constructed default timezone and
use it the next time g_time_zone_new() is called with NULL argument,
as long as the default identifier doesn't change. We already did the
same for the local timezone[2].

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2204

Based on idea proposed by Sebastian Keller <skeller@gnome.org>.

[1] 25d950b61f
[2] 551e83662d
2020-10-15 14:43:46 +01:00
António Fernandes
7e59a4c0d5 gtimezone: Set resolved_identifier earlier
We have been passing a &resolved_identifier address around for multiple
functions to set it. Each function may either:

    1.  leaving it for the next function to set, if returning early;
    2.  set it to a duplicate of the passed identifier, if not NULL;
    3.  get a fallback value and set it, otherwise.

This can be simplified by setting it early to either:

    1.  a duplicate of the passed identifier, if not NULL;
    2.  a fallback value, otherwise.

This way we can avoid some unnecessary string duplication and freeing.
Also, on Windows, we avoid calling windows_default_tzname() twice.

But the main motivation for this change is enabling the performance
optimization in the next commit.
2020-10-02 00:02:57 +01:00
António Fernandes
b4138bd4ac gtimezone: Split out fallback timezone identification for unix
When the TZ environment variable is not set, we get the local timezone
identifier by reading specific files.

We are going to need these identifiers earlier, so split this logic into
its own function, in preparation for the next commit.

Based on idea proposed by Sebastian Keller <skeller@gnome.org>.
2020-10-01 21:46:44 +01:00
Philip Withnall
851241f19a gtimezone: Cache timezones based on the identifier they were created by
Rather than invalidating the cache by comparing `TZ` to the cached
timezone identifier, key entirely off the value of `TZ` (and a cached
copy of it).

This fixes the timezone cache being constantly invalidated if `TZ` is
`NULL` (which will always differ from the identifier of the default
local timezone which is constructed from `g_time_zone_new (NULL)`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2204
2020-09-23 11:28:32 +01:00
Matthias Clasen
0992978202 timezone: Fix an uninitialized use
GTK ci rightly complains about this when ti builds
GLib as a subproject with -Werror=maybe-uninitialized.

subkey_dynamic_w will be freed without being initialized
when the first goto is taken.
2020-07-31 14:04:21 -04:00
Nirbheek Chauhan
c3c2c31335 glib: Use g_getenv everywhere instead of getenv
`getenv()` doesn't work well on Windows, f.ex., it can't fetch env
vars set with `SetEnvironmentVariable()`. This also means that it
doesn't work at all when targeting UWP since that's the only way to
set env vars in that case.
2020-07-23 13:57:59 +05:30
Paul Eggert
4408e69a0f gtimezone: add FIXME comments 2020-07-16 12:44:25 -07:00
Paul Eggert
7414dc2cb3 Clarify memset in set_tz_name
* glib/gtimezone.c (set_tz_name): Use size, not NAME_SIZE,
to clear the buffer.  Suggested by Philip Withnall in:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1533#note_867859
2020-07-16 12:44:25 -07:00
Paul Eggert
25d950b61f gtimezone: support footers in TZif files
Since tzcode95f (1995), TZif files have had a trailing
TZ string, used for timestamps after the last transition.
This string is specified in Internet RFC 8536 section 3.3.
init_zone_from_iana_info has ignored this string, causing it
to mishandle timestamps past the year 2038.  With zic's new -b
slim flag, init_zone_from_iana_info would even mishandle current
timestamps.  Fix this by parsing the trailing TZ string and adding
its transitions.

Closes #2129
2020-07-16 12:44:25 -07:00
Paul Eggert
68978631e5 gtimezone: add support for RFC 8536 time zone transitions
Time zone transition times can range from -167:59:59 through
+167:59:59, according to Internet RFC 8536 section 3.3.1;
this is an extension to POSIX.  It is needed for proper
support of TZif version 3 files.
2020-07-16 12:44:25 -07:00
Paul Eggert
325d17c49f gtimezone: allow hh to be 24, as per POSIX
POSIX allows hh to be 24; see
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
2020-07-16 12:44:25 -07:00
Paul Eggert
bc78f0ad27 gtimezone: support POSIX 1003.1-2001 quoted TZ abbreviations
TZ strings like '<-03>3' were introduced in POSIX 1003.1-2001 and
are currently specified in:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
2020-07-16 12:44:25 -07:00
Paul Eggert
21b000356e gtimezone: get 64-bit data from version-3 TZif files
Version 3 was introduced in tzdb 2013e (2013).
See Internet RFC 8536 section 3.1 under "ver(sion)".
2020-07-16 12:44:25 -07:00
Philip Withnall
00bfb3ab44 tree: Fix various typos and outdated terminology
This was mostly machine generated with the following command:
```
codespell \
    --builtin clear,rare,usage \
    --skip './po/*' --skip './.git/*' --skip './NEWS*' \
    --write-changes .
```
using the latest git version of `codespell` as per [these
instructions](https://github.com/codespell-project/codespell#user-content-updating).

Then I manually checked each change using `git add -p`, made a few
manual fixups and dropped a load of incorrect changes.

There are still some outdated or loaded terms used in GLib, mostly to do
with git branch terminology. They will need to be changed later as part
of a wider migration of git terminology.

If I’ve missed anything, please file an issue!

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-12 15:01:08 +01:00
Philip Withnall
a8ef5fdf8a gtimezone: Tidy up UTC timezone creation
Move the separate function inline using g_once_init_{enter,leave}(),
rather than g_once().

This marginally improves performance, taking 0.39s to create 10000000
UTC timezones, rather than 0.43s previously. (Who cares?)

Follow-up to !1105.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-24 10:26:01 +00:00
Daniel P. Berrange
3c0685ec4a gtimezone: fix parsing of Julian day in POSIX TZ format
The timezone(3) man page on Fedora 31 describes the start/end
field in the POSIX TZ format as follows:

[quote]
   The start field specifies when daylight  saving  time  goes
   into  effect and the end field specifies when the change is
   made back to standard time.  These fields may have the fol‐
   lowing formats:

   Jn     This  specifies  the Julian day with n between 1 and
          365.  Leap days are not counted.   In  this  format,
          February 29 can't be represented; February 28 is day
          59, and March 1 is always day 60.

   n      This specifies the  zero-based  Julian  day  with  n
          between  0  and 365.  February 29 is counted in leap
          years.

   Mm.w.d This specifies day d (0 <= d <= 6) of week w (1 <= w
          <=  5)  of  month  m  (1 <= m <= 12).  Week 1 is the
          first week in which day d occurs and week 5  is  the
          last week in which day d occurs.  Day 0 is a Sunday.
[/quote]

The GTimeZone code does not correctly parse the 'n' syntax,
treating it as having the range 1-365, the same as the 'Jn'
syntax. This is semantically broken as it makes it impossible
to represent the 366th day, which is the purpose of the 'n'
syntax.

There is a code comment saying this was done because the Linux
semantics are different from zOS and BSD. This is not correct,
as GLibC does indeed use the same 0-365 range as other operating
systems. It is believed that the original author was mislead by
a bug in old versions of the Linux libc timezone(3) man pages
which was fixed in

  commit 5a554f8e525faa98354c1b95bfe4aca7125a3657
  Author: Peter Schiffer <pschiffe@redhat.com>
  Date:   Sat Mar 24 16:08:10 2012 +1300

    tzset.3: Correct description for Julian 'n' date format

    The Julian 'n' date format counts atrting from 0, not 1.

    Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>

Fixes: #1999

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2020-01-15 14:11:59 +00:00
Daniel P. Berrange
6cd263f655 gtimezone: fix inverted ignore_leap param parsing julian day
The callers of parse_tz_boundary inverted the value passed
for the ignore_leap parameter. Fortunately the method impl
also had an inverted test cancelling out the first bug.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2020-01-15 14:11:59 +00:00
rim
551e83662d gtimezone: Cache UTC and local TZ indefinitely
Previously, these GTimeZone objects were being cached in the `time_zones` cache, but dropped from it when their final ref was dropped (which was frequently). That meant additional reads of `/etc/localtime` next time they were created, which was noticeable on profiles. Keep a permanent ref to the UTC and local timezones.
2019-10-25 17:27:49 +00:00
Philip Withnall
5dedc259b1 gtimezone: Clarify in docs that TZ can contain an absolute path
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-16 14:32:33 +01:00
Дилян Палаузов
512655aa12 minor typos in the documentation (a/an) 2019-08-24 19:14:05 +00:00
Chun-wei Fan
f24444c585 gtimezone.c: Fix identifier assignment on Windows
On Windows, we may be using the US DST boundaries by using the default
"Pacific Standard Time" for rules_from_windows_time_zone() in
rules_from_identifier().  This has the unfortunate side-effect of
hardcoding the out_identifier to "Pacific Standard Time", which is
likely not what we want.

Instead, upon retrieving the items successfully using
rules_from_windows_time_zone ("Pacific Standard Time", ...), we just
set the out_identifier to whatever identifier that was passed into
rules_from_identifier().
2019-07-05 18:52:02 +08:00
Chun-wei Fan
2e5d3aa911 glib/gtimezone.c: Use RegLoadMUIStringW() to query Std/Dlt strings
The existing method of using RegQueryValueExW() to query the Std/Dlt
strings can only retrive the localized versions of those strings, so
that means they will vary by the language version of Windows.  Instead,
use RegQueryValueExW() only as a fallback when RegLoadMUIStringW() fails,
as RegLoadMUIStringW() can query for the Std and Dlt strings in
whatever language we need by setting the locale stuff programatically on
the fly.
2019-07-05 18:52:02 +08:00
Chun-wei Fan
c868123c0a glib/gtimezone.c: Use Unicode versions of Windows Registry API
We are going to use RegLoadMUIStringW() in the next commit, since there
is no real RegLoadMUIStringA() function (it exists as a stub only).
This is done so that we are consistent along the way

Also fix rule_from_windows_time_zone_info() as we can't just do a strncpy()
of tzi->StandardName and tzi->DaylightName directly, as they are wchar_t/
gunichar2 strings, where we must convert to UTF-8 first.

https://bugzilla.gnome.org/show_bug.cgi?id=719344
2019-07-05 18:51:49 +08:00
Philip Withnall
05f7ea9fc5 gtimezone: Stop using deprecated API
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-30 10:38:45 +01:00
Emmanuel Fleury
9f44506d28 Fixing various warnings in glib/gtimezone.c
glib/gtimezone.c: In function ‘g_time_zone_unref’:
glib/gtimezone.c:241:29: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
           for (idx = 0; idx < tz->t_info->len; idx++)
                             ^
In file included from glib/glibconfig.h:9,
                 from glib/gtypes.h:32,
                 from glib/gtimezone.h:27,
                 from glib/gtimezone.c:24:
glib/gtimezone.c: In function ‘init_zone_from_iana_info’:
glib/gtimezone.c:578:34: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
       g_assert (trans.info_index < gtz->t_info->len);
                                  ^
glib/gmacros.h:455:25: note: in definition of macro ‘G_LIKELY’
 #define G_LIKELY(expr) (expr)
                         ^~~~
glib/gtimezone.c:578:7: note: in expansion of macro ‘g_assert’
       g_assert (trans.info_index < gtz->t_info->len);
       ^~~~~~~~
glib/gtimezone.c: In function ‘find_relative_date’:
glib/gtimezone.c:859:22: error: comparison of integer expressions of different signedness: ‘GDateWeekday’ {aka ‘enum <anonymous>’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
       if (first_wday > wday)
                      ^
glib/gtimezone.c: In function ‘init_zone_from_rules’:
glib/gtimezone.c:938:19: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
   for (ri = 0; ri < rules_num - 1; ri++)
                   ^
glib/gtimezone.c:958:19: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
   for (ri = 0; ri < rules_num - 1; ri++)
                   ^
glib/gtimezone.c: In function ‘g_time_zone_adjust_time’:
glib/gtimezone.c:1792:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
   for (i = 0; i <= intervals; i++)
                 ^~
glib/gtimezone.c:1825:39: error: comparison of integer expressions of different signedness: ‘gboolean’ {aka ‘int’} and ‘GTimeType’ {aka ‘enum <anonymous>’} [-Werror=sign-compare]
       else if (interval_isdst (tz, i) != type)
                                       ^~
glib/gtimezone.c:1832:22: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
           else if (i < intervals &&
                      ^
glib/gtimezone.c: In function ‘g_time_zone_find_interval’:
glib/gtimezone.c:1881:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
   for (i = 0; i <= intervals; i++)
                 ^~
glib/gtimezone.c:1900:35: error: comparison of integer expressions of different signedness: ‘gboolean’ {aka ‘int’} and ‘GTimeType’ {aka ‘enum <anonymous>’} [-Werror=sign-compare]
   else if (interval_isdst (tz, i) != type)
                                   ^~
glib/gtimezone.c:1905:18: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
       else if (i < intervals && time_ >= interval_local_start (tz, i + 1))
                  ^
2019-03-17 19:05:34 +01:00
Mart Raudsepp
2ceb48dfc2 gtimezone: Fallback to /etc/timezone on Gentoo
On non-systemd Gentoo systems the chosen timezone is expressed in
/etc/timezone and /etc/localtime may be a copy of the timezone
file instead of symlink. Add this path to the fallback test to
not regress dates into UTC.
2018-12-17 00:42:39 +02:00
Benjamin Otte
3aff811d13 Use G_GNUC_FALLTHROUGH where appropriate 2018-09-04 20:24:25 +02:00
Paul Eggert
137dd7789b gtimezone: port to tzcode 2014c
Problem reported by Marien Zwart in:
https://gitlab.gnome.org/GNOME/glib/issues/878
Derived from a fix by John Ralls proposed in that bug report.
2018-06-11 14:30:16 +01:00
Philip Withnall
12de474808 gtimezone: Fix two minor leaks in zone_info_unix()
• A leak of filename on an error path
 • A leak of resolved_identifier if no out_identifier return location
   was provided

The latter was spotted by Peter Bloomfield
(8945227743 (note_111254)).
Thanks!

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-05-16 11:27:25 +01:00
Ting-Wei Lan
50677e9336 gtimezone: Fallback to /var/db/zoneinfo on FreeBSD
The timezone setup utility of FreeBSD, tzsetup, which is run during the
installation, creates /etc/localtime by copying the chosen timezone file
from /usr/share/zoneinfo. Although it can correctly deal with the case
where /etc/localtime is a symlink, it is not the default and there is no
user interface to change the default copying behaviour.

Fortunately, tzsetup has been modified to write the name of the chosen
timezone to /var/db/zoneinfo in 2009, so we can know the name of the
current timezone by reading it. DragonflyBSD also seems to do the same
thing in its tzsetup.

https://svnweb.freebsd.org/changeset/base/198267
https://bugzilla.gnome.org/show_bug.cgi?id=795165
2018-05-02 17:33:10 +01:00
Georges Basile Stavracas Neto
cb32614382 timezone: Correctly resolve symlink from /etc/localtime
The return value of g_file_read_link ("/etc/localtime") can
be a relative path in the form of "../usr/share/zoneinfo".
This breaks the prefix check that is performed, and makes
the timezone identifier be "../usr/share/zoneinfo/America/Sao_Paulo",
for example, which breaks other parts of the system.

Fix that by canonicalizing the symlink path if we detect
is it a relative path.

(Tweaked by Philip Withnall <withnall@endlessm.com> to remove a
conditional which was unnecessary.)

https://bugzilla.gnome.org/show_bug.cgi?id=111848
2018-04-30 21:59:22 +01:00
Philip Withnall
cf24867b93 gtimezone: Add g_time_zone_new_offset() convenience constructor
This includes tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=676923
2018-04-13 15:25:26 +01:00
Philip Withnall
8945227743 gtimezone: Add g_time_zone_get_identifier() accessor
This is a non-trivial accessor which gets the identifier string used to
create the GTimeZone — unless the string passed to g_time_zone_new() was
invalid, in which case the identifier will be `UTC`.

Implementing this required reworking how timezone information was loaded
so that the tz->name is always set at the same time as tz->t_info, so
they are in sync. Previously, the tz->name was unconditionally set to
whatever was passed to g_time_zone_new(), and then not updated if the
tz->t_info was eventually set to the default UTC information.

This includes tests for the new g_time_zone_get_identifier() API, and
for the g_date_time_get_timezone() API added in the previous commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795165
2018-04-12 13:25:16 +01:00
Sébastien Wilmet
f9faac7661 glib/: LGPLv2+ -> LGPLv2.1+
All glib/*.{c,h} files have been processed, as well as gtester-report.

12 of those files are not licensed under LGPL:

	gbsearcharray.h
	gconstructor.h
	glibintl.h
	gmirroringtable.h
	gscripttable.h
	gtranslit-data.h
	gunibreak.h
	gunichartables.h
	gunicomp.h
	gunidecomp.h
	valgrind.h
	win_iconv.c

Some of them are generated files, some are licensed under a BSD-style
license and win_iconv.c is in the public domain.

Sub-directories inside glib/:

	deprecated/: processed in a previous commit
	glib-mirroring-tab/: already LGPLv2.1+
	gnulib/: not modified, the code is copied from gnulib
	libcharset/: a copy
	pcre/: a copy
	tests/: processed in a previous commit

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-24 11:58:19 +02:00
Christian Hergert
18a33f72db introspection: use (nullable) or (optional) instead of (allow-none)
If we have an input parameter (or return value) we need to use (nullable).
However, if it is an (inout) or (out) parameter, (optional) is sufficient.

It looks like (nullable) could be used for everything according to the
Annotation documentation, but (optional) is more specific.
2016-11-22 14:14:37 -08:00
John Ralls
35b401c8bb Bug 767824 - Some UTC timezones incorrectly recognized on Windows 7
The condition removed erroneously excluded UTC-based and DST-less
timezones and so left the GArray with no contents, so GTimeZone functions
returned whatever random garbage was in memory.
2016-06-19 15:03:20 -07:00
Gergely POLONKAI
d67813045d Fix typos in gbytes_hash and g_time_zone_find_interval docs
https://bugzilla.gnome.org/show_bug.cgi?id=733084
2014-07-14 08:39:34 -04:00
Ryan Lortie
4d327bdcb0 GTimeZone: remove some dead code
Remove code that parsed out and stored the unused isstd and isgmt
fields.
2014-06-27 13:21:15 -04:00
Matthias Clasen
3232425785 Docs: replace <literal> by ` 2014-02-06 08:07:16 -05:00
Matthias Clasen
cb588d4532 Convert external links to markdown syntax 2014-02-05 21:23:28 -05:00