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
|
/* methods_local_functions.c generated by valac, the Vala compiler
* generated from methods_local_functions.vala, do not modify */
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
typedef gint (*_LocalFunc0_) (gpointer user_data);
typedef gboolean (*_LocalFunc1_) (gint a, gint b, gpointer user_data);
typedef void (*_LocalFunc2_) (gchar** s, gpointer user_data);
typedef const gchar* (*_LocalFunc3_) (gchar** s, gpointer user_data);
typedef struct _Block1Data Block1Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
struct _Block1Data {
int _ref_count_;
gint x;
gint y;
};
static void _vala_main (void);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gint ___lambda4_ (Block1Data* _data1_);
static gint ____lambda4___localfunc0_ (gpointer self);
static gboolean ___lambda5_ (gint a,
gint b);
static gboolean ____lambda5___localfunc1_ (gint a,
gint b,
gpointer self);
static void ___lambda6_ (gchar** s);
static void ____lambda6___localfunc2_ (gchar** s,
gpointer self);
static const gchar* ___lambda7_ (gchar** s);
static const gchar* ____lambda7___localfunc3_ (gchar** s,
gpointer self);
static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
g_atomic_int_inc (&_data1_->_ref_count_);
return _data1_;
}
static void
block1_data_unref (void * _userdata_)
{
Block1Data* _data1_;
_data1_ = (Block1Data*) _userdata_;
if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
g_slice_free (Block1Data, _data1_);
}
}
static gint
___lambda4_ (Block1Data* _data1_)
{
gint result;
result = _data1_->x + _data1_->y;
return result;
}
static gint
____lambda4___localfunc0_ (gpointer self)
{
gint result;
result = ___lambda4_ (self);
return result;
}
static gboolean
___lambda5_ (gint a,
gint b)
{
gboolean result;
_vala_assert ((a * b) == 966, "a * b == 966");
result = TRUE;
return result;
}
static gboolean
____lambda5___localfunc1_ (gint a,
gint b,
gpointer self)
{
gboolean result;
result = ___lambda5_ (a, b);
return result;
}
static void
___lambda6_ (gchar** s)
{
gchar* _vala_s = NULL;
gchar* _tmp0_;
_tmp0_ = g_strdup ("foo");
_g_free0 (_vala_s);
_vala_s = _tmp0_;
if (s) {
*s = _vala_s;
} else {
_g_free0 (_vala_s);
}
}
static void
____lambda6___localfunc2_ (gchar** s,
gpointer self)
{
___lambda6_ (s);
}
static const gchar*
___lambda7_ (gchar** s)
{
gchar* _tmp0_;
const gchar* result;
g_return_val_if_fail (*s != NULL, NULL);
_vala_assert (g_strcmp0 (*s, "foo") == 0, "s == \"foo\"");
_tmp0_ = g_strdup ("bar");
_g_free0 (*s);
*s = _tmp0_;
result = *s;
return result;
}
static const gchar*
____lambda7___localfunc3_ (gchar** s,
gpointer self)
{
const gchar* result;
result = ___lambda7_ (s);
return result;
}
static void
_vala_main (void)
{
{
Block1Data* _data1_;
_LocalFunc0_ foo = NULL;
gpointer foo_target;
_data1_ = g_slice_new0 (Block1Data);
_data1_->_ref_count_ = 1;
_data1_->x = 23;
_data1_->y = 42;
foo = ____lambda4___localfunc0_;
foo_target = _data1_;
_vala_assert (foo (foo_target) == 65, "foo () == 65");
block1_data_unref (_data1_);
_data1_ = NULL;
}
{
_LocalFunc1_ foo = NULL;
gpointer foo_target;
foo = ____lambda5___localfunc1_;
foo_target = NULL;
_vala_assert (foo (23, 42, foo_target), "foo (23, 42)");
}
{
_LocalFunc2_ foo = NULL;
gpointer foo_target;
gchar* s = NULL;
gchar* _tmp0_ = NULL;
foo = ____lambda6___localfunc2_;
foo_target = NULL;
foo (&_tmp0_, foo_target);
_g_free0 (s);
s = _tmp0_;
_vala_assert (g_strcmp0 (s, "foo") == 0, "s == \"foo\"");
_g_free0 (s);
}
{
_LocalFunc3_ foo = NULL;
gpointer foo_target;
gchar* s = NULL;
gchar* _tmp1_;
const gchar* _tmp2_;
const gchar* _tmp3_;
foo = ____lambda7___localfunc3_;
foo_target = NULL;
_tmp1_ = g_strdup ("foo");
s = _tmp1_;
_tmp2_ = foo (&s, foo_target);
_vala_assert (g_strcmp0 (_tmp2_, "bar") == 0, "foo (ref s) == \"bar\"");
_tmp3_ = s;
_vala_assert (g_strcmp0 (_tmp3_, "bar") == 0, "s == \"bar\"");
_g_free0 (s);
}
}
int
main (int argc,
char ** argv)
{
_vala_main ();
return 0;
}
|