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
5f0679bf
Commit
5f0679bf
authored
Sep 26, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment/doc cleanups
parent
4f7c7eb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
39 deletions
+32
-39
richio.cpp
common/richio.cpp
+3
-3
richio.h
include/richio.h
+19
-26
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+10
-10
No files found.
common/richio.cpp
View file @
5f0679bf
...
...
@@ -40,7 +40,7 @@
int
vprint
(
std
::
string
*
result
,
const
char
*
format
,
va_list
ap
)
static
int
vprint
(
std
::
string
*
result
,
const
char
*
format
,
va_list
ap
)
{
char
msg
[
512
];
size_t
len
=
vsnprintf
(
msg
,
sizeof
(
msg
),
format
,
ap
);
...
...
@@ -67,7 +67,7 @@ int vprint( std::string* result, const char* format, va_list ap )
}
int
strp
rintf
(
std
::
string
*
result
,
const
char
*
format
,
...
)
int
StrP
rintf
(
std
::
string
*
result
,
const
char
*
format
,
...
)
{
va_list
args
;
...
...
@@ -79,7 +79,7 @@ int strprintf( std::string* result, const char* format, ... )
}
std
::
string
strp
rintf
(
const
char
*
format
,
...
)
std
::
string
StrP
rintf
(
const
char
*
format
,
...
)
{
std
::
string
ret
;
va_list
args
;
...
...
include/richio.h
View file @
5f0679bf
...
...
@@ -39,41 +39,34 @@
/**
* Function vprint
* is like vsprintf() but the output is appended to a std::string instead of to a
* character array.
* @param result is the string to append to, previous text is not clear()ed.
* @param format is a printf() style format string.
* @param ap is a va_list argument stack pointer which gives the
* modifying data for the format string.
*/
int
vprint
(
std
::
string
*
result
,
const
char
*
format
,
va_list
ap
);
/**
* Function strprintf
* Function StrPrintf
* is like sprintf() but the output is appended to a std::string instead of to a
* character array.
* @param result is the string to append to, previous text is not clear()ed.
* @param format is a printf() style format string.
* @param ap is a va_list argument stack pointer which gives the
* modifying data for the format string.
*
* @return int - the count of bytes appended to the result string, no terminating nul is included.
* @param aResult is the string to append to, previous text is not clear()ed.
* @param aFormat is a printf() style format string.
* @return int - the count of bytes appended to the result string, no terminating
* nul is included.
*/
int
strprintf
(
std
::
string
*
result
,
const
char
*
format
,
...
);
int
#if defined(__GNUG__)
__attribute__
((
format
(
printf
,
2
,
3
)))
#endif
StrPrintf
(
std
::
string
*
aResult
,
const
char
*
aFormat
,
...
);
/**
* Function
strp
rintf
* Function
StrP
rintf
* is like sprintf() but the output is returned in a std::string instead of to a
* character array.
* @param result is the string to append to, previous text is not clear()ed.
* @param format is a printf() style format string.
* @param ap is a va_list argument stack pointer which gives the
* modifying data for the format string.
* @param aResult is the string to append to, previous text is not clear()ed.
* @param aFormat is a printf() style format string.
* @return std::string - the result of the sprintf().
*/
std
::
string
strprintf
(
const
char
*
format
,
...
);
std
::
string
#if defined(__GNUG__)
__attribute__
((
format
(
printf
,
1
,
2
)))
#endif
StrPrintf
(
const
char
*
format
,
...
);
/**
...
...
pcbnew/kicad_plugin.cpp
View file @
5f0679bf
...
...
@@ -1215,37 +1215,37 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
// Unconnected pad is default net so don't save it.
if
(
!
(
m_ctl
&
CTL_OMIT_NETS
)
&&
aPad
->
GetNet
()
!=
0
)
strp
rintf
(
&
output
,
" (net %d %s)"
,
aPad
->
GetNet
(),
m_out
->
Quotew
(
aPad
->
GetNetname
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (net %d %s)"
,
aPad
->
GetNet
(),
m_out
->
Quotew
(
aPad
->
GetNetname
()
).
c_str
()
);
if
(
aPad
->
GetPadToDieLength
()
!=
0
)
strp
rintf
(
&
output
,
" (die_length %s)"
,
FMT_IU
(
aPad
->
GetPadToDieLength
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (die_length %s)"
,
FMT_IU
(
aPad
->
GetPadToDieLength
()
).
c_str
()
);
if
(
aPad
->
GetLocalSolderMaskMargin
()
!=
0
)
strp
rintf
(
&
output
,
" (solder_mask_margin %s)"
,
FMT_IU
(
aPad
->
GetLocalSolderMaskMargin
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (solder_mask_margin %s)"
,
FMT_IU
(
aPad
->
GetLocalSolderMaskMargin
()
).
c_str
()
);
if
(
aPad
->
GetLocalSolderPasteMargin
()
!=
0
)
strp
rintf
(
&
output
,
" (solder_paste_margin %s)"
,
FMT_IU
(
aPad
->
GetLocalSolderPasteMargin
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (solder_paste_margin %s)"
,
FMT_IU
(
aPad
->
GetLocalSolderPasteMargin
()
).
c_str
()
);
if
(
aPad
->
GetLocalSolderPasteMarginRatio
()
!=
0
)
strp
rintf
(
&
output
,
" (solder_paste_margin_ratio %s)"
,
StrP
rintf
(
&
output
,
" (solder_paste_margin_ratio %s)"
,
Double2Str
(
aPad
->
GetLocalSolderPasteMarginRatio
()
).
c_str
()
);
if
(
aPad
->
GetLocalClearance
()
!=
0
)
strp
rintf
(
&
output
,
" (clearance %s)"
,
FMT_IU
(
aPad
->
GetLocalClearance
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (clearance %s)"
,
FMT_IU
(
aPad
->
GetLocalClearance
()
).
c_str
()
);
if
(
aPad
->
GetZoneConnection
()
!=
UNDEFINED_CONNECTION
)
strp
rintf
(
&
output
,
" (zone_connect %d)"
,
aPad
->
GetZoneConnection
()
);
StrP
rintf
(
&
output
,
" (zone_connect %d)"
,
aPad
->
GetZoneConnection
()
);
if
(
aPad
->
GetThermalWidth
()
!=
0
)
strp
rintf
(
&
output
,
" (thermal_width %s)"
,
FMT_IU
(
aPad
->
GetThermalWidth
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (thermal_width %s)"
,
FMT_IU
(
aPad
->
GetThermalWidth
()
).
c_str
()
);
if
(
aPad
->
GetThermalGap
()
!=
0
)
strp
rintf
(
&
output
,
" (thermal_gap %s)"
,
FMT_IU
(
aPad
->
GetThermalGap
()
).
c_str
()
);
StrP
rintf
(
&
output
,
" (thermal_gap %s)"
,
FMT_IU
(
aPad
->
GetThermalGap
()
).
c_str
()
);
if
(
output
.
size
()
)
{
m_out
->
Print
(
0
,
"
\n
"
);
m_out
->
Print
(
aNestLevel
+
1
,
"%s"
,
output
.
c_str
()
+
1
);
// +1 skips initial space on fir
st element
m_out
->
Print
(
aNestLevel
+
1
,
"%s"
,
output
.
c_str
()
+
1
);
// +1 skips 1st space on 1
st element
}
m_out
->
Print
(
0
,
")
\n
"
);
...
...
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