Esempio n. 1
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	gc_begin_func();
	STRING(s1);
	STRING(s2);
	STRING(t);
	bool s1t;
	bool s2t;
	s1 = String_new("hellp");
	s2 = String_new("aello");
	t = String_new("hello");
	s1t = str_gt(s1,t);
	if (s1t) {
		gt_msg(s1,t);
	}
	else {
		le_msg(s1,t);
	}
	s2t = str_gt(s2,t);
	if (s2t) {
		gt_msg(s2,t);
	}
	else {
		le_msg(s2,t);
	}
	gc_end_func();

	gc();
	Heap_Info info = get_heap_info();
	if ( info.live!=0 ) fprintf(stderr, "%d objects remain after collection\n", info.live);
	gc_shutdown();
	return 0;
}
Esempio n. 2
0
int main(int ____c, char *____v[])
{
    setup_error_handlers();
    print_string(becomeSuper(String_new("man")));
    print_string(becomeSuper(String_new("duper")));
    return 0;
}
Esempio n. 3
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	int x;
	x = 1;
	return 0;
}
Esempio n. 4
0
int main(int ____c, char *____v[])
{
    setup_error_handlers();
    gc_begin_func();
    VECTOR(x);
    x = Vector_new((double[]) {
                   1, 2, 3}, 3);
Esempio n. 5
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
    ENTER();
	f();
    EXIT();
	return 0;
}
Esempio n. 6
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	int x;
	x = 5;
	printf("%d\n", bar(x));
	return 0;
}
Esempio n. 7
0
int
main(int ____c, char *____v[])
{
    setup_error_handlers();
    gc_begin_func();
    VECTOR(v);
    VECTOR(w);
    v = Vector_new((double[]) {
                   1.0, 2.0, 3.0}, 3);
Esempio n. 8
0
int
main(int ____c, char *____v[])
{
    setup_error_handlers();
    String *a;

    int b;

    a = String_new("hello");
    b = Vector_len(Vector_new((double[]) {
                              1, 2, 3}, 3));
Esempio n. 9
0
int
main(int ____c, char *____v[])
{
    setup_error_handlers();
    gc_begin_func();
    STRING(a);
    int b;

    a = String_new("hello");
    b = Vector_len(Vector_new((double[]) {
                              1, 2, 3}, 3));
Esempio n. 10
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	int x;
	x = 10;
	while ((x > 0)) {
	    printf("%1.2f\n", (x + 1.0));
	    x = (x - 1);
	}
	return 0;
}
Esempio n. 11
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
    ENTER();
	int x;
	double y;
	x = 1;
	y = (3.14 + x);
	printf("%1.2f\n", y);
    EXIT();
	return 0;
}
Esempio n. 12
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
    ENTER();
	bool x;
	bool y;
	x = bar(5);
	y = foo(1);
	printf("%d\n", (x || y));
    EXIT();
	return 0;
}
Esempio n. 13
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	int x;
	bool y;
	x = 5;
	y = foo(x);
	if (y) {
	    print_string(String_new("happy"));
	}
	else {
	    print_string(String_new("sad"));
	}
	return 0;
}
Esempio n. 14
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	gc_begin_func();
	int x;
	double y;
	x = 1;
	y = (3.14 + x);
	printf("%1.2f\n", y);
	gc_end_func();

	gc();
	Heap_Info info = get_heap_info();
	if ( info.live!=0 ) fprintf(stderr, "%d objects remain after collection\n", info.live);
	gc_shutdown();
	return 0;
}
Esempio n. 15
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	gc_begin_func();
	int argc;
	STRING(argv);
	argc = 1;
	argv = String_new("hello world");
	print_string(String_add(argv,String_from_int(argc)));
	gc_end_func();

	gc();
	Heap_Info info = get_heap_info();
	if ( info.live!=0 ) fprintf(stderr, "%d objects remain after collection\n", info.live);
	gc_shutdown();
	return 0;
}
Esempio n. 16
0
int
main(int ____c, char *____v[])
{
    setup_error_handlers();
    ENTER();
    STRING(s1);
    STRING(s2);
    STRING(s3);
    STRING(s4);
    STRING(s5);
    s1 = String_new("abc");
    REF((void *)s1);
    s2 = String_add(s1, String_new("xyz"));
    REF((void *)s2);
    s3 = String_add(s1, String_from_int(100));
    REF((void *)s3);
    s4 = String_add(s1, String_from_float(3.14));
    REF((void *)s4);
    s5 = String_add(s1, String_from_vector(Vector_new((double[]) {
                                                      1, 2, 3}, 3)));
Esempio n. 17
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
    ENTER();
	int x;
	bool y;
	x = 5;
	y = foo(x);
	if (y) {
		MARK();
	    print_string(String_new("happy"));
	    RELEASE();
	}
	else {
		MARK();
	    print_string(String_new("sad"));
	    RELEASE();
	}
    EXIT();
	return 0;
}
Esempio n. 18
0
int main(int ____c, char *____v[])
{
	setup_error_handlers();
    ENTER();
	STRING(s1);
	STRING(s2);
	STRING(t);
	bool s1t;
	bool s2t;
	s1 = String_new("hellp");
	REF((void *)s1);
	s2 = String_new("aello");
	REF((void *)s2);
	t = String_new("hello");
	REF((void *)t);
	s1t = str_gt(s1,t);
	if (s1t) {
		MARK();
	    gt_msg(s1,t);
	    RELEASE();
	}
	else {
		MARK();
	    le_msg(s1,t);
	    RELEASE();
	}
	s2t = str_gt(s2,t);
	if (s2t) {
		MARK();
	    gt_msg(s2,t);
	    RELEASE();
	}
	else {
		MARK();
	    le_msg(s2,t);
	    RELEASE();
	}
    EXIT();
	return 0;
}
Esempio n. 19
0
File: fib.c Progetto: hanjoes/wich-c
int main(int ____c, char *____v[])
{
	setup_error_handlers();
	printf("%d\n", fib(5));
	return 0;
}