~ubuntu-branches/ubuntu/oneiric/json-glib/oneiric

« back to all changes in this revision

Viewing changes to json-glib/json-array.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-06-21 16:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20110621162902-ddd1ue8pgcqbpj6s
Tags: 0.13.4-1
* New upstream release. (Thanks to Ted Gould <ted@ubuntu.com>)
  - Fixes for removal of G_CONST_RETURN
* debian/libjson-glib-1.0-0.symbols: Update for 0.13.4
* debian/watch: Switch to .bz2 tarballs

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
  g_return_val_if_fail (array != NULL, NULL);
103
103
  g_return_val_if_fail (array->ref_count > 0, NULL);
104
104
 
105
 
  g_atomic_int_exchange_and_add (&array->ref_count, 1);
 
105
  g_atomic_int_add (&array->ref_count, 1);
106
106
 
107
107
  return array;
108
108
}
118
118
void
119
119
json_array_unref (JsonArray *array)
120
120
{
121
 
  gint old_ref;
122
 
 
123
121
  g_return_if_fail (array != NULL);
124
122
  g_return_if_fail (array->ref_count > 0);
125
123
 
126
 
  old_ref = g_atomic_int_get (&array->ref_count);
127
 
  if (old_ref > 1)
128
 
    g_atomic_int_compare_and_exchange (&array->ref_count, old_ref, old_ref - 1);
129
 
  else
 
124
  if (g_atomic_int_dec_and_test (&array->ref_count))
130
125
    {
131
126
      guint i;
132
127
 
321
316
 *
322
317
 * Since: 0.8
323
318
 */
324
 
G_CONST_RETURN gchar *
 
319
const gchar *
325
320
json_array_get_string_element (JsonArray *array,
326
321
                               guint      index_)
327
322
{