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
|
/* nullability_var_type.c generated by valac, the Vala compiler
* generated from nullability_var_type.vala, do not modify */
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#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);
static void _vala_main (void);
static void _vala_array_destroy (gpointer array,
gssize array_length,
GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
gssize array_length,
GDestroyNotify destroy_func);
static void
_vala_main (void)
{
{
const gchar* foo = NULL;
const gchar* _tmp0_;
foo = "foo";
_tmp0_ = foo;
_vala_assert (_tmp0_ != NULL, "foo != null");
}
{
gchar* _tmp1_;
gchar* _tmp2_;
gchar** _tmp3_;
_tmp1_ = g_strdup ("foo");
_tmp2_ = g_strdup ("bar");
_tmp3_ = g_new0 (gchar*, 2 + 1);
_tmp3_[0] = _tmp1_;
_tmp3_[1] = _tmp2_;
{
gchar** foo_collection = NULL;
gint foo_collection_length1 = 0;
gint _foo_collection_size_ = 0;
gint foo_it = 0;
foo_collection = _tmp3_;
foo_collection_length1 = 2;
for (foo_it = 0; foo_it < foo_collection_length1; foo_it = foo_it + 1) {
const gchar* foo = NULL;
foo = foo_collection[foo_it];
{
const gchar* _tmp4_;
_tmp4_ = foo;
_vala_assert (_tmp4_ != NULL, "foo != null");
}
}
foo_collection = (_vala_array_free (foo_collection, foo_collection_length1, (GDestroyNotify) g_free), NULL);
}
}
{
{
const gchar* foo = NULL;
foo = "foo";
_vala_assert (foo != NULL, "foo != null");
}
}
}
int
main (int argc,
char ** argv)
{
_vala_main ();
return 0;
}
static void
_vala_array_destroy (gpointer array,
gssize array_length,
GDestroyNotify destroy_func)
{
if ((array != NULL) && (destroy_func != NULL)) {
gssize i;
for (i = 0; i < array_length; i = i + 1) {
if (((gpointer*) array)[i] != NULL) {
destroy_func (((gpointer*) array)[i]);
}
}
}
}
static void
_vala_array_free (gpointer array,
gssize array_length,
GDestroyNotify destroy_func)
{
_vala_array_destroy (array, array_length, destroy_func);
g_free (array);
}
|