Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ce4d22f0
Commit
ce4d22f0
authored
Oct 05, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work around some gcc 4.3.3 compiler warnings
parent
b34df533
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
455 additions
and
436 deletions
+455
-436
3d_draw.cpp
3d-viewer/3d_draw.cpp
+1
-1
edaappl.cpp
common/edaappl.cpp
+1
-1
hotkeys_basic.cpp
common/hotkeys_basic.cpp
+8
-10
listlib.cpp
cvpcb/listlib.cpp
+91
-91
readschematicnetlist.cpp
cvpcb/readschematicnetlist.cpp
+1
-1
writenetlistpcbnew.cpp
cvpcb/writenetlistpcbnew.cpp
+1
-1
export_to_pcbnew.cpp
gerbview/export_to_pcbnew.cpp
+1
-1
class_drc_item.h
include/class_drc_item.h
+5
-5
minizip.c
kicad/minizip/minizip.c
+334
-313
build_BOM_from_board.cpp
pcbnew/build_BOM_from_board.cpp
+2
-2
class_module.cpp
pcbnew/class_module.cpp
+3
-3
dialog_drc.cpp
pcbnew/dialog_drc.cpp
+2
-2
ioascii.cpp
pcbnew/ioascii.cpp
+1
-1
onrightclick.cpp
pcbnew/onrightclick.cpp
+2
-2
xchgmod.cpp
pcbnew/xchgmod.cpp
+2
-2
No files found.
3d-viewer/3d_draw.cpp
View file @
ce4d22f0
...
@@ -658,7 +658,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
...
@@ -658,7 +658,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
default
:
default
:
s
.
Printf
(
wxT
(
"Error: Shape nr %d not implemented!
\n
"
),
m_Shape
);
s
.
Printf
(
wxT
(
"Error: Shape nr %d not implemented!
\n
"
),
m_Shape
);
printf
(
CONV_TO_UTF8
(
s
)
);
D
(
printf
(
"%s"
,
CONV_TO_UTF8
(
s
)
);)
break
;
break
;
}
}
}
}
...
...
common/edaappl.cpp
View file @
ce4d22f0
...
@@ -417,7 +417,7 @@ bool WinEDA_App::SetBinDir()
...
@@ -417,7 +417,7 @@ bool WinEDA_App::SetBinDir()
if
(
(
ftmp
=
fopen
(
TMP_FILE
,
"rt"
)
)
!=
NULL
)
if
(
(
ftmp
=
fopen
(
TMP_FILE
,
"rt"
)
)
!=
NULL
)
{
{
fgets
(
Line
,
1000
,
ftmp
);
(
void
)
fgets
(
Line
,
1000
,
ftmp
);
fclose
(
ftmp
);
fclose
(
ftmp
);
remove
(
TMP_FILE
);
remove
(
TMP_FILE
);
}
}
...
...
common/hotkeys_basic.cpp
View file @
ce4d22f0
...
@@ -412,12 +412,12 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
...
@@ -412,12 +412,12 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
wxString
keyname
,
infokey
;
wxString
keyname
,
infokey
;
msg
=
wxT
(
"$hotkey list
\n
"
);
msg
=
wxT
(
"$hotkey list
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
/* print the allowed keys, for info
/* print the allowed keys, for info
*/
*/
msg
=
wxT
(
"# "
);
msg
+=
_
(
"Allowed keys:
\n
"
);
msg
=
wxT
(
"# "
);
msg
+=
_
(
"Allowed keys:
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
msg
.
Empty
();
msg
.
Empty
();
for
(
int
ii
=
0
;
;
ii
++
)
for
(
int
ii
=
0
;
;
ii
++
)
{
{
...
@@ -431,7 +431,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
...
@@ -431,7 +431,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
if
(
msg
.
Len
()
>
60
)
if
(
msg
.
Len
()
>
60
)
{
{
msg
+=
wxT
(
"
\n
"
);
msg
+=
wxT
(
"
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
msg
.
Empty
();
msg
.
Empty
();
}
}
}
}
...
@@ -440,7 +440,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
...
@@ -440,7 +440,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
if
(
!
msg
.
IsEmpty
()
)
if
(
!
msg
.
IsEmpty
()
)
msg
+=
wxT
(
"
\n
"
);
msg
+=
wxT
(
"
\n
"
);
msg
+=
wxT
(
"#
\n
#
\n
"
);
msg
+=
wxT
(
"#
\n
#
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
/* Print the current hotkey list */
/* Print the current hotkey list */
Ki_HotkeyInfo
**
List
;
Ki_HotkeyInfo
**
List
;
...
@@ -449,12 +449,10 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
...
@@ -449,12 +449,10 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
if
(
DescList
->
m_Comment
)
if
(
DescList
->
m_Comment
)
{
{
fprintf
(
cfgfile
,
"# "
);
fprintf
(
cfgfile
,
"# "
);
fprintf
(
cfgfile
,
DescList
->
m_Comment
);
fprintf
(
cfgfile
,
"%s
\n
"
,
DescList
->
m_Comment
);
fprintf
(
cfgfile
,
"
\n
"
);
}
}
msg
=
*
DescList
->
m_SectionTag
;
msg
=
*
DescList
->
m_SectionTag
;
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s
\n
"
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"
\n
"
);
List
=
DescList
->
m_HK_InfoList
;
List
=
DescList
->
m_HK_InfoList
;
for
(
;
*
List
!=
NULL
;
List
++
)
for
(
;
*
List
!=
NULL
;
List
++
)
{
{
...
@@ -465,12 +463,12 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
...
@@ -465,12 +463,12 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString&
infokey
=
hk_decr
->
m_InfoMsg
;
infokey
=
hk_decr
->
m_InfoMsg
;
AddDelimiterString
(
infokey
);
AddDelimiterString
(
infokey
);
msg
+=
keyname
+
wxT
(
": "
)
+
infokey
+
wxT
(
"
\n
"
);
msg
+=
keyname
+
wxT
(
": "
)
+
infokey
+
wxT
(
"
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
}
}
}
}
msg
=
wxT
(
"$Endlist
\n
"
);
msg
=
wxT
(
"$Endlist
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
cfgfile
,
"%s
\n
"
,
CONV_TO_UTF8
(
msg
)
);
fclose
(
cfgfile
);
fclose
(
cfgfile
);
return
1
;
return
1
;
}
}
...
...
cvpcb/listlib.cpp
View file @
ce4d22f0
...
@@ -44,19 +44,19 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
...
@@ -44,19 +44,19 @@ static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
bool
LoadFootprintFiles
(
const
wxArrayString
&
libNames
,
bool
LoadFootprintFiles
(
const
wxArrayString
&
libNames
,
FOOTPRINT_LIST
&
list
)
FOOTPRINT_LIST
&
list
)
{
{
FILE
*
file
;
/* pour lecture librairie */
FILE
*
file
;
/* pour lecture librairie */
char
buffer
[
1024
];
char
buffer
[
1024
];
wxFileName
filename
;
wxFileName
filename
;
int
end
;
int
end
;
FOOTPRINT
*
ItemLib
;
FOOTPRINT
*
ItemLib
;
unsigned
i
;
unsigned
i
;
wxString
tmp
,
msg
;
wxString
tmp
,
msg
;
/* Check if footprint list is not empty */
/* Check if footprint list is not empty */
if
(
!
list
.
empty
()
)
if
(
!
list
.
empty
()
)
list
.
clear
();
list
.
clear
();
/* Check if there are footprint libraries in project file */
/* Check if there are footprint libraries in project file */
if
(
libNames
.
GetCount
()
==
0
)
if
(
libNames
.
GetCount
()
==
0
)
{
{
wxMessageBox
(
_
(
"No PCB foot print libraries are listed in the current project file."
),
wxMessageBox
(
_
(
"No PCB foot print libraries are listed in the current project file."
),
...
@@ -90,7 +90,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
...
@@ -90,7 +90,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
}
}
/* Check if library type is valid */
/* Check if library type is valid */
fgets
(
buffer
,
32
,
file
);
(
void
)
fgets
(
buffer
,
32
,
file
);
if
(
strncmp
(
buffer
,
ENTETE_LIBRAIRIE
,
L_ENTETE_LIB
)
!=
0
)
if
(
strncmp
(
buffer
,
ENTETE_LIBRAIRIE
,
L_ENTETE_LIB
)
!=
0
)
{
{
s_files_invalid
<<
tmp
<<
_
(
" (Not a Kicad file)"
)
<<
wxT
(
"
\n
"
);
s_files_invalid
<<
tmp
<<
_
(
" (Not a Kicad file)"
)
<<
wxT
(
"
\n
"
);
...
@@ -132,8 +132,8 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
...
@@ -132,8 +132,8 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
ReadDocLib
(
tmp
,
list
);
ReadDocLib
(
tmp
,
list
);
}
}
/* Display if there are mdc files not found */
/* Display if there are mdc files not found */
if
(
!
s_files_not_found
.
IsEmpty
()
||
!
s_files_invalid
.
IsEmpty
()
)
if
(
!
s_files_not_found
.
IsEmpty
()
||
!
s_files_invalid
.
IsEmpty
()
)
{
{
DIALOG_LOAD_ERROR
dialog
(
NULL
);
DIALOG_LOAD_ERROR
dialog
(
NULL
);
if
(
!
s_files_not_found
.
IsEmpty
()
)
if
(
!
s_files_not_found
.
IsEmpty
()
)
...
@@ -154,9 +154,9 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
...
@@ -154,9 +154,9 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
dialog
.
ShowModal
();
dialog
.
ShowModal
();
}
}
list
.
sort
();
list
.
sort
();
return
true
;
return
true
;
}
}
...
@@ -169,77 +169,77 @@ static void
...
@@ -169,77 +169,77 @@ static void
ReadDocLib
(
const
wxString
&
ModLibName
,
ReadDocLib
(
const
wxString
&
ModLibName
,
FOOTPRINT_LIST
&
list
)
FOOTPRINT_LIST
&
list
)
{
{
FOOTPRINT
*
NewMod
;
FOOTPRINT
*
NewMod
;
char
Line
[
1024
];
char
Line
[
1024
];
wxString
ModuleName
;
wxString
ModuleName
;
FILE
*
mdc_file
;
FILE
*
mdc_file
;
wxFileName
mdc_filename
=
ModLibName
;
wxFileName
mdc_filename
=
ModLibName
;
/* Set mdc filename extension */
/* Set mdc filename extension */
mdc_filename
.
SetExt
(
wxT
(
"mdc"
)
);
mdc_filename
.
SetExt
(
wxT
(
"mdc"
)
);
/* Check if mdc file exists and can be opened */
/* Check if mdc file exists and can be opened */
if
(
(
mdc_file
=
wxFopen
(
mdc_filename
.
GetFullPath
(),
wxT
(
"rt"
)
)
)
==
NULL
)
if
(
(
mdc_file
=
wxFopen
(
mdc_filename
.
GetFullPath
(),
wxT
(
"rt"
)
)
)
==
NULL
)
{
{
s_files_not_found
+=
mdc_filename
.
GetFullPath
()
+
wxT
(
"
\n
"
);
s_files_not_found
+=
mdc_filename
.
GetFullPath
()
+
wxT
(
"
\n
"
);
return
;
return
;
}
}
/* Check if mdc file is valid */
/* Check if mdc file is valid */
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
);
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
);
if
(
strnicmp
(
Line
,
ENTETE_LIBDOC
,
L_ENTETE_LIB
)
!=
0
)
if
(
strnicmp
(
Line
,
ENTETE_LIBDOC
,
L_ENTETE_LIB
)
!=
0
)
{
{
s_files_invalid
+=
mdc_filename
.
GetFullPath
()
+
wxT
(
"
\n
"
);
s_files_invalid
+=
mdc_filename
.
GetFullPath
()
+
wxT
(
"
\n
"
);
return
;
return
;
}
}
/* Read the mdc file */
/* Read the mdc file */
while
(
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
while
(
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
{
{
NewMod
=
NULL
;
NewMod
=
NULL
;
if
(
Line
[
0
]
!=
'$'
)
if
(
Line
[
0
]
!=
'$'
)
continue
;
continue
;
if
(
Line
[
1
]
==
'E'
)
if
(
Line
[
1
]
==
'E'
)
break
;
break
;
if
(
Line
[
1
]
==
'M'
)
/* 1 module description */
if
(
Line
[
1
]
==
'M'
)
/* 1 module description */
{
{
/* Parse file line by line */
/* Parse file line by line */
while
(
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
while
(
GetLine
(
mdc_file
,
Line
,
NULL
,
sizeof
(
Line
)
-
1
)
)
{
{
/* $EndMODULE */
/* $EndMODULE */
if
(
Line
[
0
]
==
'$'
)
if
(
Line
[
0
]
==
'$'
)
break
;
break
;
switch
(
Line
[
0
]
)
switch
(
Line
[
0
]
)
{
{
/* LibName */
/* LibName */
case
'L'
:
/* LibName */
case
'L'
:
/* LibName */
ModuleName
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
ModuleName
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
BOOST_FOREACH
(
FOOTPRINT
&
footprint
,
list
)
BOOST_FOREACH
(
FOOTPRINT
&
footprint
,
list
)
{
{
if
(
ModuleName
==
footprint
.
m_Module
)
if
(
ModuleName
==
footprint
.
m_Module
)
{
{
NewMod
=
&
footprint
;
NewMod
=
&
footprint
;
break
;
break
;
}
}
}
}
break
;
break
;
/* KeyWords */
/* KeyWords */
case
'K'
:
case
'K'
:
if
(
NewMod
&&
(
!
NewMod
->
m_KeyWord
)
)
if
(
NewMod
&&
(
!
NewMod
->
m_KeyWord
)
)
NewMod
->
m_KeyWord
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
NewMod
->
m_KeyWord
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
break
;
break
;
/* Doc */
/* Doc */
case
'C'
:
case
'C'
:
if
(
NewMod
&&
(
!
NewMod
->
m_Doc
)
)
if
(
NewMod
&&
(
!
NewMod
->
m_Doc
)
)
NewMod
->
m_Doc
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
NewMod
->
m_Doc
=
CONV_FROM_UTF8
(
StrPurge
(
Line
+
3
)
);
break
;
break
;
}
}
}
}
}
/* Parsed one module documentation */
}
/* Parsed one module documentation */
}
/* Parsed complete library documentation */
}
/* Parsed complete library documentation */
fclose
(
mdc_file
);
fclose
(
mdc_file
);
}
}
cvpcb/readschematicnetlist.cpp
View file @
ce4d22f0
...
@@ -118,7 +118,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
...
@@ -118,7 +118,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
/* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" )
/* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" )
* or "# EESchema Netliste"
* or "# EESchema Netliste"
*/
*/
fgets
(
Line
,
BUFFER_CHAR_SIZE
,
source
);
(
void
)
fgets
(
Line
,
BUFFER_CHAR_SIZE
,
source
);
/* test for netlist type PCB2 */
/* test for netlist type PCB2 */
i
=
strnicmp
(
Line
,
"( {"
,
3
);
i
=
strnicmp
(
Line
,
"( {"
,
3
);
if
(
i
!=
0
)
if
(
i
!=
0
)
...
...
cvpcb/writenetlistpcbnew.cpp
View file @
ce4d22f0
...
@@ -93,7 +93,7 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
...
@@ -93,7 +93,7 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
fprintf
(
file
,
" ( %s "
,
CONV_TO_UTF8
(
component
.
m_TimeStamp
)
);
fprintf
(
file
,
" ( %s "
,
CONV_TO_UTF8
(
component
.
m_TimeStamp
)
);
if
(
!
component
.
m_Module
.
IsEmpty
()
)
if
(
!
component
.
m_Module
.
IsEmpty
()
)
fprintf
(
file
,
CONV_TO_UTF8
(
component
.
m_Module
)
);
fprintf
(
file
,
"%s"
,
CONV_TO_UTF8
(
component
.
m_Module
)
);
else
else
fprintf
(
file
,
"$noname$"
);
fprintf
(
file
,
"$noname$"
);
...
...
gerbview/export_to_pcbnew.cpp
View file @
ce4d22f0
...
@@ -94,7 +94,7 @@ static int WriteSetup( FILE* File, BOARD* Pcb )
...
@@ -94,7 +94,7 @@ static int WriteSetup( FILE* File, BOARD* Pcb )
fprintf
(
File
,
"$SETUP
\n
"
);
fprintf
(
File
,
"$SETUP
\n
"
);
sprintf
(
text
,
"InternalUnit %f INCH
\n
"
,
1.0
/
PCB_INTERNAL_UNIT
);
sprintf
(
text
,
"InternalUnit %f INCH
\n
"
,
1.0
/
PCB_INTERNAL_UNIT
);
fprintf
(
File
,
text
);
fprintf
(
File
,
"%s"
,
text
);
Pcb
->
m_BoardSettings
->
m_CopperLayerCount
=
g_DesignSettings
.
m_CopperLayerCount
;
Pcb
->
m_BoardSettings
->
m_CopperLayerCount
=
g_DesignSettings
.
m_CopperLayerCount
;
fprintf
(
File
,
"Layers %d
\n
"
,
g_DesignSettings
.
m_CopperLayerCount
);
fprintf
(
File
,
"Layers %d
\n
"
,
g_DesignSettings
.
m_CopperLayerCount
);
...
...
include/class_drc_item.h
View file @
ce4d22f0
...
@@ -188,16 +188,16 @@ public:
...
@@ -188,16 +188,16 @@ public:
{
{
ret
.
Printf
(
wxT
(
"ErrType(%d): %s
\n
%s: %s
\n
%s: %s
\n
"
),
ret
.
Printf
(
wxT
(
"ErrType(%d): %s
\n
%s: %s
\n
%s: %s
\n
"
),
m_ErrorCode
,
m_ErrorCode
,
Get
ErrorText
().
GetData
(
),
Get
Chars
(
GetErrorText
()
),
ShowCoord
(
m_MainPosition
).
GetData
(),
m_MainText
.
GetData
(
),
GetChars
(
ShowCoord
(
m_MainPosition
)
),
GetChars
(
m_MainText
),
ShowCoord
(
m_AuxiliaryPosition
).
GetData
(),
m_AuxiliaryText
.
GetData
(
)
);
GetChars
(
ShowCoord
(
m_AuxiliaryPosition
)
),
GetChars
(
m_AuxiliaryText
)
);
}
}
else
else
{
{
ret
.
Printf
(
wxT
(
"ErrType(%d): %s
\n
%s: %s
\n
"
),
ret
.
Printf
(
wxT
(
"ErrType(%d): %s
\n
%s: %s
\n
"
),
m_ErrorCode
,
m_ErrorCode
,
Get
ErrorText
().
GetData
(
),
Get
Chars
(
GetErrorText
()
),
ShowCoord
(
m_MainPosition
).
GetData
(),
m_MainText
.
GetData
(
)
);
GetChars
(
ShowCoord
(
m_MainPosition
)
),
GetChars
(
m_MainText
)
);
}
}
return
ret
;
return
ret
;
...
...
kicad/minizip/minizip.c
View file @
ce4d22f0
/* MiniZip 1.00, demo of zLib + Zip package written by Gilles Vollant
/* MiniZip 1.00, demo of zLib + Zip package written by Gilles Vollant
Modifie le 2 juin 2004 JPC
*
Modifie le 2 juin 2004 JPC
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
...
@@ -21,358 +21,379 @@
...
@@ -21,358 +21,379 @@
#include "zip.h"
#include "zip.h"
#ifdef WIN32
#ifdef WIN32
//#define USEWIN32IOAPI
//#define USEWIN32IOAPI
#include "iowin32.h"
#include "iowin32.h"
#endif
#endif
#define WRITEBUFFERSIZE (16384)
#define WRITEBUFFERSIZE (16384)
#define MAXFILENAME (1024)
#define MAXFILENAME
(1024)
int
g_Verbose
=
1
;
int
g_Verbose
=
1
;
/*****************************/
/*****************************/
uLong
filetime
(
uLong
filetime
(
const
char
*
filename
,
/* name of file to get info on */
const
char
*
filename
,
/* name of file to get info on */
tm_zip
*
tmzip
,
/* return value: access, modific. and creation times */
tm_zip
*
tmzip
,
/* return value: access, modific. and creation times */
uLong
*
dt
)
/* dostime */
uLong
*
dt
)
/* dostime */
/*****************************/
/*****************************/
#ifdef WIN32
#ifdef WIN32
{
{
int
ret
=
0
;
int
ret
=
0
;
{
FILETIME
ftLocal
;
{
HANDLE
hFind
;
FILETIME
ftLocal
;
WIN32_FIND_DATA
ff32
;
HANDLE
hFind
;
WIN32_FIND_DATA
ff32
;
hFind
=
FindFirstFile
(
filename
,
&
ff32
);
if
(
hFind
!=
INVALID_HANDLE_VALUE
)
hFind
=
FindFirstFile
(
filename
,
&
ff32
);
{
if
(
hFind
!=
INVALID_HANDLE_VALUE
)
FileTimeToLocalFileTime
(
&
(
ff32
.
ftLastWriteTime
),
&
ftLocal
);
{
FileTimeToDosDateTime
(
&
ftLocal
,((
LPWORD
)
dt
)
+
1
,((
LPWORD
)
dt
)
+
0
);
FileTimeToLocalFileTime
(
&
(
ff32
.
ftLastWriteTime
),
&
ftLocal
);
FindClose
(
hFind
);
FileTimeToDosDateTime
(
&
ftLocal
,
(
(
LPWORD
)
dt
)
+
1
,
(
(
LPWORD
)
dt
)
+
0
);
ret
=
1
;
FindClose
(
hFind
);
}
ret
=
1
;
}
}
return
ret
;
}
return
ret
;
}
}
#else
#else
#ifdef unix
#ifdef unix
{
{
int
ret
=
0
;
int
ret
=
0
;
struct
stat
s
;
/* results of stat() */
struct
stat
s
;
/* results of stat() */
struct
tm
*
filedate
;
struct
tm
*
filedate
;
time_t
tm_t
=
0
;
time_t
tm_t
=
0
;
if
(
strcmp
(
filename
,
"-"
)
!=
0
)
if
(
strcmp
(
filename
,
"-"
)
!=
0
)
{
{
char
name
[
MAXFILENAME
+
10
];
char
name
[
MAXFILENAME
+
10
];
int
len
=
strlen
(
filename
);
int
len
=
strlen
(
filename
);
strncpy
(
name
,
filename
,
MAXFILENAME
);
strncpy
(
name
,
filename
,
MAXFILENAME
);
/* strncpy doesnt append the trailing NULL, of the string is too long. */
/* strncpy doesnt append the trailing NULL, of the string is too long. */
name
[
MAXFILENAME
]
=
'\0'
;
name
[
MAXFILENAME
]
=
'\0'
;
if
(
name
[
len
-
1
]
==
'/'
)
if
(
name
[
len
-
1
]
==
'/'
)
name
[
len
-
1
]
=
'\0'
;
name
[
len
-
1
]
=
'\0'
;
/* not all systems allow stat'ing a file with / appended */
/* not all systems allow stat'ing a file with / appended */
if
(
stat
(
name
,
&
s
)
==
0
)
if
(
stat
(
name
,
&
s
)
==
0
)
{
{
tm_t
=
s
.
st_mtime
;
tm_t
=
s
.
st_mtime
;
ret
=
1
;
ret
=
1
;
}
}
}
}
filedate
=
localtime
(
&
tm_t
);
filedate
=
localtime
(
&
tm_t
);
tmzip
->
tm_sec
=
filedate
->
tm_sec
;
tmzip
->
tm_sec
=
filedate
->
tm_sec
;
tmzip
->
tm_min
=
filedate
->
tm_min
;
tmzip
->
tm_min
=
filedate
->
tm_min
;
tmzip
->
tm_hour
=
filedate
->
tm_hour
;
tmzip
->
tm_hour
=
filedate
->
tm_hour
;
tmzip
->
tm_mday
=
filedate
->
tm_mday
;
tmzip
->
tm_mday
=
filedate
->
tm_mday
;
tmzip
->
tm_mon
=
filedate
->
tm_mon
;
tmzip
->
tm_mon
=
filedate
->
tm_mon
;
tmzip
->
tm_year
=
filedate
->
tm_year
;
tmzip
->
tm_year
=
filedate
->
tm_year
;
return
ret
;
return
ret
;
}
}
#else
#else
{
{
return
0
;
return
0
;
}
}
#endif
#endif
#endif
#endif
/*******************************************/
int
check_exist_file
(
const
char
*
filename
)
/*******************************************/
/*******************************************/
int
check_exist_file
(
const
char
*
filename
)
{
{
FILE
*
ftestexist
;
/*******************************************/
int
ret
=
1
;
FILE
*
ftestexist
;
ftestexist
=
fopen
(
filename
,
"rb"
);
int
ret
=
1
;
if
(
ftestexist
==
NULL
)
ret
=
0
;
else
fclose
(
ftestexist
);
ftestexist
=
fopen
(
filename
,
"rb"
);
return
ret
;
if
(
ftestexist
==
NULL
)
ret
=
0
;
else
fclose
(
ftestexist
);
return
ret
;
}
}
/* calculate the CRC32 of a file,
/* calculate the CRC32 of a file,
because to encrypt a file, we need known the CRC32 of the file before */
* because to encrypt a file, we need known the CRC32 of the file before */
int
getFileCrc
(
const
char
*
filenameinzip
,
void
*
buf
,
unsigned
long
size_buf
,
unsigned
long
*
result_crc
)
int
getFileCrc
(
const
char
*
filenameinzip
,
void
*
buf
,
unsigned
long
size_buf
,
unsigned
long
*
result_crc
)
{
{
unsigned
long
calculate_crc
=
0
;
unsigned
long
calculate_crc
=
0
;
int
err
=
ZIP_OK
;
int
err
=
ZIP_OK
;
FILE
*
fin
=
fopen
(
filenameinzip
,
"rb"
);
FILE
*
fin
=
fopen
(
filenameinzip
,
"rb"
);
unsigned
long
size_read
=
0
;
unsigned
long
size_read
=
0
;
unsigned
long
total_read
=
0
;
unsigned
long
total_read
=
0
;
if
(
fin
==
NULL
)
if
(
fin
==
NULL
)
{
{
err
=
ZIP_ERRNO
;
err
=
ZIP_ERRNO
;
}
}
if
(
err
==
ZIP_OK
)
if
(
err
==
ZIP_OK
)
do
do
{
{
err
=
ZIP_OK
;
err
=
ZIP_OK
;
size_read
=
(
int
)
fread
(
buf
,
1
,
size_buf
,
fin
);
size_read
=
(
int
)
fread
(
buf
,
1
,
size_buf
,
fin
);
if
(
size_read
<
size_buf
)
if
(
size_read
<
size_buf
)
if
(
feof
(
fin
)
==
0
)
if
(
feof
(
fin
)
==
0
)
{
{
printf
(
"error in reading %s
\n
"
,
filenameinzip
);
printf
(
"error in reading %s
\n
"
,
filenameinzip
);
err
=
ZIP_ERRNO
;
err
=
ZIP_ERRNO
;
}
}
if
(
size_read
>
0
)
if
(
size_read
>
0
)
calculate_crc
=
crc32
(
calculate_crc
,
buf
,
size_read
);
calculate_crc
=
crc32
(
calculate_crc
,
buf
,
size_read
);
total_read
+=
size_read
;
total_read
+=
size_read
;
}
while
(
(
err
==
ZIP_OK
)
&&
(
size_read
>
0
)
);
}
while
((
err
==
ZIP_OK
)
&&
(
size_read
>
0
));
if
(
fin
)
if
(
fin
)
fclose
(
fin
);
fclose
(
fin
);
*
result_crc
=
calculate_crc
;
*
result_crc
=
calculate_crc
;
if
(
g_Verbose
)
if
(
g_Verbose
)
printf
(
"file %s crc %lx
\n
"
,
filenameinzip
,
calculate_crc
);
printf
(
"file %s crc %lx
\n
"
,
filenameinzip
,
calculate_crc
);
return
err
;
return
err
;
}
}
/********************************/
/********************************/
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[]
)
/********************************/
{
{
int
i
;
/********************************/
int
opt_overwrite
=
0
;
int
i
;
int
opt_compress_level
=
Z_DEFAULT_COMPRESSION
;
int
opt_overwrite
=
0
;
int
zipfilenamearg
=
0
;
int
opt_compress_level
=
Z_DEFAULT_COMPRESSION
;
char
filename_try
[
MAXFILENAME
+
16
];
int
zipfilenamearg
=
0
;
int
zipok
;
char
filename_try
[
MAXFILENAME
+
16
];
int
err
=
0
;
int
zipok
;
int
size_buf
=
0
;
int
err
=
0
;
void
*
buf
=
NULL
;
int
size_buf
=
0
;
const
char
*
password
=
NULL
;
void
*
buf
=
NULL
;
const
char
*
password
=
NULL
;
if
(
argc
<=
1
)
{
if
(
argc
<=
1
)
printf
(
"Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]
\n\n
"
\
{
" -o Overwrite existing file.zip
\n
"
\
printf
(
"Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]
\n\n
"
\
" -a Append to existing file.zip
\n
"
\
" -o Overwrite existing file.zip
\n
"
\
" -0 Store only, -1 Compress faster, -9 Compress better [5]
\n\n
"
);
" -a Append to existing file.zip
\n
"
\
return
0
;
" -0 Store only, -1 Compress faster, -9 Compress better [5]
\n\n
"
);
}
return
0
;
}
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
for
(
i
=
1
;
i
<
argc
;
i
++
)
if
((
*
argv
[
i
])
==
'-'
)
/* Find options */
{
{
if
(
(
*
argv
[
i
])
==
'-'
)
/* Find options */
const
char
*
p
=
argv
[
i
]
+
1
;
{
const
char
*
p
=
argv
[
i
]
+
1
;
while
((
*
p
)
!=
'\0'
)
{
while
(
(
*
p
)
!=
'\0'
)
char
c
=*
(
p
++
);
{
if
((
c
==
'o'
)
||
(
c
==
'O'
))
char
c
=
*
(
p
++
);
opt_overwrite
=
1
;
if
(
(
c
==
'o'
)
||
(
c
==
'O'
)
)
else
if
((
c
==
'a'
)
||
(
c
==
'A'
))
opt_overwrite
=
1
;
opt_overwrite
=
2
;
else
if
(
(
c
==
'a'
)
||
(
c
==
'A'
)
)
else
if
((
c
>=
'0'
)
&&
(
c
<=
'9'
))
opt_overwrite
=
2
;
opt_compress_level
=
c
-
'0'
;
else
if
(
(
c
>=
'0'
)
&&
(
c
<=
'9'
)
)
opt_compress_level
=
c
-
'0'
;
else
if
(((
c
==
'p'
)
||
(
c
==
'P'
))
&&
(
i
+
1
<
argc
))
{
else
if
(
(
(
c
==
'p'
)
||
(
c
==
'P'
)
)
&&
(
i
+
1
<
argc
)
)
password
=
argv
[
i
+
1
];
{
i
++
;
password
=
argv
[
i
+
1
];
}
i
++
;
else
}
{
else
printf
(
"Unknown option %c
\n
"
,
c
);
{
err
=
1
;
printf
(
"Unknown option %c
\n
"
,
c
);
}
err
=
1
;
}
}
}
}
else
if
(
zipfilenamearg
==
0
)
zipfilenamearg
=
i
;
}
}
else
if
(
zipfilenamearg
==
0
)
zipfilenamearg
=
i
;
if
(
err
)
return
0
;
}
size_buf
=
WRITEBUFFERSIZE
;
if
(
err
)
buf
=
(
void
*
)
malloc
(
size_buf
);
return
0
;
if
(
buf
==
NULL
)
{
size_buf
=
WRITEBUFFERSIZE
;
printf
(
"Error allocating memory
\n
"
);
buf
=
(
void
*
)
malloc
(
size_buf
);
return
ZIP_INTERNALERROR
;
if
(
buf
==
NULL
)
}
{
printf
(
"Error allocating memory
\n
"
);
if
(
zipfilenamearg
==
0
)
zipok
=
0
;
return
ZIP_INTERNALERROR
;
else
}
{
int
len
;
if
(
zipfilenamearg
==
0
)
int
dot_found
=
0
;
zipok
=
0
;
else
zipok
=
1
;
{
strncpy
(
filename_try
,
argv
[
zipfilenamearg
],
MAXFILENAME
);
int
len
;
/* strncpy doesnt append the trailing NULL, of the string is too long. */
int
dot_found
=
0
;
filename_try
[
MAXFILENAME
]
=
'\0'
;
zipok
=
1
;
len
=
(
int
)
strlen
(
filename_try
);
strncpy
(
filename_try
,
argv
[
zipfilenamearg
],
MAXFILENAME
);
for
(
i
=
0
;
i
<
len
;
i
++
)
/* strncpy doesnt append the trailing NULL, of the string is too long. */
if
(
filename_try
[
i
]
==
'.'
)
filename_try
[
MAXFILENAME
]
=
'\0'
;
dot_found
=
1
;
len
=
(
int
)
strlen
(
filename_try
);
if
(
dot_found
==
0
)
for
(
i
=
0
;
i
<
len
;
i
++
)
strcat
(
filename_try
,
".zip"
);
if
(
filename_try
[
i
]
==
'.'
)
dot_found
=
1
;
if
(
opt_overwrite
==
2
)
{
if
(
dot_found
==
0
)
/* if the file don't exist, we not append file */
strcat
(
filename_try
,
".zip"
);
if
(
check_exist_file
(
filename_try
)
==
0
)
opt_overwrite
=
1
;
if
(
opt_overwrite
==
2
)
}
{
else
/* if the file don't exist, we not append file */
if
(
opt_overwrite
==
0
)
if
(
check_exist_file
(
filename_try
)
==
0
)
if
(
check_exist_file
(
filename_try
)
!=
0
)
opt_overwrite
=
1
;
{
}
char
rep
=
0
;
else
do
if
(
opt_overwrite
==
0
)
{
if
(
check_exist_file
(
filename_try
)
!=
0
)
char
answer
[
128
];
{
printf
(
"The file %s exist. Overwrite ? [y]es, [n]o, [a]ppend : "
,
filename_try
);
char
rep
=
0
;
scanf
(
"%1s"
,
answer
);
do
rep
=
answer
[
0
]
;
{
if
((
rep
>=
'a'
)
&&
(
rep
<=
'z'
))
char
answer
[
128
];
rep
-=
0x20
;
printf
(
"The file %s exist. Overwrite ? [y]es, [n]o, [a]ppend : "
,
}
filename_try
);
while
((
rep
!=
'Y'
)
&&
(
rep
!=
'N'
)
&&
(
rep
!=
'A'
));
(
void
)
scanf
(
"%1s"
,
answer
);
if
(
rep
==
'N'
)
zipok
=
0
;
rep
=
answer
[
0
];
if
(
rep
==
'A'
)
opt_overwrite
=
2
;
if
(
(
rep
>=
'a'
)
&&
(
rep
<=
'z'
)
)
}
rep
-=
0x20
;
}
}
while
(
(
rep
!=
'Y'
)
&&
(
rep
!=
'N'
)
&&
(
rep
!=
'A'
)
);
if
(
zipok
==
1
)
if
(
rep
==
'N'
)
{
zipok
=
0
;
zipFile
zf
;
if
(
rep
==
'A'
)
int
errclose
;
opt_overwrite
=
2
;
}
}
if
(
zipok
==
1
)
{
zipFile
zf
;
int
errclose
;
#ifdef USEWIN32IOAPI
#ifdef USEWIN32IOAPI
zlib_filefunc_def
ffunc
;
zlib_filefunc_def
ffunc
;
fill_win32_filefunc
(
&
ffunc
);
fill_win32_filefunc
(
&
ffunc
);
zf
=
zipOpen2
(
filename_try
,(
opt_overwrite
==
2
)
?
2
:
0
,
NULL
,
&
ffunc
);
zf
=
zipOpen2
(
filename_try
,
(
opt_overwrite
==
2
)
?
2
:
0
,
NULL
,
&
ffunc
);
#else
#else
zf
=
zipOpen
(
filename_try
,(
opt_overwrite
==
2
)
?
2
:
0
);
zf
=
zipOpen
(
filename_try
,
(
opt_overwrite
==
2
)
?
2
:
0
);
#endif
#endif
if
(
zf
==
NULL
)
if
(
zf
==
NULL
)
{
{
printf
(
"error opening %s
\n
"
,
filename_try
);
printf
(
"error opening %s
\n
"
,
filename_try
);
err
=
ZIP_ERRNO
;
err
=
ZIP_ERRNO
;
}
}
else
else
if
(
g_Verbose
)
printf
(
"creating %s
\n
"
,
filename_try
);
if
(
g_Verbose
)
printf
(
"creating %s
\n
"
,
filename_try
);
for
(
i
=
zipfilenamearg
+
1
;
(
i
<
argc
)
&&
(
err
==
ZIP_OK
);
i
++
)
{
for
(
i
=
zipfilenamearg
+
1
;
(
i
<
argc
)
&&
(
err
==
ZIP_OK
);
i
++
)
if
(((
*
(
argv
[
i
]))
!=
'-'
)
&&
((
*
(
argv
[
i
]))
!=
'/'
))
{
{
if
(
(
(
*
(
argv
[
i
])
)
!=
'-'
)
&&
(
(
*
(
argv
[
i
])
)
!=
'/'
)
)
FILE
*
fin
=
NULL
;
{
int
size_read
;
FILE
*
fin
=
NULL
;
const
char
*
filenameinzip
=
argv
[
i
];
int
size_read
;
zip_fileinfo
zi
;
const
char
*
filenameinzip
=
argv
[
i
];
unsigned
long
crcFile
=
0
;
zip_fileinfo
zi
;
unsigned
long
crcFile
=
0
;
zi
.
tmz_date
.
tm_sec
=
zi
.
tmz_date
.
tm_min
=
zi
.
tmz_date
.
tm_hour
=
zi
.
tmz_date
.
tm_mday
=
zi
.
tmz_date
.
tm_mon
=
zi
.
tmz_date
.
tm_year
=
0
;
zi
.
tmz_date
.
tm_sec
=
zi
.
tmz_date
.
tm_min
=
zi
.
tmz_date
.
tm_hour
=
zi
.
dosDate
=
0
;
zi
.
tmz_date
.
tm_mday
=
zi
.
internal_fa
=
0
;
zi
.
tmz_date
.
tm_mon
=
zi
.
external_fa
=
0
;
zi
.
tmz_date
.
tm_year
=
0
;
filetime
(
filenameinzip
,
&
zi
.
tmz_date
,
&
zi
.
dosDate
);
zi
.
dosDate
=
0
;
zi
.
internal_fa
=
0
;
zi
.
external_fa
=
0
;
filetime
(
filenameinzip
,
&
zi
.
tmz_date
,
&
zi
.
dosDate
);
/*
/*
err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
* err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
NULL,0,NULL,0,NULL / * comment * /,
* NULL,0,NULL,0,NULL / * comment * /,
(opt_compress_level != 0) ? Z_DEFLATED : 0,
* (opt_compress_level != 0) ? Z_DEFLATED : 0,
opt_compress_level);
* opt_compress_level);
*/
*/
if
((
password
!=
NULL
)
&&
(
err
==
ZIP_OK
))
if
(
(
password
!=
NULL
)
&&
(
err
==
ZIP_OK
)
)
err
=
getFileCrc
(
filenameinzip
,
buf
,
size_buf
,
&
crcFile
);
err
=
getFileCrc
(
filenameinzip
,
buf
,
size_buf
,
&
crcFile
);
err
=
zipOpenNewFileInZip3
(
zf
,
filenameinzip
,
&
zi
,
err
=
zipOpenNewFileInZip3
(
zf
,
filenameinzip
,
&
zi
,
NULL
,
0
,
NULL
,
0
,
NULL
/* comment*/
,
NULL
,
0
,
NULL
,
0
,
NULL
/* comment*/
,
(
opt_compress_level
!=
0
)
?
Z_DEFLATED
:
0
,
(
opt_compress_level
!=
0
)
?
Z_DEFLATED
:
0
,
opt_compress_level
,
0
,
opt_compress_level
,
0
,
-
MAX_WBITS
,
DEF_MEM_LEVEL
,
Z_DEFAULT_STRATEGY
,
-
MAX_WBITS
,
DEF_MEM_LEVEL
,
Z_DEFAULT_STRATEGY
,
password
,
crcFile
);
password
,
crcFile
);
if
(
err
!=
ZIP_OK
)
if
(
err
!=
ZIP_OK
)
printf
(
"error in opening %s in zipfile
\n
"
,
filenameinzip
);
printf
(
"error in opening %s in zipfile
\n
"
,
filenameinzip
);
else
else
{
{
fin
=
fopen
(
filenameinzip
,
"rb"
);
fin
=
fopen
(
filenameinzip
,
"rb"
);
if
(
fin
==
NULL
)
if
(
fin
==
NULL
)
{
{
err
=
ZIP_ERRNO
;
err
=
ZIP_ERRNO
;
printf
(
"error in opening %s for reading
\n
"
,
filenameinzip
);
printf
(
"error in opening %s for reading
\n
"
,
filenameinzip
);
}
}
}
}
if
(
err
==
ZIP_OK
)
if
(
err
==
ZIP_OK
)
do
do
{
{
err
=
ZIP_OK
;
err
=
ZIP_OK
;
size_read
=
(
int
)
fread
(
buf
,
1
,
size_buf
,
fin
);
size_read
=
(
int
)
fread
(
buf
,
1
,
size_buf
,
fin
);
if
(
size_read
<
size_buf
)
if
(
size_read
<
size_buf
)
if
(
feof
(
fin
)
==
0
)
if
(
feof
(
fin
)
==
0
)
{
{
printf
(
"error in reading %s
\n
"
,
filenameinzip
);
printf
(
"error in reading %s
\n
"
,
filenameinzip
);
err
=
ZIP_ERRNO
;
err
=
ZIP_ERRNO
;
}
}
if
(
size_read
>
0
)
if
(
size_read
>
0
)
{
{
err
=
zipWriteInFileInZip
(
zf
,
buf
,
size_read
);
err
=
zipWriteInFileInZip
(
zf
,
buf
,
size_read
);
if
(
err
<
0
)
if
(
err
<
0
)
{
{
printf
(
"error in writing %s in the zipfile
\n
"
,
printf
(
"error in writing %s in the zipfile
\n
"
,
filenameinzip
);
filenameinzip
);
}
}
}
}
}
while
(
(
err
==
ZIP_OK
)
&&
(
size_read
>
0
)
);
}
while
((
err
==
ZIP_OK
)
&&
(
size_read
>
0
));
if
(
fin
)
if
(
fin
)
fclose
(
fin
);
fclose
(
fin
);
if
(
err
<
0
)
err
=
ZIP_ERRNO
;
if
(
err
<
0
)
else
err
=
ZIP_ERRNO
;
{
else
err
=
zipCloseFileInZip
(
zf
);
{
if
(
err
!=
ZIP_OK
)
err
=
zipCloseFileInZip
(
zf
);
printf
(
"error in closing %s in the zipfile
\n
"
,
if
(
err
!=
ZIP_OK
)
filenameinzip
);
printf
(
"error in closing %s in the zipfile
\n
"
,
}
filenameinzip
);
}
}
}
}
errclose
=
zipClose
(
zf
,
NULL
);
}
if
(
errclose
!=
ZIP_OK
)
printf
(
"error in closing %s
\n
"
,
filename_try
);
errclose
=
zipClose
(
zf
,
NULL
);
}
if
(
errclose
!=
ZIP_OK
)
printf
(
"error in closing %s
\n
"
,
filename_try
);
free
(
buf
);
}
return
0
;
free
(
buf
);
return
0
;
}
}
pcbnew/build_BOM_from_board.cpp
View file @
ce4d22f0
...
@@ -90,7 +90,7 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
...
@@ -90,7 +90,7 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
msg
<<
_
(
"Number"
)
<<
wxT
(
"
\"
;
\"
"
);
msg
<<
_
(
"Number"
)
<<
wxT
(
"
\"
;
\"
"
);
msg
<<
_
(
"Designation"
)
<<
wxT
(
"
\"
;
\"
"
);
msg
<<
_
(
"Designation"
)
<<
wxT
(
"
\"
;
\"
"
);
msg
<<
_
(
"Supplier and ref"
)
<<
wxT
(
"
\"
;
\n
"
);
msg
<<
_
(
"Supplier and ref"
)
<<
wxT
(
"
\"
;
\n
"
);
fprintf
(
FichBom
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
FichBom
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
// Build list
// Build list
CmpList
list
;
CmpList
list
;
...
@@ -142,7 +142,7 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
...
@@ -142,7 +142,7 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
msg
<<
current
->
m_Pkg
<<
wxT
(
"
\"
;"
);
msg
<<
current
->
m_Pkg
<<
wxT
(
"
\"
;"
);
msg
<<
current
->
m_CmpCount
<<
wxT
(
";
\"
"
);
msg
<<
current
->
m_CmpCount
<<
wxT
(
";
\"
"
);
msg
<<
current
->
m_Val
<<
wxT
(
"
\"
;;;
\n
"
);
msg
<<
current
->
m_Val
<<
wxT
(
"
\"
;;;
\n
"
);
fprintf
(
FichBom
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
FichBom
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
list
.
DeleteObject
(
current
);
list
.
DeleteObject
(
current
);
delete
(
current
);
delete
(
current
);
...
...
pcbnew/class_module.cpp
View file @
ce4d22f0
...
@@ -365,19 +365,19 @@ int MODULE::Write_3D_Descr( FILE* File ) const
...
@@ -365,19 +365,19 @@ int MODULE::Write_3D_Descr( FILE* File ) const
t3D
->
m_MatScale
.
x
,
t3D
->
m_MatScale
.
x
,
t3D
->
m_MatScale
.
y
,
t3D
->
m_MatScale
.
y
,
t3D
->
m_MatScale
.
z
);
t3D
->
m_MatScale
.
z
);
fprintf
(
File
,
to_point
(
buf
)
);
fprintf
(
File
,
"%s"
,
to_point
(
buf
)
);
sprintf
(
buf
,
"Of %lf %lf %lf
\n
"
,
sprintf
(
buf
,
"Of %lf %lf %lf
\n
"
,
t3D
->
m_MatPosition
.
x
,
t3D
->
m_MatPosition
.
x
,
t3D
->
m_MatPosition
.
y
,
t3D
->
m_MatPosition
.
y
,
t3D
->
m_MatPosition
.
z
);
t3D
->
m_MatPosition
.
z
);
fprintf
(
File
,
to_point
(
buf
)
);
fprintf
(
File
,
"%s"
,
to_point
(
buf
)
);
sprintf
(
buf
,
"Ro %lf %lf %lf
\n
"
,
sprintf
(
buf
,
"Ro %lf %lf %lf
\n
"
,
t3D
->
m_MatRotation
.
x
,
t3D
->
m_MatRotation
.
x
,
t3D
->
m_MatRotation
.
y
,
t3D
->
m_MatRotation
.
y
,
t3D
->
m_MatRotation
.
z
);
t3D
->
m_MatRotation
.
z
);
fprintf
(
File
,
to_point
(
buf
)
);
fprintf
(
File
,
"%s"
,
to_point
(
buf
)
);
fprintf
(
File
,
"$EndSHAPE3D
\n
"
);
fprintf
(
File
,
"$EndSHAPE3D
\n
"
);
}
}
...
...
pcbnew/dialog_drc.cpp
View file @
ce4d22f0
...
@@ -523,14 +523,14 @@ void DIALOG_DRC_CONTROL::writeReport( FILE* fp )
...
@@ -523,14 +523,14 @@ void DIALOG_DRC_CONTROL::writeReport( FILE* fp )
fprintf
(
fp
,
"
\n
** Found %d DRC errors **
\n
"
,
count
);
fprintf
(
fp
,
"
\n
** Found %d DRC errors **
\n
"
,
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
fprintf
(
fp
,
m_ClearanceListBox
->
GetItem
(
i
)
->
ShowReport
().
mb_str
(
)
);
fprintf
(
fp
,
"%s"
,
CONV_TO_UTF8
(
m_ClearanceListBox
->
GetItem
(
i
)
->
ShowReport
()
)
);
count
=
m_UnconnectedListBox
->
GetItemCount
();
count
=
m_UnconnectedListBox
->
GetItemCount
();
fprintf
(
fp
,
"
\n
** Found %d unconnected pads **
\n
"
,
count
);
fprintf
(
fp
,
"
\n
** Found %d unconnected pads **
\n
"
,
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
fprintf
(
fp
,
m_UnconnectedListBox
->
GetItem
(
i
)
->
ShowReport
().
mb_str
(
)
);
fprintf
(
fp
,
"%s"
,
CONV_TO_UTF8
(
m_UnconnectedListBox
->
GetItem
(
i
)
->
ShowReport
()
)
);
fprintf
(
fp
,
"
\n
** End of Report **
\n
"
);
fprintf
(
fp
,
"
\n
** End of Report **
\n
"
);
}
}
...
...
pcbnew/ioascii.cpp
View file @
ce4d22f0
...
@@ -524,7 +524,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
...
@@ -524,7 +524,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
fprintf
(
aFile
,
"$SETUP
\n
"
);
fprintf
(
aFile
,
"$SETUP
\n
"
);
sprintf
(
text
,
"InternalUnit %f INCH
\n
"
,
1.0
/
PCB_INTERNAL_UNIT
);
sprintf
(
text
,
"InternalUnit %f INCH
\n
"
,
1.0
/
PCB_INTERNAL_UNIT
);
fprintf
(
aFile
,
text
);
fprintf
(
aFile
,
"%s"
,
text
);
fprintf
(
aFile
,
"ZoneGridSize %d
\n
"
,
g_GridRoutingSize
);
fprintf
(
aFile
,
"ZoneGridSize %d
\n
"
,
g_GridRoutingSize
);
...
...
pcbnew/onrightclick.cpp
View file @
ce4d22f0
...
@@ -881,7 +881,7 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
...
@@ -881,7 +881,7 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_AUTO_WIDTH
,
true
);
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_AUTO_WIDTH
,
true
);
else
else
{
{
if
(
aBoard
->
m_TrackWidthSelector
<
(
int
)
aBoard
->
m_TrackWidthHistory
.
size
()
)
if
(
aBoard
->
m_TrackWidthSelector
<
aBoard
->
m_TrackWidthHistory
.
size
()
)
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_WIDTH1
+
aBoard
->
m_TrackWidthSelector
,
true
);
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_WIDTH1
+
aBoard
->
m_TrackWidthSelector
,
true
);
}
}
...
@@ -899,7 +899,7 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
...
@@ -899,7 +899,7 @@ static wxMenu* Append_Track_Width_List( BOARD * aBoard )
msg
<<
_
(
" (from NetClass)"
);
msg
<<
_
(
" (from NetClass)"
);
trackwidth_menu
->
Append
(
ID_POPUP_PCB_SELECT_VIASIZE1
+
ii
,
msg
,
wxEmptyString
,
true
);
trackwidth_menu
->
Append
(
ID_POPUP_PCB_SELECT_VIASIZE1
+
ii
,
msg
,
wxEmptyString
,
true
);
}
}
if
(
aBoard
->
m_ViaSizeSelector
<
(
int
)
aBoard
->
m_ViaSizeHistory
.
size
()
)
if
(
aBoard
->
m_ViaSizeSelector
<
aBoard
->
m_ViaSizeHistory
.
size
()
)
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_VIASIZE1
+
aBoard
->
m_ViaSizeSelector
,
true
);
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_VIASIZE1
+
aBoard
->
m_ViaSizeSelector
,
true
);
return
trackwidth_menu
;
return
trackwidth_menu
;
...
...
pcbnew/xchgmod.cpp
View file @
ce4d22f0
...
@@ -192,7 +192,7 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference,
...
@@ -192,7 +192,7 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference,
return
1
;
return
1
;
}
}
fgets
(
Line
,
sizeof
(
Line
),
FichCmp
);
(
void
)
fgets
(
Line
,
sizeof
(
Line
),
FichCmp
);
fprintf
(
NewFile
,
"Cmp-Mod V01 Genere par PcbNew le %s
\n
"
,
fprintf
(
NewFile
,
"Cmp-Mod V01 Genere par PcbNew le %s
\n
"
,
DateAndTime
(
Line
)
);
DateAndTime
(
Line
)
);
...
@@ -601,7 +601,7 @@ void WinEDA_PcbFrame::RecreateCmpFileFromBoard( wxCommandEvent& aEvent )
...
@@ -601,7 +601,7 @@ void WinEDA_PcbFrame::RecreateCmpFileFromBoard( wxCommandEvent& aEvent )
return
;
return
;
}
}
fgets
(
Line
,
sizeof
(
Line
),
FichCmp
);
(
void
)
fgets
(
Line
,
sizeof
(
Line
),
FichCmp
);
fprintf
(
FichCmp
,
"Cmp-Mod V01 Genere par PcbNew le %s
\n
"
,
fprintf
(
FichCmp
,
"Cmp-Mod V01 Genere par PcbNew le %s
\n
"
,
DateAndTime
(
Line
)
);
DateAndTime
(
Line
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment