attempt to fix 64 bits compiler error

This commit is contained in:
charras 2009-07-19 11:05:04 +00:00
parent 997270d834
commit 527e7922ed
1 changed files with 12 additions and 3 deletions

View File

@ -143,7 +143,10 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetsNames( wxListBox* aListBox, int aNe
aListBox->Append( m_StockNets[ii]->GetNetname() ); aListBox->Append( m_StockNets[ii]->GetNetname() );
// Store the index of this net // Store the index of this net
aListBox->SetClientData( idx, (void*) ii ); // This is a trick to get an unsigned integer index from a pointer value.
// Some compilers cannot accept to convert an unsigned to a pointer without complains
char * ptr = (char*)0 + ii;
aListBox->SetClientData( idx, ptr );
idx++; idx++;
} }
} }
@ -474,7 +477,10 @@ void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event )
if( !m_listBoxRightNetSelect->IsSelected( ii ) ) if( !m_listBoxRightNetSelect->IsSelected( ii ) )
continue; continue;
unsigned idx = (unsigned) m_listBoxRightNetSelect->GetClientData( ii ); // This is a trick to get an unsigned integer index from a pointer value.
// Some compilers cannot accept to convert a pointer to an unsigned without complains
char * ptr = (char*) m_listBoxRightNetSelect->GetClientData( ii );
unsigned idx = ptr - (char*)0;
m_NetsLinkToClasses[idx] = idx_class; m_NetsLinkToClasses[idx] = idx_class;
} }
@ -497,7 +503,10 @@ void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event )
if( !m_listBoxLeftNetSelect->IsSelected( ii ) ) if( !m_listBoxLeftNetSelect->IsSelected( ii ) )
continue; continue;
unsigned idx = (unsigned) m_listBoxLeftNetSelect->GetClientData( ii ); // This is a trick to get an unsigned integer index from a pointer value.
// Some compilers cannot accept to convert a pointer to an unsigned without complains
char * ptr = (char*) m_listBoxLeftNetSelect->GetClientData( ii );
unsigned idx = ptr - (char*)0 ;
m_NetsLinkToClasses[idx] = idx_class; m_NetsLinkToClasses[idx] = idx_class;
} }