Mercurial > hg > xemacs-beta
comparison src/ui-gtk.c @ 1726:a8d8f419b459
[xemacs-hg @ 2003-09-30 15:26:34 by james]
Add type information to xfree to avoid alias creation.
author | james |
---|---|
date | Tue, 30 Sep 2003 15:27:01 +0000 |
parents | 01c57eb70ae9 |
children | 3fe1a35b705d |
comparison
equal
deleted
inserted
replaced
1725:7ff8f4d70aec | 1726:a8d8f419b459 |
---|---|
345 #define CONVERT_SINGLE_TYPE(var,nam,tp) case GTK_TYPE_##nam: GTK_VALUE_##nam (var) = * (tp *) v; break; | 345 #define CONVERT_SINGLE_TYPE(var,nam,tp) case GTK_TYPE_##nam: GTK_VALUE_##nam (var) = * (tp *) v; break; |
346 #define CONVERT_RETVAL(a,freep) \ | 346 #define CONVERT_RETVAL(a,freep) \ |
347 do { \ | 347 do { \ |
348 void *v = GTK_VALUE_POINTER(a); \ | 348 void *v = GTK_VALUE_POINTER(a); \ |
349 switch (GTK_FUNDAMENTAL_TYPE (a.type)) \ | 349 switch (GTK_FUNDAMENTAL_TYPE (a.type)) \ |
350 { \ | 350 { \ |
351 CONVERT_SINGLE_TYPE(a,CHAR,gchar); \ | 351 CONVERT_SINGLE_TYPE(a,CHAR,gchar); \ |
352 CONVERT_SINGLE_TYPE(a,UCHAR,guchar); \ | 352 CONVERT_SINGLE_TYPE(a,UCHAR,guchar); \ |
353 CONVERT_SINGLE_TYPE(a,BOOL,gboolean); \ | 353 CONVERT_SINGLE_TYPE(a,BOOL,gboolean); \ |
354 CONVERT_SINGLE_TYPE(a,INT,gint); \ | 354 CONVERT_SINGLE_TYPE(a,INT,gint); \ |
355 CONVERT_SINGLE_TYPE(a,UINT,guint); \ | 355 CONVERT_SINGLE_TYPE(a,UINT,guint); \ |
361 CONVERT_SINGLE_TYPE(a,ENUM,gint); \ | 361 CONVERT_SINGLE_TYPE(a,ENUM,gint); \ |
362 CONVERT_SINGLE_TYPE(a,FLAGS,guint); \ | 362 CONVERT_SINGLE_TYPE(a,FLAGS,guint); \ |
363 CONVERT_SINGLE_TYPE(a,BOXED,void *); \ | 363 CONVERT_SINGLE_TYPE(a,BOXED,void *); \ |
364 CONVERT_SINGLE_TYPE(a,POINTER,void *); \ | 364 CONVERT_SINGLE_TYPE(a,POINTER,void *); \ |
365 CONVERT_SINGLE_TYPE(a,OBJECT,GtkObject *); \ | 365 CONVERT_SINGLE_TYPE(a,OBJECT,GtkObject *); \ |
366 default: \ | 366 default: \ |
367 GTK_VALUE_POINTER (a) = * (void **) v; \ | 367 GTK_VALUE_POINTER (a) = * (void **) v; \ |
368 break; \ | 368 break; \ |
369 } \ | 369 } \ |
370 if (freep) xfree(v); \ | 370 if (freep) xfree(v, void *); \ |
371 } while (0) | 371 } while (0) |
372 | 372 |
373 static gpointer __allocate_object_storage (GtkType t) | 373 static gpointer __allocate_object_storage (GtkType t) |
374 { | 374 { |
375 size_t s = 0; | 375 size_t s = 0; |