Avoid all other warnings

This commit is contained in:
Kolan Sh 2012-05-01 01:26:14 +04:00
parent 34484b9910
commit b8a9f34639
3 changed files with 23 additions and 13 deletions

View File

@ -71,13 +71,19 @@ ColoredSquare* ColoredSquare_new (double a, int color)
{ {
static ColoredSquare_interface vtable = static ColoredSquare_interface vtable =
{ {
(void* (*) (void *)) ColoredSquare_clone, {
(void (*) (void *)) Square_destroy, {
(const char* (*) (Figure *)) ColoredSquare_type, {
(void (*) (Figure *)) ColoredSquare_draw, (void* (*) (void *)) ColoredSquare_clone,
(double (*) (Figure *)) Square_area, (void (*) (void *)) Square_destroy
Square_resize, },
Square_diag_length, (const char* (*) (Figure *)) ColoredSquare_type,
(void (*) (Figure *)) ColoredSquare_draw,
(double (*) (Figure *)) Square_area
},
Square_resize,
Square_diag_length
},
ColoredSquare_set_color ColoredSquare_set_color
}; };
ColoredSquare *square = malloc (sizeof (*square)); ColoredSquare *square = malloc (sizeof (*square));

View File

@ -102,11 +102,15 @@ Square* Square_new (double a)
{ {
static Square_interface vtable = static Square_interface vtable =
{ {
(void* (*) (void *)) Square_clone, {
(void (*) (void *)) Square_destroy, {
(const char* (*) (Figure *)) Square_type, (void* (*) (void *)) Square_clone,
(void (*) (Figure *)) Square_draw, (void (*) (void *)) Square_destroy
(double (*) (Figure *)) Square_area, },
(const char* (*) (Figure *)) Square_type,
(void (*) (Figure *)) Square_draw,
(double (*) (Figure *)) Square_area
},
Square_resize, Square_resize,
Square_diag_length Square_diag_length
}; };

2
main.c
View File

@ -3,7 +3,7 @@
#include "ColoredSquare.h" #include "ColoredSquare.h"
int main (int argc, char *argv[]) int main (void)
{ {
unsigned long i = 0; unsigned long i = 0;
Figure *fig[3]; Figure *fig[3];