/* delegate-incompatible-pointer-warning.c generated by valac 0.10.2, the Vala compiler
 * generated from delegate-incompatible-pointer-warning.vala, do not modify */

/*
The following peice of code generates a warning, but the code still works.
*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

typedef struct _Block1Data Block1Data;

typedef void (*MyDel) (gint a, const char* b, void* user_data);
struct _Block1Data {
	int _ref_count_;
	gint c;
};



gint _vala_main (char** args, int args_length1);
static void _lambda0_ (gint a, const char* b, Block1Data* _data1_);
static void __lambda0__my_del (gint a, const char* b, gpointer self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);



static void _lambda0_ (gint a, const char* b, Block1Data* _data1_) {
	g_return_if_fail (b != NULL);
	fprintf (stdout, "a:%d  b:%s  c:%d\n", a, b, _data1_->c);
	_data1_->c = 40;
}


static void __lambda0__my_del (gint a, const char* b, gpointer self) {
	_lambda0_ (a, b, self);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		g_slice_free (Block1Data, _data1_);
	}
}


gint _vala_main (char** args, int args_length1) {
	gint result = 0;
	Block1Data* _data1_;
	void* myDel_target = NULL;
	GDestroyNotify myDel_target_destroy_notify = NULL;
	MyDel _tmp0_;
	MyDel myDel;
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->c = 10;
	myDel = (_tmp0_ = __lambda0__my_del, myDel_target = block1_data_ref (_data1_), myDel_target_destroy_notify = block1_data_unref, _tmp0_);
	myDel (5, "test", myDel_target);
	fprintf (stdout, "c:%d\n", _data1_->c);
	result = 0;
	(myDel_target_destroy_notify == NULL) ? NULL : (myDel_target_destroy_notify (myDel_target), NULL);
	myDel = NULL;
	myDel_target = NULL;
	myDel_target_destroy_notify = NULL;
	block1_data_unref (_data1_);
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return _vala_main (argv, argc);
}




