Hello
I have a C header file from someone else, and i need to complile with the Lib. I am using VC++ 6 and give me alot of error. Same header file, if use in C program, only warning not error.

The error is
error C2440: 'initializing' : cannot convert from 'const int' to 'MASK_TYPE'


Here i attach the header file, which is come with a lib file.



#if !defined( MASKS_DEFINED )

#define MASKS_DEFINED

typedef enum {GAUSSIAN, LOW1, LOW2, NEIGHBORHOOD, LAP1, LAP2, LAPB1, LAPB2,
SOB_V, SOB_H, W1, W2, W3, W4, W5, W6, W7, W8, W9} MASK_TYPE;

typedef struct {
short int n;
short int **vertical;
short int **horizontal;
short int **diag1;
short int **diag2;
} KIRSCH_MASK;

#define MASKS1 0, 1.0,2.0,1.0, 2.0,4.0,2.0, 1.0,2.0,1.0, \
1, 0.1,0.1,0.1, 0.1,0.2,0.1, 0.1,0.1,0.1, \
2, 1.0/16,1.0/8.0,1.0/16.0, 1.0/8.0,1.0/4.0,1.0/8.0, 1.0/16,1.0/8,1.0/16, \
3, 1.0/9.0,1.0/9.0,1.0/9.0, 1.0/9.0,1.0/9.0,1.0/9.0, 1.0/9.0,1.0/9.0,1.0/9.0, \
4, 0.0,-1.0,0.0, -1.0,4.0,-1.0, 0.0,-1.0,0.0, \
5, 1.0,-2.0,1.0, -2.0,4.0,-2.0, 1.0,-2.0,1.0, \
6, -1.0,-1.0,-1.0, -1.0,9.0,-1.0, -1.0,-1.0,-1.0, \
7, 1.0,-2.0,1.0, -2.0,5.0,-2.0, 1.0,-2.0,1.0, \
8, 1.0,0.0,-1.0, 2.0,0.0,-2.0, 1.0,0.0,-1.0, \
9, 1.0,2.0,1.0, 0.0,0.0,0.0, -1.0,-2.0,-1.0, \
10, 1.0,1.4142136,1.0, 0.0,0.0,0.0, -1.0,-1.4142136,-1.0, \
11, 1.0,0.0,-1.0, 1.4142136,0.0,-1.4142136, 1.0,0.0,-1.0, \
12, 0.0,-1.0,1.4142136, 1.0,0.0,-1.0, -1.4142136,1.0,0.0, \
13, 1.4142136,-1.0,0.0, -1.0,0.0,1.0, 0.0,1.0,-1.4142136, \
14, 0.0,1.0,0.0, -1.0,0.0,-1.0, 0.0,1.0,0.0, \
15, -1.0,0.0,1.0, 0.0,0.0,0.0, 1.0,0.0,-1.0, \
16, 1.0,-2.0,1.0, -2.0,4.0,-2.0, 1.0,-2.0,1.0, \
17, -2.0,1.0,-2.0, 1.0,4.0,1.0, -2.0,1.0,-2.0, \
18, 1.0,1.0,1.0, 1.0,1.0,1.0, 1.0,1.0,1.0

#define MASKS2 0, 1.0/25,1.0/25,1.0/25,1.0/25,1.0/25, \
1.0/25,1.0/25,1.0/25,1.0/25,1.0/25, \
1.0/25,1.0/25,1.0/25,1.0/25,1.0/25, \
1.0/25,1.0/25,1.0/25,1.0/25,1.0/25, \
1.0/25,1.0/25,1.0/25,1.0/25,1.0/25

static struct mask3x3 {
MASK_TYPE choice;
float kernel[9];
} MASK3x3[] = {MASKS1}; //1st ERROR is HERE

static struct mask5x5 {
MASK_TYPE choice;
float kernel[25];
} MASK5x5[] = {MASKS2};

extern Image * h_image(int type, unsigned int height, unsigned int width);

#endif /* MASKS_DEFINED */







Sooner Or Later, Everyone Does...