Commit 654045f2 authored by charras's avatar charras

code cleaning

parent 1b1be195
......@@ -963,7 +963,6 @@ void Build_PlacedPads_List( BOARD* aPcb )
aPcb->m_Status_Pcb |= LISTE_PAD_OK;
aPcb->m_Status_Pcb &= ~(LISTE_CHEVELU_OK | CHEVELU_LOCAL_OK);
adr_lowmem = buf_work;
}
......@@ -1124,7 +1123,6 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC )
if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) )
continue;
pcbframe->GetBoard()->m_Status_Pcb &= ~CHEVELU_LOCAL_OK;
adr_lowmem = buf_work;
(*pt_Dmod)->DisplayInfo( pcbframe );
pcbframe->build_ratsnest_module( DC, *pt_Dmod );
......
......@@ -17,7 +17,7 @@
#include "id.h"
bool CreateHeaderInfoData( FILE* file, WinEDA_PcbFrame* frame );
static int* CreateTracksInfoData( FILE* file, BOARD* pcb );
static void CreateTracksInfoData( FILE* file, BOARD* pcb );
static void CreateBoardSection( FILE* file, BOARD* pcb );
static void CreateComponentsSection( FILE* file, BOARD* pcb );
static void CreateDevicesSection( FILE* file, BOARD* pcb );
......@@ -71,7 +71,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
wildcard = _( "GenCAD board files (.gcd)|*.gcd" );
fn.SetExt( ext );
wxFileDialog dlg( this, _( "Save GenCAD Board File" ), wxEmptyString,
wxFileDialog dlg( this, _( "Save GenCAD Board File" ), wxGetCwd(),
fn.GetFullName(), wildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
......@@ -691,7 +691,7 @@ void CreateBoardSection( FILE* file, BOARD* pcb )
/****************************************************/
int* CreateTracksInfoData( FILE* file, BOARD* pcb )
void CreateTracksInfoData( FILE* file, BOARD* pcb )
/****************************************************/
/* Creation de la section "$TRACKS"
......@@ -701,72 +701,60 @@ int* CreateTracksInfoData( FILE* file, BOARD* pcb )
* TRACK <name> <width>
* $ENDTRACK
*
* on attribut ici comme nom l'epaisseur des traits precede de "TRACK": ex
* on attribue ici comme nom l'epaisseur des traits precede de "TRACK": ex
* pour une largeur de 120 : nom = "TRACK120".
*/
{
TRACK* track;
int* trackinfo, * ptinfo;
int last_width = -1;
/* recherche des epaisseurs utilisees pour les traces: */
trackinfo = (int*) adr_lowmem;
*trackinfo = -1;
std::vector <int> trackinfo;
unsigned ii;
for( track = pcb->m_Track; track != NULL; track = track->Next() )
{
if( *trackinfo != track->m_Width ) // recherche d'une epaisseur deja utilisee
if( last_width != track->m_Width ) // recherche d'une epaisseur deja utilisee
{
ptinfo = (int*) adr_lowmem;
while( *ptinfo >= 0 )
for ( ii = 0; ii < trackinfo.size(); ii++ )
{
if( *ptinfo != track->m_Width )
ptinfo++;
else
break;
if( trackinfo[ii] == track->m_Width )
break;
}
trackinfo = ptinfo;
if( *ptinfo < 0 )
{
*ptinfo = track->m_Width;
ptinfo++; *ptinfo = -1;
}
}
if ( ii == trackinfo.size() ) // not found
trackinfo.push_back(track->m_Width);
last_width = track->m_Width;
}
}
for( track = pcb->m_Zone; track != NULL; track = track->Next() )
{
if( *trackinfo != track->m_Width ) // recherche d'une epaisseur deja utilisee
if( last_width != track->m_Width ) // recherche d'une epaisseur deja utilisee
{
ptinfo = (int*) adr_lowmem;
while( *ptinfo >= 0 )
for ( ii = 0; ii < trackinfo.size(); ii++ )
{
if( *ptinfo != track->m_Width )
ptinfo++;
else
break;
if( trackinfo[ii] == track->m_Width )
break;
}
trackinfo = ptinfo;
if( *ptinfo < 0 )
{
*ptinfo = track->m_Width;
ptinfo++; *ptinfo = -1;
}
if ( ii == trackinfo.size() ) // not found
trackinfo.push_back(track->m_Width);
last_width = track->m_Width;
}
}
// Write data
fputs( "$TRACKS\n", file );
for( trackinfo = (int*) adr_lowmem; *trackinfo >= 0; trackinfo++ )
for( ii = 0; ii < trackinfo.size(); ii++ )
{
fprintf( file, "TRACK TRACK%d %d\n", *trackinfo, *trackinfo );
fprintf( file, "TRACK TRACK%d %d\n", trackinfo[ii], trackinfo[ii] );
}
fputs( "$ENDTRACKS\n\n", file );
return (int*) adr_lowmem;
}
......
......@@ -80,7 +80,7 @@ void WinEDA_PcbGlobalDeleteFrame::AcceptPcbDelete( wxCommandEvent& event )
gen_rastnest = true;
redraw = TRUE;
}
if( m_DelTracks->GetValue() )
{
track_mask = 0;
......@@ -149,9 +149,6 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
/* init pointeurs et variables */
GetScreen()->m_FileName.Empty();
memset( buf_work, 0, BUFMEMSIZE );
adr_lowmem = adr_max = buf_work;
SetCurItem( NULL );
/* Init parametres de gestion */
......
......@@ -42,7 +42,6 @@ extern PARAM_CFG_BASE* ParamCfgList[];
char* buf_work = NULL; /* pointeur sur le buffer de travail */
char* adr_lowmem = NULL; /* adresse de base memoire de calcul disponible*/
char* adr_himem = NULL; /* adresse haute limite de la memoire disponible*/
char* adr_max = NULL; /* adresse haute maxi utilisee pour la memoire */
int Angle_Rot_Module;
......@@ -143,7 +142,6 @@ Changing extension to .brd." ),
/* allocation de la memoire pour le fichier et autres buffers: */
/* On reserve BUFMEMSIZE octets de ram pour calcul */
buf_work = adr_lowmem = (char*) MyZMalloc( BUFMEMSIZE ); /* adresse de la zone de calcul */
adr_himem = adr_lowmem + BUFMEMSIZE; /* adr limite haute */
adr_max = adr_lowmem;
if( adr_lowmem == NULL )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment