B
Ben Midgley
Please have a look at the code below
My problem is the error message "Nonportable pointer conversion", so far as
I can tell there is no pointer conversion occuring here so I am assuming it
is something implicit. The error is associated with the assignment {
&MenuItemList }, when delcaring the mit_ZoneSelectMenu structure.
I am using borland bcc32 the command line compiler which seems pretty good,
I just dont understand this issue.
#include <stdio>
#define _LEN_A_ 16 // this is minimum
typedef struct {
u8 ItemName[(_LEN_A_ - 1)];
boolean (*ItemHandler)( u8 Token );
} MenuItemT;
typedef struct {
u8 string_a[_LEN_A_];
MenuItemT * pItemList;
u8 ItemCount;
} MenuT;
static boolean fn_a( u8 token );
static boolean fn_b( u8 token );
static volatile MenuItemT MenuItemList[] = {
/* "Item Name ", Item Handler Function */
{ "Item A" , &fn_a }, // Zone A
{ "Item B" , &fn_b }, // Zone B
{ NULL , NULL }
};
static volatile MenuT mit_ZoneSelectMenu[] = {
{ "Menu Title " },
{ &MenuItemList },
{ 2 },
};
void main( void )
{
printf("hello world");
}
static boolean fn_a( u8 token )
{
printf("fn_a called The token is %c",token);
return true;
}
static boolean fn_b( u8 token )
{
printf("fn_b called The token is %c",token);
return true;
}
My problem is the error message "Nonportable pointer conversion", so far as
I can tell there is no pointer conversion occuring here so I am assuming it
is something implicit. The error is associated with the assignment {
&MenuItemList }, when delcaring the mit_ZoneSelectMenu structure.
I am using borland bcc32 the command line compiler which seems pretty good,
I just dont understand this issue.
#include <stdio>
#define _LEN_A_ 16 // this is minimum
typedef struct {
u8 ItemName[(_LEN_A_ - 1)];
boolean (*ItemHandler)( u8 Token );
} MenuItemT;
typedef struct {
u8 string_a[_LEN_A_];
MenuItemT * pItemList;
u8 ItemCount;
} MenuT;
static boolean fn_a( u8 token );
static boolean fn_b( u8 token );
static volatile MenuItemT MenuItemList[] = {
/* "Item Name ", Item Handler Function */
{ "Item A" , &fn_a }, // Zone A
{ "Item B" , &fn_b }, // Zone B
{ NULL , NULL }
};
static volatile MenuT mit_ZoneSelectMenu[] = {
{ "Menu Title " },
{ &MenuItemList },
{ 2 },
};
void main( void )
{
printf("hello world");
}
static boolean fn_a( u8 token )
{
printf("fn_a called The token is %c",token);
return true;
}
static boolean fn_b( u8 token )
{
printf("fn_b called The token is %c",token);
return true;
}