/* basic_types_bug788775.c generated by valac, the Vala compiler * generated from basic_types_bug788775.vala, do not modify */ #include #include #include #if !defined(VALA_EXTERN) #if defined(_WIN32) || defined(__CYGWIN__) #define VALA_EXTERN __declspec(dllexport) extern #elif __GNUC__ >= 4 #define VALA_EXTERN __attribute__((visibility("default"))) extern #else #define VALA_EXTERN extern #endif #endif #define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL))) VALA_EXTERN void test_compile_only (void); 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); void test_compile_only (void) { GError* _inner_error0_ = NULL; { GKeyFile* file = NULL; GKeyFile* _tmp0_; gchar** list = NULL; gsize _tmp1_ = 0; gchar** _tmp2_; gint list_length1; gint _list_size_; _tmp0_ = g_key_file_new (); file = _tmp0_; _tmp2_ = g_key_file_get_string_list (file, "foo", "bar", &_tmp1_, &_inner_error0_); list = _tmp2_; list_length1 = _tmp1_; _list_size_ = list_length1; if (G_UNLIKELY (_inner_error0_ != NULL)) { _g_key_file_unref0 (file); if (_inner_error0_->domain == G_KEY_FILE_ERROR) { goto __catch0_g_key_file_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); g_clear_error (&_inner_error0_); return; } list = (_vala_array_free (list, list_length1, (GDestroyNotify) g_free), NULL); _g_key_file_unref0 (file); } goto __finally0; __catch0_g_key_file_error: { g_clear_error (&_inner_error0_); } __finally0: if (G_UNLIKELY (_inner_error0_ != NULL)) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); g_clear_error (&_inner_error0_); return; } } static void _vala_main (void) { } 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); }