diff --git a/Examples/scilab/enum/example.h b/Examples/scilab/enum/example.h index 6a0780860..525d62afc 100644 --- a/Examples/scilab/enum/example.h +++ b/Examples/scilab/enum/example.h @@ -1,6 +1,6 @@ /* File : example.h */ -typedef enum { RED, BLUE, GREEN } color; +enum color { RED, BLUE, GREEN }; class Foo { public: diff --git a/Examples/scilab/std_vector/example.h b/Examples/scilab/std_vector/example.h index a5ea86d2a..4f0dac70d 100644 --- a/Examples/scilab/std_vector/example.h +++ b/Examples/scilab/std_vector/example.h @@ -9,7 +9,7 @@ double average(std::vector v) { return std::accumulate(v.begin(),v.end(),0.0)/v.size(); } -std::vector half(const std::vector v) { +std::vector half(const std::vector& v) { std::vector w(v); for (unsigned int i=0; i; diff --git a/Examples/scilab/variables/example.c b/Examples/scilab/variables/example.c index 231899e43..9f88d90a4 100644 --- a/Examples/scilab/variables/example.c +++ b/Examples/scilab/variables/example.c @@ -25,7 +25,7 @@ double dvar = 0; char *strvar = 0; const char cstrvar[] = "Goodbye"; int *iptrvar = 0; -char name[5] = "Dave"; +char name[256] = "Dave"; char path[256] = "/home/beazley"; @@ -51,10 +51,10 @@ void print_vars() { printf("dvar = %g\n", dvar); printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); - printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)"); - printf("iptrvar = %i\n", value_int(iptrvar)); - printf("name = %c%c%c%c%c\n", name[0],name[1],name[2],name[3],name[4]); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr->x, ptptr->y); + printf("cstrvar = %s\n", cstrvar); + printf("iptrvar = %p\n", (void *)iptrvar); + printf("name = %s\n", name); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); }