S
Samie
Hi
I have declared a structure that contains pointer to a function. The
code goes like this:
typedef struct lcd_funs lcd_funs;
struct lcd_funs {
void (*decode_image)(cyg_uint32 imageWidth,
cyg_uint32 imageHeight,
Palette_element *paletteData,
cyg_uint8 *imageData,
cyg_uint16 bitsPerPixel
);
};
Now, suppose, I have a variable funs that is pointer to a structure of
this type. When I try to call this function using the code below, it
hangs up. Any idea why it is happening like this? The code used to
call it as follows:
(funs->decode_image)(ptrConfigOptions->imageWidth,
ptrConfigOptions->imageHeight,
ptrConfigOptions->paletteData,
ptrConfigOptions->imageData,
ptrConfigOptions->bitsPerPixel
);
Is it the right way to call functions using their pointers that are
members of a structure?
Regards
Samie
I have declared a structure that contains pointer to a function. The
code goes like this:
typedef struct lcd_funs lcd_funs;
struct lcd_funs {
void (*decode_image)(cyg_uint32 imageWidth,
cyg_uint32 imageHeight,
Palette_element *paletteData,
cyg_uint8 *imageData,
cyg_uint16 bitsPerPixel
);
};
Now, suppose, I have a variable funs that is pointer to a structure of
this type. When I try to call this function using the code below, it
hangs up. Any idea why it is happening like this? The code used to
call it as follows:
(funs->decode_image)(ptrConfigOptions->imageWidth,
ptrConfigOptions->imageHeight,
ptrConfigOptions->paletteData,
ptrConfigOptions->imageData,
ptrConfigOptions->bitsPerPixel
);
Is it the right way to call functions using their pointers that are
members of a structure?
Regards
Samie