_copy () parameters

This commit is contained in:
Kolan Sh 2012-05-01 19:56:48 +04:00
parent c03fdd01a7
commit 14b295c886
4 changed files with 11 additions and 11 deletions

View File

@ -15,13 +15,13 @@ void ColoredSquare_constructor (ColoredSquare *this,
this->color = color;
}
void ColoredSquare_copy (ColoredSquare *to, const ColoredSquare *from)
void ColoredSquare_copy (ColoredSquare *dest, const ColoredSquare *src)
{
printf ("ColoredSquare_copy (%lu, %lu) called\n",
(unsigned long) to,
(unsigned long) from);
Square_copy ((Square *) to, (Square *) from);
to->color = from->color;
(unsigned long) dest,
(unsigned long) src);
Square_copy ((Square *) dest, (Square *) src);
dest->color = src->color;
}
ColoredSquare* ColoredSquare_clone (const ColoredSquare *this)

View File

@ -24,7 +24,7 @@ typedef struct ColoredSquare_interface
void ColoredSquare_constructor (struct ColoredSquare *this,
double a,
int color);
void ColoredSquare_copy (struct ColoredSquare *to, const struct ColoredSquare *from);
void ColoredSquare_copy (struct ColoredSquare *dest, const struct ColoredSquare *src);
struct ColoredSquare* ColoredSquare_clone (const struct ColoredSquare *this);
const char* ColoredSquare_type (const struct ColoredSquare *this);
void ColoredSquare_draw (const struct ColoredSquare *this);

View File

@ -17,12 +17,12 @@ void Square_destructor (Square *this)
(unsigned long) this);
}
void Square_copy (Square *to, const Square *from)
void Square_copy (Square *dest, const Square *src)
{
printf ("Square_copy (%lu, %lu) called\n",
(unsigned long) to,
(unsigned long) from);
to->a = from->a;
(unsigned long) dest,
(unsigned long) src);
dest->a = src->a;
}
Square* Square_clone (const Square *this)

View File

@ -22,7 +22,7 @@ typedef struct Square_interface
void Square_constructor (struct Square *this, double a);
void Square_destructor (struct Square *this);
void Square_copy (struct Square *to, const struct Square *from);
void Square_copy (struct Square *dest, const struct Square *src);
struct Square* Square_clone (const struct Square *this);
void Square_destroy (struct Square *this);
const char* Square_type (const struct Square *this);