Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* main.c generated by valac 0.12.0, the Vala compiler
- * generated from main.vala, do not modify */
- #include <glib.h>
- #include <glib-object.h>
- #include <stdlib.h>
- #include <string.h>
- #include <gee.h>
- #define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
- #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
- gint compare (gint* a, gint* b);
- gint _vala_main (gchar** args, int args_length1);
- static gint* _int_dup (gint* self);
- static gint _compare_gcompare_func (gconstpointer a, gconstpointer b);
- gint compare (gint* a, gint* b) {
- gint result = 0;
- result = *(a - b);
- return result;
- }
- static gint* _int_dup (gint* self) {
- gint* dup;
- dup = g_new0 (gint, 1);
- memcpy (dup, self, sizeof (gint));
- return dup;
- }
- static gint _compare_gcompare_func (gconstpointer a, gconstpointer b) {
- gint result;
- result = compare (a, b);
- return result;
- }
- static gpointer _g_object_ref0 (gpointer self) {
- return self ? g_object_ref (self) : NULL;
- }
- gint _vala_main (gchar** args, int args_length1) {
- gint result = 0;
- GeeArrayList* _tmp0_ = NULL;
- GeeArrayList* arr;
- gint _tmp1_;
- gint _tmp2_;
- gint _tmp3_;
- _tmp0_ = gee_array_list_new (G_TYPE_INT, (GBoxedCopyFunc) _int_dup, g_free, NULL);
- arr = _tmp0_;
- _tmp1_ = 100;
- gee_abstract_collection_add ((GeeAbstractCollection*) arr, &_tmp1_);
- _tmp2_ = 1;
- gee_abstract_collection_add ((GeeAbstractCollection*) arr, &_tmp2_);
- _tmp3_ = 10;
- gee_abstract_collection_add ((GeeAbstractCollection*) arr, &_tmp3_);
- gee_list_sort ((GeeList*) arr, _compare_gcompare_func);
- {
- GeeArrayList* _tmp4_;
- GeeArrayList* _i_list;
- gint _tmp5_;
- gint _i_size;
- gint _i_index;
- _tmp4_ = _g_object_ref0 (arr);
- _i_list = _tmp4_;
- _tmp5_ = gee_collection_get_size ((GeeCollection*) _i_list);
- _i_size = _tmp5_;
- _i_index = -1;
- while (TRUE) {
- gpointer _tmp6_ = NULL;
- gint* _tmp7_;
- gint _tmp8_;
- gint i;
- _i_index = _i_index + 1;
- if (!(_i_index < _i_size)) {
- break;
- }
- _tmp6_ = gee_abstract_list_get ((GeeAbstractList*) _i_list, _i_index);
- _tmp7_ = (gint*) _tmp6_;
- _tmp8_ = *_tmp7_;
- _g_free0 (_tmp7_);
- i = _tmp8_;
- g_debug ("main.vala:17: %d", i);
- }
- _g_object_unref0 (_i_list);
- }
- result = 0;
- _g_object_unref0 (arr);
- return result;
- }
- int main (int argc, char ** argv) {
- g_type_init ();
- return _vala_main (argv, argc);
- }
- ____
- $ valac main.vala --pkg gee-1.0 --save-temps
- /home/markus/_valatest/_valatest/main.c: In function ‘compare’:
- /home/markus/_valatest/_valatest/main.c:24:11: error: invalid type argument of unary ‘*’ (have ‘long int’)
- /home/markus/_valatest/_valatest/main.c: In function ‘_compare_gcompare_func’:
- /home/markus/_valatest/_valatest/main.c:39:2: warning: passing argument 1 of ‘compare’ discards qualifiers from pointer target type
- /home/markus/_valatest/_valatest/main.c:22:6: note: expected ‘gint *’ but argument is of type ‘gconstpointer’
- /home/markus/_valatest/_valatest/main.c:39:2: warning: passing argument 2 of ‘compare’ discards qualifiers from pointer target type
- /home/markus/_valatest/_valatest/main.c:22:6: note: expected ‘gint *’ but argument is of type ‘gconstpointer’
- error: cc exited with status 256
- Compilation failed: 1 error(s), 0 warning(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement