1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
diff -Naur glib-2.18.4-orig/glib/gatomic.c glib-2.18.4/glib/gatomic.c
--- glib-2.18.4-orig/glib/gatomic.c 2009-04-02 15:20:51.000000000 -0400
+++ glib-2.18.4/glib/gatomic.c 2009-04-02 15:36:21.000000000 -0400
@@ -36,7 +36,7 @@
/* Adapted from CVS version 1.10 of glibc's sysdeps/i386/i486/bits/atomic.h
*/
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -48,7 +48,7 @@
}
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
__asm__ __volatile__ ("lock; addl %1,%0"
@@ -57,7 +57,7 @@
}
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -75,7 +75,7 @@
* arguments and calling the former function */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -103,7 +103,7 @@
# if GLIB_SIZEOF_VOID_P == 4 /* 32-bit system */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -116,7 +116,7 @@
}
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -162,7 +162,7 @@
})
# if GLIB_SIZEOF_VOID_P == 4 /* 32-bit system */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -188,7 +188,7 @@
}
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -220,7 +220,7 @@
/* Adapted from CVS version 1.9 of glibc's sysdeps/x86_64/bits/atomic.h
*/
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -232,7 +232,7 @@
}
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
__asm__ __volatile__ ("lock; addl %1,%0"
@@ -241,7 +241,7 @@
}
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -255,7 +255,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -277,7 +277,7 @@
/* Non-optimizing compile bails on the following two asm statements
* for reasons unknown to the author */
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result, temp;
@@ -303,7 +303,7 @@
/* The same as above, to save a function call repeated here */
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result, temp;
@@ -327,7 +327,7 @@
}
# else /* !__OPTIMIZE__ */
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -339,7 +339,7 @@
}
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -351,7 +351,7 @@
# if GLIB_SIZEOF_VOID_P == 4 /* 32-bit system */
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -383,7 +383,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -415,7 +415,7 @@
}
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -449,7 +449,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -489,7 +489,7 @@
/* Adapted from CVS version 1.8 of glibc's sysdeps/ia64/bits/atomic.h
*/
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
return __sync_fetch_and_add (atomic, val);
@@ -503,7 +503,7 @@
}
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -511,7 +511,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -534,7 +534,7 @@
# if GLIB_SIZEOF_VOID_P == 4 /* 32-bit system */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -546,7 +546,7 @@
}
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -590,7 +590,7 @@
}
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -604,7 +604,7 @@
}
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
atomic_spin_lock();
@@ -613,7 +613,7 @@
}
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -633,7 +633,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -675,21 +675,21 @@
# endif
gint32
-g_atomic_int_exchange_and_add (volatile gint32 *atomic,
+g_atomic_int_exchange_and_add (volatile gint32 G_GNUC_MAY_ALIAS *atomic,
gint32 val)
{
return InterlockedExchangeAdd (atomic, val);
}
void
-g_atomic_int_add (volatile gint32 *atomic,
+g_atomic_int_add (volatile gint32 G_GNUC_MAY_ALIAS *atomic,
gint32 val)
{
InterlockedExchangeAdd (atomic, val);
}
gboolean
-g_atomic_int_compare_and_exchange (volatile gint32 *atomic,
+g_atomic_int_compare_and_exchange (volatile gint32 G_GNUC_MAY_ALIAS *atomic,
gint32 oldval,
gint32 newval)
{
@@ -705,7 +705,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -726,7 +726,7 @@
static GMutex *g_atomic_mutex;
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -741,7 +741,7 @@
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
g_mutex_lock (g_atomic_mutex);
@@ -750,7 +750,7 @@
}
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -770,7 +770,7 @@
}
gboolean
-g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval)
{
@@ -791,7 +791,7 @@
#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
gint
-g_atomic_int_get (volatile gint *atomic)
+g_atomic_int_get (volatile gint G_GNUC_MAY_ALIAS *atomic)
{
gint result;
@@ -803,7 +803,7 @@
}
void
-g_atomic_int_set (volatile gint *atomic,
+g_atomic_int_set (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint newval)
{
g_mutex_lock (g_atomic_mutex);
@@ -812,7 +812,7 @@
}
gpointer
-g_atomic_pointer_get (volatile gpointer *atomic)
+g_atomic_pointer_get (volatile gpointer G_GNUC_MAY_ALIAS *atomic)
{
gpointer result;
@@ -824,7 +824,7 @@
}
void
-g_atomic_pointer_set (volatile gpointer *atomic,
+g_atomic_pointer_set (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer newval)
{
g_mutex_lock (g_atomic_mutex);
@@ -834,14 +834,14 @@
#endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
#elif defined (G_ATOMIC_OP_MEMORY_BARRIER_NEEDED)
gint
-g_atomic_int_get (volatile gint *atomic)
+g_atomic_int_get (volatile gint G_GNUC_MAY_ALIAS *atomic)
{
G_ATOMIC_MEMORY_BARRIER;
return *atomic;
}
void
-g_atomic_int_set (volatile gint *atomic,
+g_atomic_int_set (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint newval)
{
*atomic = newval;
@@ -849,14 +849,14 @@
}
gpointer
-g_atomic_pointer_get (volatile gpointer *atomic)
+g_atomic_pointer_get (volatile gpointer G_GNUC_MAY_ALIAS *atomic)
{
G_ATOMIC_MEMORY_BARRIER;
return *atomic;
}
void
-g_atomic_pointer_set (volatile gpointer *atomic,
+g_atomic_pointer_set (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer newval)
{
*atomic = newval;
@@ -866,7 +866,7 @@
#ifdef ATOMIC_INT_CMP_XCHG
gboolean
-g_atomic_int_compare_and_exchange (volatile gint *atomic,
+g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval)
{
@@ -874,7 +874,7 @@
}
gint
-g_atomic_int_exchange_and_add (volatile gint *atomic,
+g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -886,7 +886,7 @@
}
void
-g_atomic_int_add (volatile gint *atomic,
+g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
gint result;
@@ -906,26 +906,26 @@
#ifndef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
gint
-(g_atomic_int_get) (volatile gint *atomic)
+(g_atomic_int_get) (volatile gint G_GNUC_MAY_ALIAS *atomic)
{
return g_atomic_int_get (atomic);
}
void
-(g_atomic_int_set) (volatile gint *atomic,
+(g_atomic_int_set) (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint newval)
{
g_atomic_int_set (atomic, newval);
}
gpointer
-(g_atomic_pointer_get) (volatile gpointer *atomic)
+(g_atomic_pointer_get) (volatile gpointer G_GNUC_MAY_ALIAS *atomic)
{
return g_atomic_pointer_get (atomic);
}
void
-(g_atomic_pointer_set) (volatile gpointer *atomic,
+(g_atomic_pointer_set) (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer newval)
{
g_atomic_pointer_set (atomic, newval);
diff -Naur glib-2.18.4-orig/glib/gatomic.h glib-2.18.4/glib/gatomic.h
--- glib-2.18.4-orig/glib/gatomic.h 2009-04-02 15:20:51.000000000 -0400
+++ glib-2.18.4/glib/gatomic.h 2009-04-02 15:40:20.000000000 -0400
@@ -38,29 +38,42 @@
G_BEGIN_DECLS
-gint g_atomic_int_exchange_and_add (volatile gint *atomic,
+gint g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val);
-void g_atomic_int_add (volatile gint *atomic,
+void g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val);
-gboolean g_atomic_int_compare_and_exchange (volatile gint *atomic,
+gboolean g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint oldval,
gint newval);
-gboolean g_atomic_pointer_compare_and_exchange (volatile gpointer *atomic,
+gboolean g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer oldval,
gpointer newval);
-gint g_atomic_int_get (volatile gint *atomic);
-void g_atomic_int_set (volatile gint *atomic,
+gint g_atomic_int_get (volatile gint G_GNUC_MAY_ALIAS *atomic);
+void g_atomic_int_set (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint newval);
-gpointer g_atomic_pointer_get (volatile gpointer *atomic);
-void g_atomic_pointer_set (volatile gpointer *atomic,
+gpointer g_atomic_pointer_get (volatile gpointer G_GNUC_MAY_ALIAS *atomic);
+void g_atomic_pointer_set (volatile gpointer G_GNUC_MAY_ALIAS *atomic,
gpointer newval);
#ifndef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
-# define g_atomic_int_get(atomic) (*(atomic))
+# define g_atomic_int_get(atomic) ((gint)*(atomic))
# define g_atomic_int_set(atomic, newval) ((void) (*(atomic) = (newval)))
-# define g_atomic_pointer_get(atomic) (*(atomic))
+# define g_atomic_pointer_get(atomic) ((gpointer)*(atomic))
# define g_atomic_pointer_set(atomic, newval) ((void) (*(atomic) = (newval)))
+#else
+# define g_atomic_int_get(atomic) \
+ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \
+ (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (void *) (atomic)))
+# define g_atomic_int_set(atomic, newval) \
+ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \
+ (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (void *) (atomic), (newval)))
+# define g_atomic_pointer_get(atomic) \
+ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \
+ (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void *) (atomic)))
+# define g_atomic_pointer_set(atomic, newval) \
+ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \
+ (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void *) (atomic), (newval)))
#endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
#define g_atomic_int_inc(atomic) (g_atomic_int_add ((atomic), 1))
diff -Naur glib-2.18.4-orig/glib/gdataset.c glib-2.18.4/glib/gdataset.c
--- glib-2.18.4-orig/glib/gdataset.c 2009-04-02 15:20:51.000000000 -0400
+++ glib-2.18.4/glib/gdataset.c 2009-04-02 15:40:38.000000000 -0400
@@ -44,7 +44,7 @@
/* datalist pointer accesses have to be carried out atomically */
#define G_DATALIST_GET_POINTER(datalist) \
- ((GData*) ((gsize) g_atomic_pointer_get ((gpointer*) datalist) & ~(gsize) G_DATALIST_FLAGS_MASK))
+ ((GData*) ((gsize) g_atomic_pointer_get (datalist) & ~(gsize) G_DATALIST_FLAGS_MASK))
#define G_DATALIST_SET_POINTER(datalist, pointer) G_STMT_START { \
gpointer _oldv, _newv; \
@@ -505,7 +505,7 @@
{
g_return_if_fail (datalist != NULL);
- g_atomic_pointer_set ((gpointer*) datalist, NULL);
+ g_atomic_pointer_set (datalist, NULL);
}
/**
diff -Naur glib-2.18.4-orig/glib/gdatasetprivate.h glib-2.18.4/glib/gdatasetprivate.h
--- glib-2.18.4-orig/glib/gdatasetprivate.h 2009-04-02 15:20:51.000000000 -0400
+++ glib-2.18.4/glib/gdatasetprivate.h 2009-04-02 15:40:44.000000000 -0400
@@ -36,7 +36,7 @@
* barriers to take effect without acquiring the global dataset mutex.
*/
#define G_DATALIST_GET_FLAGS(datalist) \
- ((gsize) g_atomic_pointer_get ((gpointer*) datalist) & G_DATALIST_FLAGS_MASK)
+ ((gsize) g_atomic_pointer_get (datalist) & G_DATALIST_FLAGS_MASK)
G_END_DECLS
diff -Naur glib-2.18.4-orig/glib/gthread.c glib-2.18.4/glib/gthread.c
--- glib-2.18.4-orig/glib/gthread.c 2009-04-02 15:20:51.000000000 -0400
+++ glib-2.18.4/glib/gthread.c 2009-04-02 15:40:51.000000000 -0400
@@ -204,7 +204,7 @@
{
gboolean need_init = FALSE;
g_mutex_lock (g_once_mutex);
- if (g_atomic_pointer_get ((void**) value_location) == NULL)
+ if (g_atomic_pointer_get (value_location) == NULL)
{
if (!g_slist_find (g_once_init_list, (void*) value_location))
{
@@ -224,11 +224,11 @@
g_once_init_leave (volatile gsize *value_location,
gsize initialization_value)
{
- g_return_if_fail (g_atomic_pointer_get ((void**) value_location) == NULL);
+ g_return_if_fail (g_atomic_pointer_get (value_location) == NULL);
g_return_if_fail (initialization_value != 0);
g_return_if_fail (g_once_init_list != NULL);
- g_atomic_pointer_set ((void**) value_location, (void*) initialization_value);
+ g_atomic_pointer_set (value_location, (void*) initialization_value);
g_mutex_lock (g_once_mutex);
g_once_init_list = g_slist_remove (g_once_init_list, (void*) value_location);
g_cond_broadcast (g_once_cond);
@@ -256,7 +256,7 @@
g_mutex_lock (g_once_mutex);
if (!(*mutex))
- g_atomic_pointer_set ((void**) mutex, g_mutex_new());
+ g_atomic_pointer_set (mutex, g_mutex_new());
g_mutex_unlock (g_once_mutex);
diff -Naur glib-2.18.4-orig/glib/gthread.h glib-2.18.4/glib/gthread.h
--- glib-2.18.4-orig/glib/gthread.h 2009-04-02 15:20:51.000000000 -0400
+++ glib-2.18.4/glib/gthread.h 2009-04-02 15:40:56.000000000 -0400
@@ -145,7 +145,7 @@
GMutex* g_static_mutex_get_mutex_impl (GMutex **mutex);
#define g_static_mutex_get_mutex_impl_shortcut(mutex) \
- (g_atomic_pointer_get ((gpointer*)(void*)mutex) ? *(mutex) : \
+ (g_atomic_pointer_get (mutex) ? *(mutex) : \
g_static_mutex_get_mutex_impl (mutex))
/* shorthands for conditional and unconditional function calls */
@@ -336,7 +336,7 @@
G_INLINE_FUNC gboolean
g_once_init_enter (volatile gsize *value_location)
{
- if G_LIKELY (g_atomic_pointer_get ((void*volatile*) value_location) != NULL)
+ if G_LIKELY ((gpointer) g_atomic_pointer_get (value_location) != NULL)
return FALSE;
else
return g_once_init_enter_impl (value_location);
|