_copy () parameters
This commit is contained in:
parent
c03fdd01a7
commit
14b295c886
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
8
Square.c
8
Square.c
|
@ -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)
|
||||
|
|
2
Square.h
2
Square.h
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue