Merge lp:~p12/kicad/remove-uses-namespace-std into lp:kicad/product
- remove-uses-namespace-std
- Merge into product
Proposed by
Povilas Kanapickas
Status: | Merged |
---|---|
Merge reported by: | Dick Hollenbeck |
Merged at revision: | not available |
Proposed branch: | lp:~p12/kicad/remove-uses-namespace-std |
Merge into: | lp:kicad/product |
Diff against target: |
1780 lines (+184/-244) 47 files modified
CMakeModules/PerformFeatureChecks.cmake (+1/-1) common/geometry/shape_line_chain.cpp (+4/-5) common/gr_basic.cpp (+2/-2) common/tool/tool_event.cpp (+1/-3) common/tool/tool_manager.cpp (+0/-1) eeschema/annotate.cpp (+1/-2) eeschema/component_references_lister.cpp (+1/-1) eeschema/hierarch.cpp (+1/-1) eeschema/sch_bus_entry.cpp (+1/-1) eeschema/sch_bus_entry.h (+1/-1) eeschema/sch_component.cpp (+2/-2) eeschema/sch_component.h (+2/-2) eeschema/sch_junction.cpp (+1/-1) eeschema/sch_junction.h (+1/-1) eeschema/sch_line.cpp (+1/-1) eeschema/sch_line.h (+3/-3) eeschema/sch_no_connect.cpp (+1/-1) eeschema/sch_no_connect.h (+1/-1) eeschema/sch_sheet.cpp (+1/-1) eeschema/sch_sheet.h (+1/-1) eeschema/sch_text.cpp (+1/-1) eeschema/sch_text.h (+1/-1) include/sch_item_struct.h (+4/-7) include/tool/examples/coroutine_example.cpp (+0/-2) include/tool/examples/delegate_example.cpp (+0/-2) kicad/dialogs/dialog_template_selector.h (+1/-1) kicad/project_template.cpp (+4/-6) kicad/project_template.h (+1/-4) new/sch_dir_lib_source.cpp (+0/-3) new/sch_lib_table.cpp (+0/-1) pcbnew/eagle_plugin.cpp (+64/-65) pcbnew/github/github_plugin.cpp (+13/-18) pcbnew/gpcb_plugin.cpp (+8/-11) pcbnew/kicad_plugin.cpp (+1/-4) pcbnew/legacy_plugin.cpp (+13/-16) pcbnew/pcb_parser.cpp (+13/-17) pcbnew/router/pns_line.cpp (+2/-3) pcbnew/router/pns_line_placer.cpp (+1/-3) pcbnew/router/pns_node.cpp (+7/-9) pcbnew/router/pns_optimizer.cpp (+3/-5) pcbnew/router/pns_router.cpp (+5/-7) pcbnew/router/pns_shove.cpp (+2/-4) pcbnew/router/pns_walkaround.cpp (+0/-4) pcbnew/router/router_tool.cpp (+0/-1) polygon/SutherlandHodgmanClipPoly.h (+7/-8) polygon/poly2tri/common/shapes.cc (+6/-7) scripting/kicad.i (+0/-2) |
To merge this branch: | bzr merge lp:~p12/kicad/remove-uses-namespace-std |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
KiCad Lead Developers | Pending | ||
Review via email: mp+197657@code.launchpad.net |
Commit message
Description of the change
Remove uses of using namespace std.
To post a comment you must log in.
Revision history for this message
Dick Hollenbeck (dickelbeck) wrote : | # |
Revision history for this message
Dick Hollenbeck (dickelbeck) wrote : | # |
The negotiated result was that we are to add these lines to the Coding Standards document:
The project should never use 'using namespace ...' in a header file, but using
it in a *.cpp file is OK, according to the author of the *.cpp file's preference.
If it occurs in a *.cpp file, it must occur after any #include statements.
(Wayne agreed to do that.)
Then I consulted authors/developers who have made use of 'using namespace' in *.cpp files, which is still legal, to find out what they were willing to give up. The applied patch is a result of this process, and it is a subset of the original request.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeModules/PerformFeatureChecks.cmake' | |||
2 | --- CMakeModules/PerformFeatureChecks.cmake 2013-10-03 22:53:42 +0000 | |||
3 | +++ CMakeModules/PerformFeatureChecks.cmake 2013-12-04 08:51:30 +0000 | |||
4 | @@ -92,7 +92,7 @@ | |||
5 | 92 | 92 | ||
6 | 93 | # CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a | 93 | # CMakes check_cxx_symbol_exists() doesn't work for templates so we must create a |
7 | 94 | # small program to verify isinf() exists in cmath. | 94 | # small program to verify isinf() exists in cmath. |
9 | 95 | check_cxx_source_compiles( "#include <cmath>\nusing namespace std;\nint main(int argc, char** argv)\n{\n (void)argv;\n isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF ) | 95 | check_cxx_source_compiles( "#include <cmath>\nint main(int argc, char** argv)\n{\n (void)argv;\n std::isinf(1.0); (void)argc;\n return 0;\n}\n" HAVE_CMATH_ISINF ) |
10 | 96 | 96 | ||
11 | 97 | #check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) non-standard library, does not work | 97 | #check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) non-standard library, does not work |
12 | 98 | check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME) | 98 | check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME) |
13 | 99 | 99 | ||
14 | === modified file 'common/geometry/shape_line_chain.cpp' | |||
15 | --- common/geometry/shape_line_chain.cpp 2013-10-14 18:40:36 +0000 | |||
16 | +++ common/geometry/shape_line_chain.cpp 2013-12-04 08:51:30 +0000 | |||
17 | @@ -25,7 +25,6 @@ | |||
18 | 25 | #include <geometry/shape_line_chain.h> | 25 | #include <geometry/shape_line_chain.h> |
19 | 26 | #include <geometry/shape_circle.h> | 26 | #include <geometry/shape_circle.h> |
20 | 27 | 27 | ||
21 | 28 | using namespace std; | ||
22 | 29 | using boost::optional; | 28 | using boost::optional; |
23 | 30 | 29 | ||
24 | 31 | bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const | 30 | bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const |
25 | @@ -137,7 +136,7 @@ | |||
26 | 137 | int d = INT_MAX; | 136 | int d = INT_MAX; |
27 | 138 | 137 | ||
28 | 139 | for( int s = 0; s < SegmentCount(); s++ ) | 138 | for( int s = 0; s < SegmentCount(); s++ ) |
30 | 140 | d = min( d, CSegment( s ).Distance( aP ) ); | 139 | d = std::min( d, CSegment( s ).Distance( aP ) ); |
31 | 141 | 140 | ||
32 | 142 | return d; | 141 | return d; |
33 | 143 | } | 142 | } |
34 | @@ -437,7 +436,7 @@ | |||
35 | 437 | 436 | ||
36 | 438 | SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify() | 437 | SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify() |
37 | 439 | { | 438 | { |
39 | 440 | vector<VECTOR2I> pts_unique; | 439 | std::vector<VECTOR2I> pts_unique; |
40 | 441 | 440 | ||
41 | 442 | if( PointCount() < 2 ) | 441 | if( PointCount() < 2 ) |
42 | 443 | { | 442 | { |
43 | @@ -524,9 +523,9 @@ | |||
44 | 524 | } | 523 | } |
45 | 525 | 524 | ||
46 | 526 | 525 | ||
48 | 527 | const string SHAPE_LINE_CHAIN::Format() const | 526 | const std::string SHAPE_LINE_CHAIN::Format() const |
49 | 528 | { | 527 | { |
51 | 529 | stringstream ss; | 528 | std::stringstream ss; |
52 | 530 | 529 | ||
53 | 531 | ss << m_points.size() << " " << ( m_closed ? 1 : 0 ) << " "; | 530 | ss << m_points.size() << " " << ( m_closed ? 1 : 0 ) << " "; |
54 | 532 | 531 | ||
55 | 533 | 532 | ||
56 | === modified file 'common/gr_basic.cpp' | |||
57 | --- common/gr_basic.cpp 2013-09-11 09:11:27 +0000 | |||
58 | +++ common/gr_basic.cpp 2013-12-04 08:51:30 +0000 | |||
59 | @@ -1358,8 +1358,8 @@ | |||
60 | 1358 | } | 1358 | } |
61 | 1359 | 1359 | ||
62 | 1360 | // A clip box exists: clip and draw the polygon. | 1360 | // A clip box exists: clip and draw the polygon. |
65 | 1361 | static vector<wxPoint> clippedPolygon; | 1361 | static std::vector<wxPoint> clippedPolygon; |
66 | 1362 | static pointVector inputPolygon, outputPolygon; | 1362 | static pointVector inputPolygon, outputPolygon; |
67 | 1363 | 1363 | ||
68 | 1364 | inputPolygon.clear(); | 1364 | inputPolygon.clear(); |
69 | 1365 | outputPolygon.clear(); | 1365 | outputPolygon.clear(); |
70 | 1366 | 1366 | ||
71 | === modified file 'common/tool/tool_event.cpp' | |||
72 | --- common/tool/tool_event.cpp 2013-10-15 08:41:00 +0000 | |||
73 | +++ common/tool/tool_event.cpp 2013-12-04 08:51:30 +0000 | |||
74 | @@ -31,8 +31,6 @@ | |||
75 | 31 | 31 | ||
76 | 32 | #include <boost/foreach.hpp> | 32 | #include <boost/foreach.hpp> |
77 | 33 | 33 | ||
78 | 34 | using namespace std; | ||
79 | 35 | |||
80 | 36 | struct FlagString | 34 | struct FlagString |
81 | 37 | { | 35 | { |
82 | 38 | int flag; | 36 | int flag; |
83 | @@ -153,7 +151,7 @@ | |||
84 | 153 | 151 | ||
85 | 154 | const std::string TOOL_EVENT_LIST::Format() const | 152 | const std::string TOOL_EVENT_LIST::Format() const |
86 | 155 | { | 153 | { |
88 | 156 | string s; | 154 | std::string s; |
89 | 157 | 155 | ||
90 | 158 | BOOST_FOREACH( TOOL_EVENT e, m_events ) | 156 | BOOST_FOREACH( TOOL_EVENT e, m_events ) |
91 | 159 | s += e.Format() + " "; | 157 | s += e.Format() + " "; |
92 | 160 | 158 | ||
93 | === modified file 'common/tool/tool_manager.cpp' | |||
94 | --- common/tool/tool_manager.cpp 2013-11-13 19:59:47 +0000 | |||
95 | +++ common/tool/tool_manager.cpp 2013-12-04 08:51:30 +0000 | |||
96 | @@ -47,7 +47,6 @@ | |||
97 | 47 | #include <class_drawpanel_gal.h> | 47 | #include <class_drawpanel_gal.h> |
98 | 48 | 48 | ||
99 | 49 | using boost::optional; | 49 | using boost::optional; |
100 | 50 | using namespace std; | ||
101 | 51 | 50 | ||
102 | 52 | /// Struct describing the current execution state of a TOOL | 51 | /// Struct describing the current execution state of a TOOL |
103 | 53 | struct TOOL_MANAGER::TOOL_STATE | 52 | struct TOOL_MANAGER::TOOL_STATE |
104 | 54 | 53 | ||
105 | === modified file 'eeschema/annotate.cpp' | |||
106 | --- eeschema/annotate.cpp 2013-07-03 07:27:52 +0000 | |||
107 | +++ eeschema/annotate.cpp 2013-12-04 08:51:30 +0000 | |||
108 | @@ -26,8 +26,7 @@ | |||
109 | 26 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA | 26 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
110 | 27 | */ | 27 | */ |
111 | 28 | 28 | ||
114 | 29 | #include <algorithm> // to use sort vector | 29 | #include <algorithm> |
113 | 30 | #include <vector> | ||
115 | 31 | 30 | ||
116 | 32 | #include <fctsys.h> | 31 | #include <fctsys.h> |
117 | 33 | #include <class_drawpanel.h> | 32 | #include <class_drawpanel.h> |
118 | 34 | 33 | ||
119 | === modified file 'eeschema/component_references_lister.cpp' | |||
120 | --- eeschema/component_references_lister.cpp 2013-06-14 14:59:52 +0000 | |||
121 | +++ eeschema/component_references_lister.cpp 2013-12-04 08:51:30 +0000 | |||
122 | @@ -30,7 +30,7 @@ | |||
123 | 30 | 30 | ||
124 | 31 | 31 | ||
125 | 32 | #include <wx/regex.h> | 32 | #include <wx/regex.h> |
127 | 33 | #include <algorithm> // to use sort vector | 33 | #include <algorithm> |
128 | 34 | #include <vector> | 34 | #include <vector> |
129 | 35 | 35 | ||
130 | 36 | #include <fctsys.h> | 36 | #include <fctsys.h> |
131 | 37 | 37 | ||
132 | === modified file 'eeschema/hierarch.cpp' | |||
133 | --- eeschema/hierarch.cpp 2013-11-15 09:28:31 +0000 | |||
134 | +++ eeschema/hierarch.cpp 2013-12-04 08:51:30 +0000 | |||
135 | @@ -169,7 +169,7 @@ | |||
136 | 169 | 169 | ||
137 | 170 | // Set dialog window size to be large enough | 170 | // Set dialog window size to be large enough |
138 | 171 | m_TreeSize.x = itemrect.GetWidth() + 20; | 171 | m_TreeSize.x = itemrect.GetWidth() + 20; |
140 | 172 | m_TreeSize.x = max( m_TreeSize.x, 250 ); | 172 | m_TreeSize.x = std::max( m_TreeSize.x, 250 ); |
141 | 173 | 173 | ||
142 | 174 | // Readjust the size of the frame to an optimal value. | 174 | // Readjust the size of the frame to an optimal value. |
143 | 175 | m_TreeSize.y = m_nbsheets * itemrect.GetHeight(); | 175 | m_TreeSize.y = m_nbsheets * itemrect.GetHeight(); |
144 | 176 | 176 | ||
145 | === modified file 'eeschema/sch_bus_entry.cpp' | |||
146 | --- eeschema/sch_bus_entry.cpp 2013-11-24 17:48:14 +0000 | |||
147 | +++ eeschema/sch_bus_entry.cpp 2013-12-04 08:51:30 +0000 | |||
148 | @@ -246,7 +246,7 @@ | |||
149 | 246 | } | 246 | } |
150 | 247 | 247 | ||
151 | 248 | 248 | ||
153 | 249 | void SCH_BUS_ENTRY_BASE::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 249 | void SCH_BUS_ENTRY_BASE::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
154 | 250 | { | 250 | { |
155 | 251 | aPoints.push_back( m_pos ); | 251 | aPoints.push_back( m_pos ); |
156 | 252 | aPoints.push_back( m_End() ); | 252 | aPoints.push_back( m_End() ); |
157 | 253 | 253 | ||
158 | === modified file 'eeschema/sch_bus_entry.h' | |||
159 | --- eeschema/sch_bus_entry.h 2013-11-24 17:48:14 +0000 | |||
160 | +++ eeschema/sch_bus_entry.h 2013-12-04 08:51:30 +0000 | |||
161 | @@ -96,7 +96,7 @@ | |||
162 | 96 | 96 | ||
163 | 97 | bool IsConnectable() const { return true; } | 97 | bool IsConnectable() const { return true; } |
164 | 98 | 98 | ||
166 | 99 | void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 99 | void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const; |
167 | 100 | 100 | ||
168 | 101 | BITMAP_DEF GetMenuImage() const { return add_entry_xpm; } | 101 | BITMAP_DEF GetMenuImage() const { return add_entry_xpm; } |
169 | 102 | 102 | ||
170 | 103 | 103 | ||
171 | === modified file 'eeschema/sch_component.cpp' | |||
172 | --- eeschema/sch_component.cpp 2013-11-26 09:15:20 +0000 | |||
173 | +++ eeschema/sch_component.cpp 2013-12-04 08:51:30 +0000 | |||
174 | @@ -1605,7 +1605,7 @@ | |||
175 | 1605 | } | 1605 | } |
176 | 1606 | 1606 | ||
177 | 1607 | 1607 | ||
179 | 1608 | void SCH_COMPONENT::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 1608 | void SCH_COMPONENT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
180 | 1609 | { | 1609 | { |
181 | 1610 | LIB_PIN* pin; | 1610 | LIB_PIN* pin; |
182 | 1611 | LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName ); | 1611 | LIB_COMPONENT* component = CMP_LIBRARY::FindLibraryComponent( m_ChipName ); |
183 | @@ -1876,7 +1876,7 @@ | |||
184 | 1876 | 1876 | ||
185 | 1877 | bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const | 1877 | bool SCH_COMPONENT::doIsConnected( const wxPoint& aPosition ) const |
186 | 1878 | { | 1878 | { |
188 | 1879 | vector< wxPoint > pts; | 1879 | std::vector< wxPoint > pts; |
189 | 1880 | 1880 | ||
190 | 1881 | GetConnectionPoints( pts ); | 1881 | GetConnectionPoints( pts ); |
191 | 1882 | 1882 | ||
192 | 1883 | 1883 | ||
193 | === modified file 'eeschema/sch_component.h' | |||
194 | --- eeschema/sch_component.h 2013-11-24 17:48:14 +0000 | |||
195 | +++ eeschema/sch_component.h 2013-12-04 08:51:30 +0000 | |||
196 | @@ -357,7 +357,7 @@ | |||
197 | 357 | 357 | ||
198 | 358 | bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ); | 358 | bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation ); |
199 | 359 | 359 | ||
201 | 360 | void GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList ); | 360 | void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ); |
202 | 361 | 361 | ||
203 | 362 | wxPoint GetPinPhysicalPosition( LIB_PIN* Pin ); | 362 | wxPoint GetPinPhysicalPosition( LIB_PIN* Pin ); |
204 | 363 | 363 | ||
205 | @@ -372,7 +372,7 @@ | |||
206 | 372 | */ | 372 | */ |
207 | 373 | bool IsInNetlist() const; | 373 | bool IsInNetlist() const; |
208 | 374 | 374 | ||
210 | 375 | void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 375 | void GetConnectionPoints( std::vector<wxPoint>& aPoints ) const; |
211 | 376 | 376 | ||
212 | 377 | SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, | 377 | SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, |
213 | 378 | const KICAD_T scanTypes[] ); | 378 | const KICAD_T scanTypes[] ); |
214 | 379 | 379 | ||
215 | === modified file 'eeschema/sch_junction.cpp' | |||
216 | --- eeschema/sch_junction.cpp 2013-11-24 17:48:14 +0000 | |||
217 | +++ eeschema/sch_junction.cpp 2013-12-04 08:51:30 +0000 | |||
218 | @@ -168,7 +168,7 @@ | |||
219 | 168 | } | 168 | } |
220 | 169 | 169 | ||
221 | 170 | 170 | ||
223 | 171 | void SCH_JUNCTION::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 171 | void SCH_JUNCTION::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
224 | 172 | { | 172 | { |
225 | 173 | aPoints.push_back( m_pos ); | 173 | aPoints.push_back( m_pos ); |
226 | 174 | } | 174 | } |
227 | 175 | 175 | ||
228 | === modified file 'eeschema/sch_junction.h' | |||
229 | --- eeschema/sch_junction.h 2013-11-24 17:48:14 +0000 | |||
230 | +++ eeschema/sch_junction.h 2013-12-04 08:51:30 +0000 | |||
231 | @@ -81,7 +81,7 @@ | |||
232 | 81 | 81 | ||
233 | 82 | bool IsConnectable() const { return true; } | 82 | bool IsConnectable() const { return true; } |
234 | 83 | 83 | ||
236 | 84 | void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 84 | void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const; |
237 | 85 | 85 | ||
238 | 86 | wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); } | 86 | wxString GetSelectMenuText() const { return wxString( _( "Junction" ) ); } |
239 | 87 | 87 | ||
240 | 88 | 88 | ||
241 | === modified file 'eeschema/sch_line.cpp' | |||
242 | --- eeschema/sch_line.cpp 2013-11-24 17:48:14 +0000 | |||
243 | +++ eeschema/sch_line.cpp 2013-12-04 08:51:30 +0000 | |||
244 | @@ -461,7 +461,7 @@ | |||
245 | 461 | } | 461 | } |
246 | 462 | 462 | ||
247 | 463 | 463 | ||
249 | 464 | void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 464 | void SCH_LINE::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
250 | 465 | { | 465 | { |
251 | 466 | aPoints.push_back( m_start ); | 466 | aPoints.push_back( m_start ); |
252 | 467 | aPoints.push_back( m_end ); | 467 | aPoints.push_back( m_end ); |
253 | 468 | 468 | ||
254 | === modified file 'eeschema/sch_line.h' | |||
255 | --- eeschema/sch_line.h 2013-11-24 17:48:14 +0000 | |||
256 | +++ eeschema/sch_line.h 2013-12-04 08:51:30 +0000 | |||
257 | @@ -113,9 +113,9 @@ | |||
258 | 113 | */ | 113 | */ |
259 | 114 | bool MergeOverlap( SCH_LINE* aLine ); | 114 | bool MergeOverlap( SCH_LINE* aLine ); |
260 | 115 | 115 | ||
262 | 116 | void GetEndPoints( vector <DANGLING_END_ITEM>& aItemList ); | 116 | void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ); |
263 | 117 | 117 | ||
265 | 118 | bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ); | 118 | bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ); |
266 | 119 | 119 | ||
267 | 120 | bool IsDangling() const { return m_startIsDangling || m_endIsDangling; } | 120 | bool IsDangling() const { return m_startIsDangling || m_endIsDangling; } |
268 | 121 | 121 | ||
269 | @@ -123,7 +123,7 @@ | |||
270 | 123 | 123 | ||
271 | 124 | bool IsConnectable() const; | 124 | bool IsConnectable() const; |
272 | 125 | 125 | ||
274 | 126 | void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 126 | void GetConnectionPoints(std::vector< wxPoint >& aPoints ) const; |
275 | 127 | 127 | ||
276 | 128 | wxString GetSelectMenuText() const; | 128 | wxString GetSelectMenuText() const; |
277 | 129 | 129 | ||
278 | 130 | 130 | ||
279 | === modified file 'eeschema/sch_no_connect.cpp' | |||
280 | --- eeschema/sch_no_connect.cpp 2013-11-24 17:48:14 +0000 | |||
281 | +++ eeschema/sch_no_connect.cpp 2013-12-04 08:51:30 +0000 | |||
282 | @@ -182,7 +182,7 @@ | |||
283 | 182 | } | 182 | } |
284 | 183 | 183 | ||
285 | 184 | 184 | ||
287 | 185 | void SCH_NO_CONNECT::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 185 | void SCH_NO_CONNECT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
288 | 186 | { | 186 | { |
289 | 187 | aPoints.push_back( m_pos ); | 187 | aPoints.push_back( m_pos ); |
290 | 188 | } | 188 | } |
291 | 189 | 189 | ||
292 | === modified file 'eeschema/sch_no_connect.h' | |||
293 | --- eeschema/sch_no_connect.h 2013-11-24 17:48:14 +0000 | |||
294 | +++ eeschema/sch_no_connect.h 2013-12-04 08:51:30 +0000 | |||
295 | @@ -81,7 +81,7 @@ | |||
296 | 81 | 81 | ||
297 | 82 | bool IsConnectable() const { return true; } | 82 | bool IsConnectable() const { return true; } |
298 | 83 | 83 | ||
300 | 84 | void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 84 | void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const; |
301 | 85 | 85 | ||
302 | 86 | wxString GetSelectMenuText() const { return wxString( _( "No Connect" ) ); } | 86 | wxString GetSelectMenuText() const { return wxString( _( "No Connect" ) ); } |
303 | 87 | 87 | ||
304 | 88 | 88 | ||
305 | === modified file 'eeschema/sch_sheet.cpp' | |||
306 | --- eeschema/sch_sheet.cpp 2013-11-24 17:48:14 +0000 | |||
307 | +++ eeschema/sch_sheet.cpp 2013-12-04 08:51:30 +0000 | |||
308 | @@ -1000,7 +1000,7 @@ | |||
309 | 1000 | } | 1000 | } |
310 | 1001 | 1001 | ||
311 | 1002 | 1002 | ||
313 | 1003 | void SCH_SHEET::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 1003 | void SCH_SHEET::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
314 | 1004 | { | 1004 | { |
315 | 1005 | for( size_t i = 0; i < GetPins().size(); i++ ) | 1005 | for( size_t i = 0; i < GetPins().size(); i++ ) |
316 | 1006 | aPoints.push_back( GetPins()[i].GetPosition() ); | 1006 | aPoints.push_back( GetPins()[i].GetPosition() ); |
317 | 1007 | 1007 | ||
318 | === modified file 'eeschema/sch_sheet.h' | |||
319 | --- eeschema/sch_sheet.h 2013-11-24 17:48:14 +0000 | |||
320 | +++ eeschema/sch_sheet.h 2013-12-04 08:51:30 +0000 | |||
321 | @@ -533,7 +533,7 @@ | |||
322 | 533 | 533 | ||
323 | 534 | bool IsConnectable() const { return true; } | 534 | bool IsConnectable() const { return true; } |
324 | 535 | 535 | ||
326 | 536 | void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 536 | void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const; |
327 | 537 | 537 | ||
328 | 538 | SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, | 538 | SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, |
329 | 539 | const KICAD_T scanTypes[] ); | 539 | const KICAD_T scanTypes[] ); |
330 | 540 | 540 | ||
331 | === modified file 'eeschema/sch_text.cpp' | |||
332 | --- eeschema/sch_text.cpp 2013-11-29 08:13:43 +0000 | |||
333 | +++ eeschema/sch_text.cpp 2013-12-04 08:51:30 +0000 | |||
334 | @@ -564,7 +564,7 @@ | |||
335 | 564 | } | 564 | } |
336 | 565 | 565 | ||
337 | 566 | 566 | ||
339 | 567 | void SCH_TEXT::GetConnectionPoints( vector< wxPoint >& aPoints ) const | 567 | void SCH_TEXT::GetConnectionPoints( std::vector< wxPoint >& aPoints ) const |
340 | 568 | { | 568 | { |
341 | 569 | // Normal text labels do not have connection points. All others do. | 569 | // Normal text labels do not have connection points. All others do. |
342 | 570 | if( Type() == SCH_TEXT_T ) | 570 | if( Type() == SCH_TEXT_T ) |
343 | 571 | 571 | ||
344 | === modified file 'eeschema/sch_text.h' | |||
345 | --- eeschema/sch_text.h 2013-11-24 17:48:14 +0000 | |||
346 | +++ eeschema/sch_text.h 2013-12-04 08:51:30 +0000 | |||
347 | @@ -189,7 +189,7 @@ | |||
348 | 189 | 189 | ||
349 | 190 | virtual bool IsSelectStateChanged( const wxRect& aRect ); | 190 | virtual bool IsSelectStateChanged( const wxRect& aRect ); |
350 | 191 | 191 | ||
352 | 192 | virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const; | 192 | virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const; |
353 | 193 | 193 | ||
354 | 194 | virtual bool CanIncrementLabel() const { return true; } | 194 | virtual bool CanIncrementLabel() const { return true; } |
355 | 195 | 195 | ||
356 | 196 | 196 | ||
357 | === modified file 'include/sch_item_struct.h' | |||
358 | --- include/sch_item_struct.h 2013-10-27 18:21:53 +0000 | |||
359 | +++ include/sch_item_struct.h 2013-12-04 08:51:30 +0000 | |||
360 | @@ -34,9 +34,6 @@ | |||
361 | 34 | #include <class_base_screen.h> | 34 | #include <class_base_screen.h> |
362 | 35 | #include <general.h> | 35 | #include <general.h> |
363 | 36 | 36 | ||
364 | 37 | using namespace std; | ||
365 | 38 | |||
366 | 39 | |||
367 | 40 | class SCH_ITEM; | 37 | class SCH_ITEM; |
368 | 41 | class SCH_SHEET_PATH; | 38 | class SCH_SHEET_PATH; |
369 | 42 | class LINE_READER; | 39 | class LINE_READER; |
370 | @@ -49,7 +46,7 @@ | |||
371 | 49 | 46 | ||
372 | 50 | typedef boost::ptr_vector< SCH_ITEM > SCH_ITEMS; | 47 | typedef boost::ptr_vector< SCH_ITEM > SCH_ITEMS; |
373 | 51 | typedef SCH_ITEMS::iterator SCH_ITEMS_ITR; | 48 | typedef SCH_ITEMS::iterator SCH_ITEMS_ITR; |
375 | 52 | typedef vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS; | 49 | typedef std::vector< SCH_ITEMS_ITR > SCH_ITEMS_ITRS; |
376 | 53 | 50 | ||
377 | 54 | 51 | ||
378 | 55 | #define FMT_IU SCH_ITEM::FormatInternalUnits | 52 | #define FMT_IU SCH_ITEM::FormatInternalUnits |
379 | @@ -228,7 +225,7 @@ | |||
380 | 228 | * | 225 | * |
381 | 229 | * @param aItemList - List of DANGLING_END_ITEMS to add to. | 226 | * @param aItemList - List of DANGLING_END_ITEMS to add to. |
382 | 230 | */ | 227 | */ |
384 | 231 | virtual void GetEndPoints( vector< DANGLING_END_ITEM >& aItemList ) {} | 228 | virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {} |
385 | 232 | 229 | ||
386 | 233 | /** | 230 | /** |
387 | 234 | * Function IsDanglingStateChanged | 231 | * Function IsDanglingStateChanged |
388 | @@ -243,7 +240,7 @@ | |||
389 | 243 | * @param aItemList - List of items to test item against. | 240 | * @param aItemList - List of items to test item against. |
390 | 244 | * @return True if the dangling state has changed from it's current setting. | 241 | * @return True if the dangling state has changed from it's current setting. |
391 | 245 | */ | 242 | */ |
393 | 246 | virtual bool IsDanglingStateChanged( vector< DANGLING_END_ITEM >& aItemList ) { return false; } | 243 | virtual bool IsDanglingStateChanged( std::vector< DANGLING_END_ITEM >& aItemList ) { return false; } |
394 | 247 | 244 | ||
395 | 248 | virtual bool IsDangling() const { return false; } | 245 | virtual bool IsDangling() const { return false; } |
396 | 249 | 246 | ||
397 | @@ -273,7 +270,7 @@ | |||
398 | 273 | * | 270 | * |
399 | 274 | * @param aPoints List of connection points to add to. | 271 | * @param aPoints List of connection points to add to. |
400 | 275 | */ | 272 | */ |
402 | 276 | virtual void GetConnectionPoints( vector< wxPoint >& aPoints ) const { } | 273 | virtual void GetConnectionPoints( std::vector< wxPoint >& aPoints ) const { } |
403 | 277 | 274 | ||
404 | 278 | /** | 275 | /** |
405 | 279 | * Function ClearConnections | 276 | * Function ClearConnections |
406 | 280 | 277 | ||
407 | === modified file 'include/tool/examples/coroutine_example.cpp' | |||
408 | --- include/tool/examples/coroutine_example.cpp 2013-10-14 14:13:35 +0000 | |||
409 | +++ include/tool/examples/coroutine_example.cpp 2013-12-04 08:51:30 +0000 | |||
410 | @@ -3,8 +3,6 @@ | |||
411 | 3 | 3 | ||
412 | 4 | #include <tool/coroutine.h> | 4 | #include <tool/coroutine.h> |
413 | 5 | 5 | ||
414 | 6 | using namespace std; | ||
415 | 7 | |||
416 | 8 | typedef COROUTINE<int, int> MyCoroutine; | 6 | typedef COROUTINE<int, int> MyCoroutine; |
417 | 9 | 7 | ||
418 | 10 | class MyClass | 8 | class MyClass |
419 | 11 | 9 | ||
420 | === modified file 'include/tool/examples/delegate_example.cpp' | |||
421 | --- include/tool/examples/delegate_example.cpp 2013-10-14 14:13:35 +0000 | |||
422 | +++ include/tool/examples/delegate_example.cpp 2013-12-04 08:51:30 +0000 | |||
423 | @@ -3,8 +3,6 @@ | |||
424 | 3 | 3 | ||
425 | 4 | #include <tool/delegate.h> | 4 | #include <tool/delegate.h> |
426 | 5 | 5 | ||
427 | 6 | using namespace std; | ||
428 | 7 | |||
429 | 8 | class MyClass | 6 | class MyClass |
430 | 9 | { | 7 | { |
431 | 10 | public: | 8 | public: |
432 | 11 | 9 | ||
433 | === modified file 'kicad/dialogs/dialog_template_selector.h' | |||
434 | --- kicad/dialogs/dialog_template_selector.h 2013-06-13 16:09:35 +0000 | |||
435 | +++ kicad/dialogs/dialog_template_selector.h 2013-12-04 08:51:30 +0000 | |||
436 | @@ -79,7 +79,7 @@ | |||
437 | 79 | class DIALOG_TEMPLATE_SELECTOR : public DIALOG_TEMPLATE_SELECTOR_BASE | 79 | class DIALOG_TEMPLATE_SELECTOR : public DIALOG_TEMPLATE_SELECTOR_BASE |
438 | 80 | { | 80 | { |
439 | 81 | protected: | 81 | protected: |
441 | 82 | vector<TEMPLATE_SELECTION_PANEL*> m_panels; | 82 | std::vector<TEMPLATE_SELECTION_PANEL*> m_panels; |
442 | 83 | void AddTemplate( int aPage, PROJECT_TEMPLATE* aTemplate ); | 83 | void AddTemplate( int aPage, PROJECT_TEMPLATE* aTemplate ); |
443 | 84 | TEMPLATE_WIDGET* m_selectedWidget; | 84 | TEMPLATE_WIDGET* m_selectedWidget; |
444 | 85 | 85 | ||
445 | 86 | 86 | ||
446 | === modified file 'kicad/project_template.cpp' | |||
447 | --- kicad/project_template.cpp 2013-05-26 04:36:44 +0000 | |||
448 | +++ kicad/project_template.cpp 2013-12-04 08:51:30 +0000 | |||
449 | @@ -33,8 +33,6 @@ | |||
450 | 33 | #include <wx/txtstrm.h> | 33 | #include <wx/txtstrm.h> |
451 | 34 | #include <wx/wfstream.h> | 34 | #include <wx/wfstream.h> |
452 | 35 | 35 | ||
453 | 36 | using namespace std; | ||
454 | 37 | |||
455 | 38 | #define SEP() wxFileName::GetPathSeparator() | 36 | #define SEP() wxFileName::GetPathSeparator() |
456 | 39 | 37 | ||
457 | 40 | 38 | ||
458 | @@ -71,9 +69,9 @@ | |||
459 | 71 | metaIcon = new wxBitmap( templateMetaIconFile.GetFullPath(), wxBITMAP_TYPE_PNG ); | 69 | metaIcon = new wxBitmap( templateMetaIconFile.GetFullPath(), wxBITMAP_TYPE_PNG ); |
460 | 72 | } | 70 | } |
461 | 73 | 71 | ||
463 | 74 | vector<wxFileName> PROJECT_TEMPLATE::GetFileList() | 72 | std::vector<wxFileName> PROJECT_TEMPLATE::GetFileList() |
464 | 75 | { | 73 | { |
466 | 76 | vector<wxFileName> files; | 74 | std::vector<wxFileName> files; |
467 | 77 | wxString f = templateBasePath.GetPath(); | 75 | wxString f = templateBasePath.GetPath(); |
468 | 78 | wxArrayString allfiles; | 76 | wxArrayString allfiles; |
469 | 79 | wxFileName p; | 77 | wxFileName p; |
470 | @@ -122,8 +120,8 @@ | |||
471 | 122 | { | 120 | { |
472 | 123 | bool result = true; | 121 | bool result = true; |
473 | 124 | 122 | ||
476 | 125 | vector<wxFileName> srcFiles = GetFileList(); | 123 | std::vector<wxFileName> srcFiles = GetFileList(); |
477 | 126 | vector<wxFileName> dstFiles; | 124 | std::vector<wxFileName> dstFiles; |
478 | 127 | 125 | ||
479 | 128 | for( size_t i=0; i < srcFiles.size(); i++ ) | 126 | for( size_t i=0; i < srcFiles.size(); i++ ) |
480 | 129 | { | 127 | { |
481 | 130 | 128 | ||
482 | === modified file 'kicad/project_template.h' | |||
483 | --- kicad/project_template.h 2013-06-13 16:09:35 +0000 | |||
484 | +++ kicad/project_template.h 2013-12-04 08:51:30 +0000 | |||
485 | @@ -110,9 +110,6 @@ | |||
486 | 110 | #include <wx/image.h> | 110 | #include <wx/image.h> |
487 | 111 | #include <wx/filename.h> | 111 | #include <wx/filename.h> |
488 | 112 | 112 | ||
489 | 113 | using namespace std; | ||
490 | 114 | |||
491 | 115 | |||
492 | 116 | /** | 113 | /** |
493 | 117 | * @brief A directory which contains information about the project template and does not get | 114 | * @brief A directory which contains information about the project template and does not get |
494 | 118 | * copied. This define is the default filename for this directory | 115 | * copied. This define is the default filename for this directory |
495 | @@ -200,7 +197,7 @@ | |||
496 | 200 | * @brief Get a vector list of filenames for the template. The files are the source files, | 197 | * @brief Get a vector list of filenames for the template. The files are the source files, |
497 | 201 | * and have not yet been through any renaming | 198 | * and have not yet been through any renaming |
498 | 202 | */ | 199 | */ |
500 | 203 | vector<wxFileName> GetFileList(); | 200 | std::vector<wxFileName> GetFileList(); |
501 | 204 | }; | 201 | }; |
502 | 205 | 202 | ||
503 | 206 | #endif | 203 | #endif |
504 | 207 | 204 | ||
505 | === modified file 'new/sch_dir_lib_source.cpp' | |||
506 | --- new/sch_dir_lib_source.cpp 2011-11-04 15:53:37 +0000 | |||
507 | +++ new/sch_dir_lib_source.cpp 2013-12-04 08:51:30 +0000 | |||
508 | @@ -52,9 +52,6 @@ | |||
509 | 52 | #include <errno.h> | 52 | #include <errno.h> |
510 | 53 | #include <assert.h> | 53 | #include <assert.h> |
511 | 54 | 54 | ||
512 | 55 | #include <vector> | ||
513 | 56 | using namespace std; | ||
514 | 57 | |||
515 | 58 | #include <sch_dir_lib_source.h> | 55 | #include <sch_dir_lib_source.h> |
516 | 59 | using namespace SCH; | 56 | using namespace SCH; |
517 | 60 | 57 | ||
518 | 61 | 58 | ||
519 | === modified file 'new/sch_lib_table.cpp' | |||
520 | --- new/sch_lib_table.cpp 2012-11-15 16:04:10 +0000 | |||
521 | +++ new/sch_lib_table.cpp 2013-12-04 08:51:30 +0000 | |||
522 | @@ -31,7 +31,6 @@ | |||
523 | 31 | #include <sch_dir_lib_source.h> | 31 | #include <sch_dir_lib_source.h> |
524 | 32 | 32 | ||
525 | 33 | 33 | ||
526 | 34 | //using namespace std; // screws up Doxygen | ||
527 | 35 | using namespace SCH; | 34 | using namespace SCH; |
528 | 36 | using namespace LT; // tokens, enum T for LIB_TABLE | 35 | using namespace LT; // tokens, enum T for LIB_TABLE |
529 | 37 | 36 | ||
530 | 38 | 37 | ||
531 | === modified file 'pcbnew/eagle_plugin.cpp' | |||
532 | --- pcbnew/eagle_plugin.cpp 2013-11-29 18:29:41 +0000 | |||
533 | +++ pcbnew/eagle_plugin.cpp 2013-12-04 08:51:30 +0000 | |||
534 | @@ -77,7 +77,6 @@ | |||
535 | 77 | #include <class_pcb_text.h> | 77 | #include <class_pcb_text.h> |
536 | 78 | 78 | ||
537 | 79 | using namespace boost::property_tree; | 79 | using namespace boost::property_tree; |
538 | 80 | using namespace std; | ||
539 | 81 | 80 | ||
540 | 82 | typedef EAGLE_PLUGIN::BIU BIU; | 81 | typedef EAGLE_PLUGIN::BIU BIU; |
541 | 83 | typedef PTREE::const_assoc_iterator CA_ITER; | 82 | typedef PTREE::const_assoc_iterator CA_ITER; |
542 | @@ -87,7 +86,7 @@ | |||
543 | 87 | typedef MODULE_MAP::iterator MODULE_ITER; | 86 | typedef MODULE_MAP::iterator MODULE_ITER; |
544 | 88 | typedef MODULE_MAP::const_iterator MODULE_CITER; | 87 | typedef MODULE_MAP::const_iterator MODULE_CITER; |
545 | 89 | 88 | ||
547 | 90 | typedef boost::optional<string> opt_string; | 89 | typedef boost::optional<std::string> opt_string; |
548 | 91 | typedef boost::optional<int> opt_int; | 90 | typedef boost::optional<int> opt_int; |
549 | 92 | typedef boost::optional<double> opt_double; | 91 | typedef boost::optional<double> opt_double; |
550 | 93 | typedef boost::optional<bool> opt_bool; | 92 | typedef boost::optional<bool> opt_bool; |
551 | @@ -151,11 +150,11 @@ | |||
552 | 151 | } | 150 | } |
553 | 152 | 151 | ||
554 | 153 | /// return the contents of the XPATH as a single string | 152 | /// return the contents of the XPATH as a single string |
556 | 154 | string Contents() | 153 | std::string Contents() |
557 | 155 | { | 154 | { |
558 | 156 | typedef std::vector<TRIPLET>::const_iterator CITER; | 155 | typedef std::vector<TRIPLET>::const_iterator CITER; |
559 | 157 | 156 | ||
561 | 158 | string ret; | 157 | std::string ret; |
562 | 159 | 158 | ||
563 | 160 | for( CITER it = p.begin(); it != p.end(); ++it ) | 159 | for( CITER it = p.begin(); it != p.end(); ++it ) |
564 | 161 | { | 160 | { |
565 | @@ -187,7 +186,7 @@ | |||
566 | 187 | static opt_bool parseOptionalBool( CPTREE& attribs, const char* aName ) | 186 | static opt_bool parseOptionalBool( CPTREE& attribs, const char* aName ) |
567 | 188 | { | 187 | { |
568 | 189 | opt_bool ret; | 188 | opt_bool ret; |
570 | 190 | opt_string stemp = attribs.get_optional<string>( aName ); | 189 | opt_string stemp = attribs.get_optional<std::string>( aName ); |
571 | 191 | 190 | ||
572 | 192 | if( stemp ) | 191 | if( stemp ) |
573 | 193 | ret = !stemp->compare( "yes" ); | 192 | ret = !stemp->compare( "yes" ); |
574 | @@ -227,7 +226,7 @@ | |||
575 | 227 | 226 | ||
576 | 228 | /// parse an Eagle XML "rot" field. Unfortunately the DTD seems not to explain | 227 | /// parse an Eagle XML "rot" field. Unfortunately the DTD seems not to explain |
577 | 229 | /// this format very well. [S][M]R<degrees>. Examples: "R90", "MR180", "SR180" | 228 | /// this format very well. [S][M]R<degrees>. Examples: "R90", "MR180", "SR180" |
579 | 230 | static EROT erot( const string& aRot ) | 229 | static EROT erot( const std::string& aRot ) |
580 | 231 | { | 230 | { |
581 | 232 | EROT rot; | 231 | EROT rot; |
582 | 233 | 232 | ||
583 | @@ -245,7 +244,7 @@ | |||
584 | 245 | static opt_erot parseOptionalEROT( CPTREE& attribs ) | 244 | static opt_erot parseOptionalEROT( CPTREE& attribs ) |
585 | 246 | { | 245 | { |
586 | 247 | opt_erot ret; | 246 | opt_erot ret; |
588 | 248 | opt_string stemp = attribs.get_optional<string>( "rot" ); | 247 | opt_string stemp = attribs.get_optional<std::string>( "rot" ); |
589 | 249 | if( stemp ) | 248 | if( stemp ) |
590 | 250 | ret = erot( *stemp ); | 249 | ret = erot( *stemp ); |
591 | 251 | return ret; | 250 | return ret; |
592 | @@ -316,7 +315,7 @@ | |||
593 | 316 | 315 | ||
594 | 317 | curve = attribs.get_optional<double>( "curve" ); | 316 | curve = attribs.get_optional<double>( "curve" ); |
595 | 318 | 317 | ||
597 | 319 | opt_string s = attribs.get_optional<string>( "style" ); | 318 | opt_string s = attribs.get_optional<std::string>( "style" ); |
598 | 320 | if( s ) | 319 | if( s ) |
599 | 321 | { | 320 | { |
600 | 322 | if( !s->compare( "continuous" ) ) | 321 | if( !s->compare( "continuous" ) ) |
601 | @@ -329,7 +328,7 @@ | |||
602 | 329 | style = EWIRE::DASHDOT; | 328 | style = EWIRE::DASHDOT; |
603 | 330 | } | 329 | } |
604 | 331 | 330 | ||
606 | 332 | s = attribs.get_optional<string>( "cap" ); | 331 | s = attribs.get_optional<std::string>( "cap" ); |
607 | 333 | if( s ) | 332 | if( s ) |
608 | 334 | { | 333 | { |
609 | 335 | if( !s->compare( "round" ) ) | 334 | if( !s->compare( "round" ) ) |
610 | @@ -374,13 +373,13 @@ | |||
611 | 374 | x = attribs.get<double>( "x" ); | 373 | x = attribs.get<double>( "x" ); |
612 | 375 | y = attribs.get<double>( "y" ); | 374 | y = attribs.get<double>( "y" ); |
613 | 376 | 375 | ||
615 | 377 | string ext = attribs.get<string>( "extent" ); | 376 | std::string ext = attribs.get<std::string>( "extent" ); |
616 | 378 | 377 | ||
617 | 379 | sscanf( ext.c_str(), "%u-%u", &layer_front_most, &layer_back_most ); | 378 | sscanf( ext.c_str(), "%u-%u", &layer_front_most, &layer_back_most ); |
618 | 380 | 379 | ||
619 | 381 | drill = attribs.get<double>( "drill" ); | 380 | drill = attribs.get<double>( "drill" ); |
620 | 382 | diam = attribs.get_optional<double>( "diameter" ); | 381 | diam = attribs.get_optional<double>( "diameter" ); |
622 | 383 | shape = attribs.get_optional<string>( "shape" ); | 382 | shape = attribs.get_optional<std::string>( "shape" ); |
623 | 384 | } | 383 | } |
624 | 385 | 384 | ||
625 | 386 | 385 | ||
626 | @@ -460,7 +459,7 @@ | |||
627 | 460 | /// Eagle "attribute" XML element, no foolin'. | 459 | /// Eagle "attribute" XML element, no foolin'. |
628 | 461 | struct EATTR | 460 | struct EATTR |
629 | 462 | { | 461 | { |
631 | 463 | string name; | 462 | std::string name; |
632 | 464 | opt_string value; | 463 | opt_string value; |
633 | 465 | opt_double x; | 464 | opt_double x; |
634 | 466 | opt_double y; | 465 | opt_double y; |
635 | @@ -508,8 +507,8 @@ | |||
636 | 508 | > | 507 | > |
637 | 509 | */ | 508 | */ |
638 | 510 | 509 | ||
641 | 511 | name = attribs.get<string>( "name" ); // #REQUIRED | 510 | name = attribs.get<std::string>( "name" ); // #REQUIRED |
642 | 512 | value = attribs.get_optional<string>( "value" ); | 511 | value = attribs.get_optional<std::string>( "value" ); |
643 | 513 | 512 | ||
644 | 514 | x = attribs.get_optional<double>( "x" ); | 513 | x = attribs.get_optional<double>( "x" ); |
645 | 515 | y = attribs.get_optional<double>( "y" ); | 514 | y = attribs.get_optional<double>( "y" ); |
646 | @@ -522,7 +521,7 @@ | |||
647 | 522 | ratio = attribs.get_optional<double>( "ratio" ); | 521 | ratio = attribs.get_optional<double>( "ratio" ); |
648 | 523 | rot = parseOptionalEROT( attribs ); | 522 | rot = parseOptionalEROT( attribs ); |
649 | 524 | 523 | ||
651 | 525 | opt_string stemp = attribs.get_optional<string>( "display" ); | 524 | opt_string stemp = attribs.get_optional<std::string>( "display" ); |
652 | 526 | if( stemp ) | 525 | if( stemp ) |
653 | 527 | { | 526 | { |
654 | 528 | // (off | value | name | both) | 527 | // (off | value | name | both) |
655 | @@ -541,7 +540,7 @@ | |||
656 | 541 | /// Eagle text element | 540 | /// Eagle text element |
657 | 542 | struct ETEXT | 541 | struct ETEXT |
658 | 543 | { | 542 | { |
660 | 544 | string text; | 543 | std::string text; |
661 | 545 | double x; | 544 | double x; |
662 | 546 | double y; | 545 | double y; |
663 | 547 | double size; | 546 | double size; |
664 | @@ -593,11 +592,11 @@ | |||
665 | 593 | size = attribs.get<double>( "size" ); | 592 | size = attribs.get<double>( "size" ); |
666 | 594 | layer = attribs.get<int>( "layer" ); | 593 | layer = attribs.get<int>( "layer" ); |
667 | 595 | 594 | ||
669 | 596 | font = attribs.get_optional<string>( "font" ); | 595 | font = attribs.get_optional<std::string>( "font" ); |
670 | 597 | ratio = attribs.get_optional<double>( "ratio" ); | 596 | ratio = attribs.get_optional<double>( "ratio" ); |
671 | 598 | rot = parseOptionalEROT( attribs ); | 597 | rot = parseOptionalEROT( attribs ); |
672 | 599 | 598 | ||
674 | 600 | opt_string stemp = attribs.get_optional<string>( "align" ); | 599 | opt_string stemp = attribs.get_optional<std::string>( "align" ); |
675 | 601 | if( stemp ) | 600 | if( stemp ) |
676 | 602 | { | 601 | { |
677 | 603 | // (bottom-left | bottom-center | bottom-right | center-left | | 602 | // (bottom-left | bottom-center | bottom-right | center-left | |
678 | @@ -627,7 +626,7 @@ | |||
679 | 627 | /// Eagle thru hol pad | 626 | /// Eagle thru hol pad |
680 | 628 | struct EPAD | 627 | struct EPAD |
681 | 629 | { | 628 | { |
683 | 630 | string name; | 629 | std::string name; |
684 | 631 | double x; | 630 | double x; |
685 | 632 | double y; | 631 | double y; |
686 | 633 | double drill; | 632 | double drill; |
687 | @@ -671,14 +670,14 @@ | |||
688 | 671 | */ | 670 | */ |
689 | 672 | 671 | ||
690 | 673 | // #REQUIRED says DTD, throw exception if not found | 672 | // #REQUIRED says DTD, throw exception if not found |
692 | 674 | name = attribs.get<string>( "name" ); | 673 | name = attribs.get<std::string>( "name" ); |
693 | 675 | x = attribs.get<double>( "x" ); | 674 | x = attribs.get<double>( "x" ); |
694 | 676 | y = attribs.get<double>( "y" ); | 675 | y = attribs.get<double>( "y" ); |
695 | 677 | drill = attribs.get<double>( "drill" ); | 676 | drill = attribs.get<double>( "drill" ); |
696 | 678 | 677 | ||
697 | 679 | diameter = attribs.get_optional<double>( "diameter" ); | 678 | diameter = attribs.get_optional<double>( "diameter" ); |
698 | 680 | 679 | ||
700 | 681 | opt_string s = attribs.get_optional<string>( "shape" ); | 680 | opt_string s = attribs.get_optional<std::string>( "shape" ); |
701 | 682 | if( s ) | 681 | if( s ) |
702 | 683 | { | 682 | { |
703 | 684 | // (square | round | octagon | long | offset) | 683 | // (square | round | octagon | long | offset) |
704 | @@ -704,7 +703,7 @@ | |||
705 | 704 | /// Eagle SMD pad | 703 | /// Eagle SMD pad |
706 | 705 | struct ESMD | 704 | struct ESMD |
707 | 706 | { | 705 | { |
709 | 707 | string name; | 706 | std::string name; |
710 | 708 | double x; | 707 | double x; |
711 | 709 | double y; | 708 | double y; |
712 | 710 | double dx; | 709 | double dx; |
713 | @@ -740,7 +739,7 @@ | |||
714 | 740 | */ | 739 | */ |
715 | 741 | 740 | ||
716 | 742 | // DTD #REQUIRED, throw exception if not found | 741 | // DTD #REQUIRED, throw exception if not found |
718 | 743 | name = attribs.get<string>( "name" ); | 742 | name = attribs.get<std::string>( "name" ); |
719 | 744 | x = attribs.get<double>( "x" ); | 743 | x = attribs.get<double>( "x" ); |
720 | 745 | y = attribs.get<double>( "y" ); | 744 | y = attribs.get<double>( "y" ); |
721 | 746 | dx = attribs.get<double>( "dx" ); | 745 | dx = attribs.get<double>( "dx" ); |
722 | @@ -824,7 +823,7 @@ | |||
723 | 824 | layer = attribs.get<int>( "layer" ); | 823 | layer = attribs.get<int>( "layer" ); |
724 | 825 | spacing = attribs.get_optional<double>( "spacing" ); | 824 | spacing = attribs.get_optional<double>( "spacing" ); |
725 | 826 | 825 | ||
727 | 827 | opt_string s = attribs.get_optional<string>( "pour" ); | 826 | opt_string s = attribs.get_optional<std::string>( "pour" ); |
728 | 828 | if( s ) | 827 | if( s ) |
729 | 829 | { | 828 | { |
730 | 830 | // (solid | hatch | cutout) | 829 | // (solid | hatch | cutout) |
731 | @@ -874,10 +873,10 @@ | |||
732 | 874 | /// Eagle element element | 873 | /// Eagle element element |
733 | 875 | struct EELEMENT | 874 | struct EELEMENT |
734 | 876 | { | 875 | { |
739 | 877 | string name; | 876 | std::string name; |
740 | 878 | string library; | 877 | std::string library; |
741 | 879 | string package; | 878 | std::string package; |
742 | 880 | string value; | 879 | std::string value; |
743 | 881 | double x; | 880 | double x; |
744 | 882 | double y; | 881 | double y; |
745 | 883 | opt_bool locked; | 882 | opt_bool locked; |
746 | @@ -907,11 +906,11 @@ | |||
747 | 907 | */ | 906 | */ |
748 | 908 | 907 | ||
749 | 909 | // #REQUIRED | 908 | // #REQUIRED |
753 | 910 | name = attribs.get<string>( "name" ); | 909 | name = attribs.get<std::string>( "name" ); |
754 | 911 | library = attribs.get<string>( "library" ); | 910 | library = attribs.get<std::string>( "library" ); |
755 | 912 | value = attribs.get<string>( "value" ); | 911 | value = attribs.get<std::string>( "value" ); |
756 | 913 | 912 | ||
758 | 914 | package = attribs.get<string>( "package" ); | 913 | package = attribs.get<std::string>( "package" ); |
759 | 915 | ReplaceIllegalFileNameChars( &package ); | 914 | ReplaceIllegalFileNameChars( &package ); |
760 | 916 | 915 | ||
761 | 917 | x = attribs.get<double>( "x" ); | 916 | x = attribs.get<double>( "x" ); |
762 | @@ -927,7 +926,7 @@ | |||
763 | 927 | struct ELAYER | 926 | struct ELAYER |
764 | 928 | { | 927 | { |
765 | 929 | int number; | 928 | int number; |
767 | 930 | string name; | 929 | std::string name; |
768 | 931 | int color; | 930 | int color; |
769 | 932 | int fill; | 931 | int fill; |
770 | 933 | opt_bool visible; | 932 | opt_bool visible; |
771 | @@ -953,7 +952,7 @@ | |||
772 | 953 | */ | 952 | */ |
773 | 954 | 953 | ||
774 | 955 | number = attribs.get<int>( "number" ); | 954 | number = attribs.get<int>( "number" ); |
776 | 956 | name = attribs.get<string>( "name" ); | 955 | name = attribs.get<std::string>( "name" ); |
777 | 957 | color = attribs.get<int>( "color" ); | 956 | color = attribs.get<int>( "color" ); |
778 | 958 | visible = parseOptionalBool( attribs, "visible" ); | 957 | visible = parseOptionalBool( attribs, "visible" ); |
779 | 959 | active = parseOptionalBool( attribs, "active" ); | 958 | active = parseOptionalBool( attribs, "active" ); |
780 | @@ -962,7 +961,7 @@ | |||
781 | 962 | 961 | ||
782 | 963 | /// Parse an eagle distance which is either mm, or mils if there is "mil" suffix. | 962 | /// Parse an eagle distance which is either mm, or mils if there is "mil" suffix. |
783 | 964 | /// Return is in BIU. | 963 | /// Return is in BIU. |
785 | 965 | static double parseEagle( const string& aDistance ) | 964 | static double parseEagle( const std::string& aDistance ) |
786 | 966 | { | 965 | { |
787 | 967 | double ret = strtod( aDistance.c_str(), NULL ); | 966 | double ret = strtod( aDistance.c_str(), NULL ); |
788 | 968 | if( aDistance.npos != aDistance.find( "mil" ) ) | 967 | if( aDistance.npos != aDistance.find( "mil" ) ) |
789 | @@ -1019,7 +1018,7 @@ | |||
790 | 1019 | 1018 | ||
791 | 1020 | CPTREE& attribs = it->second.get_child( "<xmlattr>" ); | 1019 | CPTREE& attribs = it->second.get_child( "<xmlattr>" ); |
792 | 1021 | 1020 | ||
794 | 1022 | const string& name = attribs.get<string>( "name" ); | 1021 | const std::string& name = attribs.get<std::string>( "name" ); |
795 | 1023 | 1022 | ||
796 | 1024 | if( name == "psElongationLong" ) | 1023 | if( name == "psElongationLong" ) |
797 | 1025 | psElongationLong = attribs.get<int>( "value" ); | 1024 | psElongationLong = attribs.get<int>( "value" ); |
798 | @@ -1028,28 +1027,28 @@ | |||
799 | 1028 | else if( name == "rvPadTop" ) | 1027 | else if( name == "rvPadTop" ) |
800 | 1029 | rvPadTop = attribs.get<double>( "value" ); | 1028 | rvPadTop = attribs.get<double>( "value" ); |
801 | 1030 | else if( name == "rlMinPadTop" ) | 1029 | else if( name == "rlMinPadTop" ) |
803 | 1031 | rlMinPadTop = parseEagle( attribs.get<string>( "value" ) ); | 1030 | rlMinPadTop = parseEagle( attribs.get<std::string>( "value" ) ); |
804 | 1032 | else if( name == "rlMaxPadTop" ) | 1031 | else if( name == "rlMaxPadTop" ) |
806 | 1033 | rlMaxPadTop = parseEagle( attribs.get<string>( "value" ) ); | 1032 | rlMaxPadTop = parseEagle( attribs.get<std::string>( "value" ) ); |
807 | 1034 | 1033 | ||
808 | 1035 | else if( name == "rvViaOuter" ) | 1034 | else if( name == "rvViaOuter" ) |
809 | 1036 | rvViaOuter = attribs.get<double>( "value" ); | 1035 | rvViaOuter = attribs.get<double>( "value" ); |
810 | 1037 | else if( name == "rlMinViaOuter" ) | 1036 | else if( name == "rlMinViaOuter" ) |
812 | 1038 | rlMinViaOuter = parseEagle( attribs.get<string>( "value" ) ); | 1037 | rlMinViaOuter = parseEagle( attribs.get<std::string>( "value" ) ); |
813 | 1039 | else if( name == "rlMaxViaOuter" ) | 1038 | else if( name == "rlMaxViaOuter" ) |
815 | 1040 | rlMaxViaOuter = parseEagle( attribs.get<string>( "value" ) ); | 1039 | rlMaxViaOuter = parseEagle( attribs.get<std::string>( "value" ) ); |
816 | 1041 | else if( name == "mdWireWire" ) | 1040 | else if( name == "mdWireWire" ) |
818 | 1042 | mdWireWire = parseEagle( attribs.get<string>( "value" ) ); | 1041 | mdWireWire = parseEagle( attribs.get<std::string>( "value" ) ); |
819 | 1043 | } | 1042 | } |
820 | 1044 | } | 1043 | } |
821 | 1045 | 1044 | ||
822 | 1046 | 1045 | ||
823 | 1047 | /// Assemble a two part key as a simple concatonation of aFirst and aSecond parts, | 1046 | /// Assemble a two part key as a simple concatonation of aFirst and aSecond parts, |
824 | 1048 | /// using a separator. | 1047 | /// using a separator. |
826 | 1049 | static inline string makeKey( const string& aFirst, const string& aSecond ) | 1048 | static inline std::string makeKey( const std::string& aFirst, |
827 | 1049 | const std::string& aSecond ) | ||
828 | 1050 | { | 1050 | { |
831 | 1051 | string key = aFirst + '\x02' + aSecond; | 1051 | return (aFirst + '\x02' + aSecond); |
830 | 1052 | return key; | ||
832 | 1053 | } | 1052 | } |
833 | 1054 | 1053 | ||
834 | 1055 | 1054 | ||
835 | @@ -1119,14 +1118,14 @@ | |||
836 | 1119 | m_board->SetFileName( aFileName ); | 1118 | m_board->SetFileName( aFileName ); |
837 | 1120 | 1119 | ||
838 | 1121 | // delete on exception, iff I own m_board, according to aAppendToMe | 1120 | // delete on exception, iff I own m_board, according to aAppendToMe |
840 | 1122 | auto_ptr<BOARD> deleter( aAppendToMe ? NULL : m_board ); | 1121 | std::auto_ptr<BOARD> deleter( aAppendToMe ? NULL : m_board ); |
841 | 1123 | 1122 | ||
842 | 1124 | try | 1123 | try |
843 | 1125 | { | 1124 | { |
844 | 1126 | // 8 bit "filename" should be encoded according to disk filename encoding, | 1125 | // 8 bit "filename" should be encoded according to disk filename encoding, |
845 | 1127 | // (maybe this is current locale, maybe not, its a filesystem issue), | 1126 | // (maybe this is current locale, maybe not, its a filesystem issue), |
846 | 1128 | // and is not necessarily utf8. | 1127 | // and is not necessarily utf8. |
848 | 1129 | string filename = (const char*) aFileName.char_str( wxConvFile ); | 1128 | std::string filename = (const char*) aFileName.char_str( wxConvFile ); |
849 | 1130 | 1129 | ||
850 | 1131 | read_xml( filename, doc, xml_parser::trim_whitespace | xml_parser::no_comments ); | 1130 | read_xml( filename, doc, xml_parser::trim_whitespace | xml_parser::no_comments ); |
851 | 1132 | 1131 | ||
852 | @@ -1171,7 +1170,7 @@ | |||
853 | 1171 | // so one catch should be OK for all errors. | 1170 | // so one catch should be OK for all errors. |
854 | 1172 | catch( ptree_error pte ) | 1171 | catch( ptree_error pte ) |
855 | 1173 | { | 1172 | { |
857 | 1174 | string errmsg = pte.what(); | 1173 | std::string errmsg = pte.what(); |
858 | 1175 | 1174 | ||
859 | 1176 | errmsg += " @\n"; | 1175 | errmsg += " @\n"; |
860 | 1177 | errmsg += m_xpath->Contents(); | 1176 | errmsg += m_xpath->Contents(); |
861 | @@ -1571,7 +1570,7 @@ | |||
862 | 1571 | } | 1570 | } |
863 | 1572 | 1571 | ||
864 | 1573 | 1572 | ||
866 | 1574 | void EAGLE_PLUGIN::loadLibrary( CPTREE& aLib, const string* aLibName ) | 1573 | void EAGLE_PLUGIN::loadLibrary( CPTREE& aLib, const std::string* aLibName ) |
867 | 1575 | { | 1574 | { |
868 | 1576 | m_xpath->push( "packages" ); | 1575 | m_xpath->push( "packages" ); |
869 | 1577 | 1576 | ||
870 | @@ -1586,9 +1585,9 @@ | |||
871 | 1586 | { | 1585 | { |
872 | 1587 | m_xpath->push( "package", "name" ); | 1586 | m_xpath->push( "package", "name" ); |
873 | 1588 | 1587 | ||
875 | 1589 | const string& pack_ref = package->second.get<string>( "<xmlattr>.name" ); | 1588 | const std::string& pack_ref = package->second.get<std::string>( "<xmlattr>.name" ); |
876 | 1590 | 1589 | ||
878 | 1591 | string pack_name( pack_ref ); | 1590 | std::string pack_name( pack_ref ); |
879 | 1592 | 1591 | ||
880 | 1593 | ReplaceIllegalFileNameChars( &pack_name ); | 1592 | ReplaceIllegalFileNameChars( &pack_name ); |
881 | 1594 | 1593 | ||
882 | @@ -1601,7 +1600,7 @@ | |||
883 | 1601 | #endif | 1600 | #endif |
884 | 1602 | m_xpath->Value( pack_name.c_str() ); | 1601 | m_xpath->Value( pack_name.c_str() ); |
885 | 1603 | 1602 | ||
887 | 1604 | string key = aLibName ? makeKey( *aLibName, pack_name ) : pack_name; | 1603 | std::string key = aLibName ? makeKey( *aLibName, pack_name ) : pack_name; |
888 | 1605 | 1604 | ||
889 | 1606 | MODULE* m = makeModule( package->second, pack_name ); | 1605 | MODULE* m = makeModule( package->second, pack_name ); |
890 | 1607 | 1606 | ||
891 | @@ -1636,7 +1635,7 @@ | |||
892 | 1636 | 1635 | ||
893 | 1637 | for( CITER library = aLibs.begin(); library != aLibs.end(); ++library ) | 1636 | for( CITER library = aLibs.begin(); library != aLibs.end(); ++library ) |
894 | 1638 | { | 1637 | { |
896 | 1639 | const string& lib_name = library->second.get<string>( "<xmlattr>.name" ); | 1638 | const std::string& lib_name = library->second.get<std::string>( "<xmlattr>.name" ); |
897 | 1640 | 1639 | ||
898 | 1641 | m_xpath->Value( lib_name.c_str() ); | 1640 | m_xpath->Value( lib_name.c_str() ); |
899 | 1642 | 1641 | ||
900 | @@ -1667,7 +1666,7 @@ | |||
901 | 1667 | 1666 | ||
902 | 1668 | m_xpath->Value( e.name.c_str() ); | 1667 | m_xpath->Value( e.name.c_str() ); |
903 | 1669 | 1668 | ||
905 | 1670 | string key = makeKey( e.library, e.package ); | 1669 | std::string key = makeKey( e.library, e.package ); |
906 | 1671 | 1670 | ||
907 | 1672 | MODULE_CITER mi = m_templates.find( key ); | 1671 | MODULE_CITER mi = m_templates.find( key ); |
908 | 1673 | 1672 | ||
909 | @@ -1693,7 +1692,7 @@ | |||
910 | 1693 | // update the nets within the pads of the clone | 1692 | // update the nets within the pads of the clone |
911 | 1694 | for( D_PAD* pad = m->Pads(); pad; pad = pad->Next() ) | 1693 | for( D_PAD* pad = m->Pads(); pad; pad = pad->Next() ) |
912 | 1695 | { | 1694 | { |
914 | 1696 | string key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) ); | 1695 | std::string key = makeKey( e.name, TO_UTF8( pad->GetPadName() ) ); |
915 | 1697 | 1696 | ||
916 | 1698 | NET_MAP_CITER ni = m_pads_to_nets.find( key ); | 1697 | NET_MAP_CITER ni = m_pads_to_nets.find( key ); |
917 | 1699 | if( ni != m_pads_to_nets.end() ) | 1698 | if( ni != m_pads_to_nets.end() ) |
918 | @@ -1881,13 +1880,13 @@ | |||
919 | 1881 | } | 1880 | } |
920 | 1882 | 1881 | ||
921 | 1883 | 1882 | ||
923 | 1884 | MODULE* EAGLE_PLUGIN::makeModule( CPTREE& aPackage, const string& aPkgName ) const | 1883 | MODULE* EAGLE_PLUGIN::makeModule( CPTREE& aPackage, const std::string& aPkgName ) const |
924 | 1885 | { | 1884 | { |
925 | 1886 | std::auto_ptr<MODULE> m( new MODULE( NULL ) ); | 1885 | std::auto_ptr<MODULE> m( new MODULE( NULL ) ); |
926 | 1887 | 1886 | ||
927 | 1888 | m->SetFPID( FPID( aPkgName ) ); | 1887 | m->SetFPID( FPID( aPkgName ) ); |
928 | 1889 | 1888 | ||
930 | 1890 | opt_string description = aPackage.get_optional<string>( "description" ); | 1889 | opt_string description = aPackage.get_optional<std::string>( "description" ); |
931 | 1891 | if( description ) | 1890 | if( description ) |
932 | 1892 | m->SetDescription( FROM_UTF8( description->c_str() ) ); | 1891 | m->SetDescription( FROM_UTF8( description->c_str() ) ); |
933 | 1893 | 1892 | ||
934 | @@ -2354,7 +2353,7 @@ | |||
935 | 2354 | 2353 | ||
936 | 2355 | zones.clear(); | 2354 | zones.clear(); |
937 | 2356 | 2355 | ||
939 | 2357 | const string& nname = net->second.get<string>( "<xmlattr>.name" ); | 2356 | const std::string& nname = net->second.get<std::string>( "<xmlattr>.name" ); |
940 | 2358 | wxString netName = FROM_UTF8( nname.c_str() ); | 2357 | wxString netName = FROM_UTF8( nname.c_str() ); |
941 | 2359 | 2358 | ||
942 | 2360 | m_xpath->Value( nname.c_str() ); | 2359 | m_xpath->Value( nname.c_str() ); |
943 | @@ -2469,10 +2468,10 @@ | |||
944 | 2469 | // <contactref element="RN1" pad="7"/> | 2468 | // <contactref element="RN1" pad="7"/> |
945 | 2470 | CPTREE& attribs = it->second.get_child( "<xmlattr>" ); | 2469 | CPTREE& attribs = it->second.get_child( "<xmlattr>" ); |
946 | 2471 | 2470 | ||
949 | 2472 | const string& reference = attribs.get<string>( "element" ); | 2471 | const std::string& reference = attribs.get<std::string>( "element" ); |
950 | 2473 | const string& pad = attribs.get<string>( "pad" ); | 2472 | const std::string& pad = attribs.get<std::string>( "pad" ); |
951 | 2474 | 2473 | ||
953 | 2475 | string key = makeKey( reference, pad ) ; | 2474 | std::string key = makeKey( reference, pad ) ; |
954 | 2476 | 2475 | ||
955 | 2477 | // D(printf( "adding refname:'%s' pad:'%s' netcode:%d netname:'%s'\n", reference.c_str(), pad.c_str(), netCode, nname.c_str() );) | 2476 | // D(printf( "adding refname:'%s' pad:'%s' netcode:%d netname:'%s'\n", reference.c_str(), pad.c_str(), netCode, nname.c_str() );) |
956 | 2478 | 2477 | ||
957 | @@ -2714,8 +2713,8 @@ | |||
958 | 2714 | { | 2713 | { |
959 | 2715 | if( m_props ) | 2714 | if( m_props ) |
960 | 2716 | { | 2715 | { |
963 | 2717 | string page_width; | 2716 | std::string page_width; |
964 | 2718 | string page_height; | 2717 | std::string page_height; |
965 | 2719 | 2718 | ||
966 | 2720 | if( m_props->Value( "page_width", &page_width ) && | 2719 | if( m_props->Value( "page_width", &page_width ) && |
967 | 2721 | m_props->Value( "page_height", &page_height ) ) | 2720 | m_props->Value( "page_height", &page_height ) ) |
968 | @@ -2785,7 +2784,7 @@ | |||
969 | 2785 | // 8 bit "filename" should be encoded according to disk filename encoding, | 2784 | // 8 bit "filename" should be encoded according to disk filename encoding, |
970 | 2786 | // (maybe this is current locale, maybe not, its a filesystem issue), | 2785 | // (maybe this is current locale, maybe not, its a filesystem issue), |
971 | 2787 | // and is not necessarily utf8. | 2786 | // and is not necessarily utf8. |
973 | 2788 | string filename = (const char*) aLibPath.char_str( wxConvFile ); | 2787 | std::string filename = (const char*) aLibPath.char_str( wxConvFile ); |
974 | 2789 | 2788 | ||
975 | 2790 | read_xml( filename, doc, xml_parser::trim_whitespace | xml_parser::no_comments ); | 2789 | read_xml( filename, doc, xml_parser::trim_whitespace | xml_parser::no_comments ); |
976 | 2791 | 2790 | ||
977 | @@ -2816,7 +2815,7 @@ | |||
978 | 2816 | // so one catch should be OK for all errors. | 2815 | // so one catch should be OK for all errors. |
979 | 2817 | catch( ptree_error pte ) | 2816 | catch( ptree_error pte ) |
980 | 2818 | { | 2817 | { |
982 | 2819 | string errmsg = pte.what(); | 2818 | std::string errmsg = pte.what(); |
983 | 2820 | 2819 | ||
984 | 2821 | errmsg += " @\n"; | 2820 | errmsg += " @\n"; |
985 | 2822 | errmsg += m_xpath->Contents(); | 2821 | errmsg += m_xpath->Contents(); |
986 | @@ -2847,7 +2846,7 @@ | |||
987 | 2847 | 2846 | ||
988 | 2848 | cacheLib( aLibraryPath ); | 2847 | cacheLib( aLibraryPath ); |
989 | 2849 | 2848 | ||
991 | 2850 | string key = TO_UTF8( aFootprintName ); | 2849 | std::string key = TO_UTF8( aFootprintName ); |
992 | 2851 | 2850 | ||
993 | 2852 | MODULE_CITER mi = m_templates.find( key ); | 2851 | MODULE_CITER mi = m_templates.find( key ); |
994 | 2853 | 2852 | ||
995 | 2854 | 2853 | ||
996 | === modified file 'pcbnew/github/github_plugin.cpp' | |||
997 | --- pcbnew/github/github_plugin.cpp 2013-12-03 18:37:21 +0000 | |||
998 | +++ pcbnew/github/github_plugin.cpp 2013-12-04 08:51:30 +0000 | |||
999 | @@ -63,15 +63,12 @@ | |||
1000 | 63 | #include <macros.h> | 63 | #include <macros.h> |
1001 | 64 | #include <fp_lib_table.h> // ExpandSubstitutions() | 64 | #include <fp_lib_table.h> // ExpandSubstitutions() |
1002 | 65 | 65 | ||
1003 | 66 | using namespace std; | ||
1004 | 67 | |||
1005 | 68 | |||
1006 | 69 | static const char* PRETTY_DIR = "allow_pretty_writing_to_this_dir"; | 66 | static const char* PRETTY_DIR = "allow_pretty_writing_to_this_dir"; |
1007 | 70 | 67 | ||
1008 | 71 | 68 | ||
1012 | 72 | typedef boost::ptr_map<string, wxZipEntry> MODULE_MAP; | 69 | typedef boost::ptr_map<std::string, wxZipEntry> MODULE_MAP; |
1013 | 73 | typedef MODULE_MAP::iterator MODULE_ITER; | 70 | typedef MODULE_MAP::iterator MODULE_ITER; |
1014 | 74 | typedef MODULE_MAP::const_iterator MODULE_CITER; | 71 | typedef MODULE_MAP::const_iterator MODULE_CITER; |
1015 | 75 | 72 | ||
1016 | 76 | 73 | ||
1017 | 77 | /** | 74 | /** |
1018 | @@ -166,7 +163,7 @@ | |||
1019 | 166 | } | 163 | } |
1020 | 167 | } | 164 | } |
1021 | 168 | 165 | ||
1023 | 169 | string fp_name = TO_UTF8( aFootprintName ); | 166 | std::string fp_name = TO_UTF8( aFootprintName ); |
1024 | 170 | 167 | ||
1025 | 171 | MODULE_CITER it = m_gh_cache->find( fp_name ); | 168 | MODULE_CITER it = m_gh_cache->find( fp_name ); |
1026 | 172 | 169 | ||
1027 | @@ -233,7 +230,7 @@ | |||
1028 | 233 | // IsFootprintLibWritable() to determine if calling FootprintSave() is | 230 | // IsFootprintLibWritable() to determine if calling FootprintSave() is |
1029 | 234 | // even legal, so I spend no time on internationalization here: | 231 | // even legal, so I spend no time on internationalization here: |
1030 | 235 | 232 | ||
1032 | 236 | string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.", | 233 | std::string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.", |
1033 | 237 | (const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR ); | 234 | (const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR ); |
1034 | 238 | 235 | ||
1035 | 239 | THROW_IO_ERROR( msg ); | 236 | THROW_IO_ERROR( msg ); |
1036 | @@ -275,7 +272,7 @@ | |||
1037 | 275 | // IsFootprintLibWritable() to determine if calling FootprintSave() is | 272 | // IsFootprintLibWritable() to determine if calling FootprintSave() is |
1038 | 276 | // even legal, so I spend no time on internationalization here: | 273 | // even legal, so I spend no time on internationalization here: |
1039 | 277 | 274 | ||
1041 | 278 | string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.", | 275 | std::string msg = StrPrintf( "Github library\n'%s'\nis only writable if you set option '%s' in Library Tables dialog.", |
1042 | 279 | (const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR ); | 276 | (const char*) TO_UTF8( aLibraryPath ), PRETTY_DIR ); |
1043 | 280 | 277 | ||
1044 | 281 | THROW_IO_ERROR( msg ); | 278 | THROW_IO_ERROR( msg ); |
1045 | @@ -356,7 +353,7 @@ | |||
1046 | 356 | 353 | ||
1047 | 357 | if( aProperties ) | 354 | if( aProperties ) |
1048 | 358 | { | 355 | { |
1050 | 359 | string pretty_dir; | 356 | std::string pretty_dir; |
1051 | 360 | 357 | ||
1052 | 361 | if( aProperties->Value( PRETTY_DIR, &pretty_dir ) ) | 358 | if( aProperties->Value( PRETTY_DIR, &pretty_dir ) ) |
1053 | 362 | { | 359 | { |
1054 | @@ -409,7 +406,7 @@ | |||
1055 | 409 | 406 | ||
1056 | 410 | if( fn.GetExt() == kicad_mod ) | 407 | if( fn.GetExt() == kicad_mod ) |
1057 | 411 | { | 408 | { |
1059 | 412 | string fp_name = TO_UTF8( fn.GetName() ); // omit extension & path | 409 | std::string fp_name = TO_UTF8( fn.GetName() ); // omit extension & path |
1060 | 413 | 410 | ||
1061 | 414 | m_gh_cache->insert( fp_name, entry ); | 411 | m_gh_cache->insert( fp_name, entry ); |
1062 | 415 | } | 412 | } |
1063 | @@ -420,7 +417,7 @@ | |||
1064 | 420 | } | 417 | } |
1065 | 421 | 418 | ||
1066 | 422 | 419 | ||
1068 | 423 | bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL ) | 420 | bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, std::string* aZipURL ) |
1069 | 424 | { | 421 | { |
1070 | 425 | // e.g. "https://github.com/liftoff-sr/pretty_footprints" | 422 | // e.g. "https://github.com/liftoff-sr/pretty_footprints" |
1071 | 426 | //D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );) | 423 | //D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );) |
1072 | @@ -460,7 +457,7 @@ | |||
1073 | 460 | 457 | ||
1074 | 461 | void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR ) | 458 | void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR ) |
1075 | 462 | { | 459 | { |
1077 | 463 | string zip_url; | 460 | std::string zip_url; |
1078 | 464 | 461 | ||
1079 | 465 | if( !repoURL_zipURL( aRepoURL, &zip_url ) ) | 462 | if( !repoURL_zipURL( aRepoURL, &zip_url ) ) |
1080 | 466 | { | 463 | { |
1081 | @@ -478,7 +475,7 @@ | |||
1082 | 478 | 475 | ||
1083 | 479 | try | 476 | try |
1084 | 480 | { | 477 | { |
1086 | 481 | ostringstream os; | 478 | std::ostringstream os; |
1087 | 482 | 479 | ||
1088 | 483 | h.open( zip_url ); // only one file, therefore do it synchronously. | 480 | h.open( zip_url ); // only one file, therefore do it synchronously. |
1089 | 484 | os << &h; | 481 | os << &h; |
1090 | @@ -495,10 +492,8 @@ | |||
1091 | 495 | // https "GET" has faild, report this to API caller. | 492 | // https "GET" has faild, report this to API caller. |
1092 | 496 | wxString fmt( _( "Cannot GET zip: '%s'\nfor lib-path: '%s'.\nWhat: '%s'" ) ); | 493 | wxString fmt( _( "Cannot GET zip: '%s'\nfor lib-path: '%s'.\nWhat: '%s'" ) ); |
1093 | 497 | 494 | ||
1098 | 498 | string msg = StrPrintf( TO_UTF8( fmt ), | 495 | std::string msg = StrPrintf( TO_UTF8( fmt ), zip_url.c_str(), |
1099 | 499 | zip_url.c_str(), | 496 | TO_UTF8( aRepoURL ), e.what() ); |
1096 | 500 | TO_UTF8( aRepoURL ), | ||
1097 | 501 | e.what() ); | ||
1100 | 502 | 497 | ||
1101 | 503 | THROW_IO_ERROR( msg ); | 498 | THROW_IO_ERROR( msg ); |
1102 | 504 | } | 499 | } |
1103 | 505 | 500 | ||
1104 | === modified file 'pcbnew/gpcb_plugin.cpp' | |||
1105 | --- pcbnew/gpcb_plugin.cpp 2013-09-25 19:17:06 +0000 | |||
1106 | +++ pcbnew/gpcb_plugin.cpp 2013-12-04 08:51:30 +0000 | |||
1107 | @@ -48,9 +48,6 @@ | |||
1108 | 48 | #include <boost/ptr_container/ptr_map.hpp> | 48 | #include <boost/ptr_container/ptr_map.hpp> |
1109 | 49 | #include <memory.h> | 49 | #include <memory.h> |
1110 | 50 | 50 | ||
1111 | 51 | using namespace std; | ||
1112 | 52 | |||
1113 | 53 | |||
1114 | 54 | /** | 51 | /** |
1115 | 55 | * Definition for enabling and disabling footprint library trace output. See the | 52 | * Definition for enabling and disabling footprint library trace output. See the |
1116 | 56 | * wxWidgets documentation on using the WXTRACE environment variable. | 53 | * wxWidgets documentation on using the WXTRACE environment variable. |
1117 | @@ -118,7 +115,7 @@ | |||
1118 | 118 | wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. | 115 | wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. |
1119 | 119 | bool m_writable; ///< Writability status of the footprint file. | 116 | bool m_writable; ///< Writability status of the footprint file. |
1120 | 120 | wxDateTime m_mod_time; ///< The last file modified time stamp. | 117 | wxDateTime m_mod_time; ///< The last file modified time stamp. |
1122 | 121 | auto_ptr< MODULE > m_module; | 118 | std::auto_ptr<MODULE> m_module; |
1123 | 122 | 119 | ||
1124 | 123 | public: | 120 | public: |
1125 | 124 | GPCB_FPL_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName ); | 121 | GPCB_FPL_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName ); |
1126 | @@ -327,13 +324,13 @@ | |||
1127 | 327 | // Old version unit = 1 mil, so conv_unit is 10 or 0.1 | 324 | // Old version unit = 1 mil, so conv_unit is 10 or 0.1 |
1128 | 328 | #define NEW_GPCB_UNIT_CONV ( 0.01*IU_PER_MILS ) | 325 | #define NEW_GPCB_UNIT_CONV ( 0.01*IU_PER_MILS ) |
1129 | 329 | 326 | ||
1137 | 330 | int paramCnt; | 327 | int paramCnt; |
1138 | 331 | double conv_unit = NEW_GPCB_UNIT_CONV; // GPCB unit = 0.01 mils and Pcbnew 0.1 | 328 | double conv_unit = NEW_GPCB_UNIT_CONV; // GPCB unit = 0.01 mils and Pcbnew 0.1 |
1139 | 332 | wxPoint refPos( 0, 0 ); | 329 | wxPoint refPos( 0, 0 ); |
1140 | 333 | wxPoint textPos; | 330 | wxPoint textPos; |
1141 | 334 | wxString msg; | 331 | wxString msg; |
1142 | 335 | wxArrayString parameters; | 332 | wxArrayString parameters; |
1143 | 336 | auto_ptr< MODULE > module( new MODULE( NULL ) ); | 333 | std::auto_ptr<MODULE> module( new MODULE( NULL ) ); |
1144 | 337 | 334 | ||
1145 | 338 | 335 | ||
1146 | 339 | if( aLineReader->ReadLine() == NULL ) | 336 | if( aLineReader->ReadLine() == NULL ) |
1147 | 340 | 337 | ||
1148 | === modified file 'pcbnew/kicad_plugin.cpp' | |||
1149 | --- pcbnew/kicad_plugin.cpp 2013-11-28 16:40:23 +0000 | |||
1150 | +++ pcbnew/kicad_plugin.cpp 2013-12-04 08:51:30 +0000 | |||
1151 | @@ -52,9 +52,6 @@ | |||
1152 | 52 | #include <boost/ptr_container/ptr_map.hpp> | 52 | #include <boost/ptr_container/ptr_map.hpp> |
1153 | 53 | #include <memory.h> | 53 | #include <memory.h> |
1154 | 54 | 54 | ||
1155 | 55 | using namespace std; | ||
1156 | 56 | |||
1157 | 57 | |||
1158 | 58 | #define FMTIU BOARD_ITEM::FormatInternalUnits | 55 | #define FMTIU BOARD_ITEM::FormatInternalUnits |
1159 | 59 | 56 | ||
1160 | 60 | /** | 57 | /** |
1161 | @@ -78,7 +75,7 @@ | |||
1162 | 78 | wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. | 75 | wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. |
1163 | 79 | bool m_writable; ///< Writability status of the footprint file. | 76 | bool m_writable; ///< Writability status of the footprint file. |
1164 | 80 | wxDateTime m_mod_time; ///< The last file modified time stamp. | 77 | wxDateTime m_mod_time; ///< The last file modified time stamp. |
1166 | 81 | auto_ptr< MODULE > m_module; | 78 | std::auto_ptr<MODULE> m_module; |
1167 | 82 | 79 | ||
1168 | 83 | public: | 80 | public: |
1169 | 84 | FP_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName ); | 81 | FP_CACHE_ITEM( MODULE* aModule, const wxFileName& aFileName ); |
1170 | 85 | 82 | ||
1171 | === modified file 'pcbnew/legacy_plugin.cpp' | |||
1172 | --- pcbnew/legacy_plugin.cpp 2013-11-29 18:29:41 +0000 | |||
1173 | +++ pcbnew/legacy_plugin.cpp 2013-12-04 08:51:30 +0000 | |||
1174 | @@ -147,9 +147,6 @@ | |||
1175 | 147 | #endif | 147 | #endif |
1176 | 148 | 148 | ||
1177 | 149 | 149 | ||
1178 | 150 | using namespace std; // auto_ptr | ||
1179 | 151 | |||
1180 | 152 | |||
1181 | 153 | static inline const char* ShowVertJustify( EDA_TEXT_VJUSTIFY_T vertical ) | 150 | static inline const char* ShowVertJustify( EDA_TEXT_VJUSTIFY_T vertical ) |
1182 | 154 | { | 151 | { |
1183 | 155 | const char* rs; | 152 | const char* rs; |
1184 | @@ -244,9 +241,9 @@ | |||
1185 | 244 | m_board->SetFileName( aFileName ); | 241 | m_board->SetFileName( aFileName ); |
1186 | 245 | 242 | ||
1187 | 246 | // delete on exception, iff I own m_board, according to aAppendToMe | 243 | // delete on exception, iff I own m_board, according to aAppendToMe |
1189 | 247 | auto_ptr<BOARD> deleter( aAppendToMe ? NULL : m_board ); | 244 | std::auto_ptr<BOARD> deleter( aAppendToMe ? NULL : m_board ); |
1190 | 248 | 245 | ||
1192 | 249 | FILE_LINE_READER reader( aFileName ); | 246 | FILE_LINE_READER reader( aFileName ); |
1193 | 250 | 247 | ||
1194 | 251 | m_reader = &reader; // member function accessibility | 248 | m_reader = &reader; // member function accessibility |
1195 | 252 | 249 | ||
1196 | @@ -276,7 +273,7 @@ | |||
1197 | 276 | 273 | ||
1198 | 277 | if( TESTLINE( "$MODULE" ) ) | 274 | if( TESTLINE( "$MODULE" ) ) |
1199 | 278 | { | 275 | { |
1201 | 279 | auto_ptr<MODULE> module( new MODULE( m_board ) ); | 276 | std::auto_ptr<MODULE> module( new MODULE( m_board ) ); |
1202 | 280 | 277 | ||
1203 | 281 | FPID fpid; | 278 | FPID fpid; |
1204 | 282 | std::string fpName = StrPurge( line + SZ( "$MODULE" ) ); | 279 | std::string fpName = StrPurge( line + SZ( "$MODULE" ) ); |
1205 | @@ -1149,7 +1146,7 @@ | |||
1206 | 1149 | 1146 | ||
1207 | 1150 | void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) | 1147 | void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) |
1208 | 1151 | { | 1148 | { |
1210 | 1152 | auto_ptr<D_PAD> pad( new D_PAD( aModule ) ); | 1149 | std::auto_ptr<D_PAD> pad( new D_PAD( aModule ) ); |
1211 | 1153 | char* line; | 1150 | char* line; |
1212 | 1154 | 1151 | ||
1213 | 1155 | while( ( line = READLINE( m_reader ) ) != NULL ) | 1152 | while( ( line = READLINE( m_reader ) ) != NULL ) |
1214 | @@ -1401,7 +1398,7 @@ | |||
1215 | 1401 | THROW_IO_ERROR( m_error ); | 1398 | THROW_IO_ERROR( m_error ); |
1216 | 1402 | } | 1399 | } |
1217 | 1403 | 1400 | ||
1219 | 1404 | auto_ptr<EDGE_MODULE> dwg( new EDGE_MODULE( aModule, shape ) ); // a drawing | 1401 | std::auto_ptr<EDGE_MODULE> dwg( new EDGE_MODULE( aModule, shape ) ); // a drawing |
1220 | 1405 | 1402 | ||
1221 | 1406 | const char* data; | 1403 | const char* data; |
1222 | 1407 | 1404 | ||
1223 | @@ -1696,8 +1693,8 @@ | |||
1224 | 1696 | $EndDRAWSEGMENT | 1693 | $EndDRAWSEGMENT |
1225 | 1697 | */ | 1694 | */ |
1226 | 1698 | 1695 | ||
1229 | 1699 | auto_ptr<DRAWSEGMENT> dseg( new DRAWSEGMENT( m_board ) ); | 1696 | std::auto_ptr<DRAWSEGMENT> dseg( new DRAWSEGMENT( m_board ) ); |
1230 | 1700 | char* line; | 1697 | char* line; |
1231 | 1701 | 1698 | ||
1232 | 1702 | while( ( line = READLINE( m_reader ) ) != NULL ) | 1699 | while( ( line = READLINE( m_reader ) ) != NULL ) |
1233 | 1703 | { | 1700 | { |
1234 | @@ -2095,7 +2092,7 @@ | |||
1235 | 2095 | // yet since that would bypass duplicate netclass name checking within the BOARD. | 2092 | // yet since that would bypass duplicate netclass name checking within the BOARD. |
1236 | 2096 | // store it temporarily in an auto_ptr until successfully inserted into the BOARD | 2093 | // store it temporarily in an auto_ptr until successfully inserted into the BOARD |
1237 | 2097 | // just before returning. | 2094 | // just before returning. |
1239 | 2098 | auto_ptr<NETCLASS> nc( new NETCLASS( m_board, wxEmptyString ) ); | 2095 | std::auto_ptr<NETCLASS> nc( new NETCLASS( m_board, wxEmptyString ) ); |
1240 | 2099 | 2096 | ||
1241 | 2100 | while( ( line = READLINE( m_reader ) ) != NULL ) | 2097 | while( ( line = READLINE( m_reader ) ) != NULL ) |
1242 | 2101 | { | 2098 | { |
1243 | @@ -2182,7 +2179,7 @@ | |||
1244 | 2182 | 2179 | ||
1245 | 2183 | void LEGACY_PLUGIN::loadZONE_CONTAINER() | 2180 | void LEGACY_PLUGIN::loadZONE_CONTAINER() |
1246 | 2184 | { | 2181 | { |
1248 | 2185 | auto_ptr<ZONE_CONTAINER> zc( new ZONE_CONTAINER( m_board ) ); | 2182 | std::auto_ptr<ZONE_CONTAINER> zc( new ZONE_CONTAINER( m_board ) ); |
1249 | 2186 | 2183 | ||
1250 | 2187 | CPolyLine::HATCH_STYLE outline_hatch = CPolyLine::NO_HATCH; | 2184 | CPolyLine::HATCH_STYLE outline_hatch = CPolyLine::NO_HATCH; |
1251 | 2188 | bool sawCorner = false; | 2185 | bool sawCorner = false; |
1252 | @@ -2446,8 +2443,8 @@ | |||
1253 | 2446 | 2443 | ||
1254 | 2447 | void LEGACY_PLUGIN::loadDIMENSION() | 2444 | void LEGACY_PLUGIN::loadDIMENSION() |
1255 | 2448 | { | 2445 | { |
1258 | 2449 | auto_ptr<DIMENSION> dim( new DIMENSION( m_board ) ); | 2446 | std::auto_ptr<DIMENSION> dim( new DIMENSION( m_board ) ); |
1259 | 2450 | char* line; | 2447 | char* line; |
1260 | 2451 | 2448 | ||
1261 | 2452 | while( ( line = READLINE( m_reader ) ) != NULL ) | 2449 | while( ( line = READLINE( m_reader ) ) != NULL ) |
1262 | 2453 | { | 2450 | { |
1263 | @@ -4031,9 +4028,9 @@ | |||
1264 | 4031 | // test first for the $MODULE, even before reading because of INDEX bug. | 4028 | // test first for the $MODULE, even before reading because of INDEX bug. |
1265 | 4032 | if( TESTLINE( "$MODULE" ) ) | 4029 | if( TESTLINE( "$MODULE" ) ) |
1266 | 4033 | { | 4030 | { |
1268 | 4034 | auto_ptr<MODULE> module( new MODULE( m_owner->m_board ) ); | 4031 | std::auto_ptr<MODULE> module( new MODULE( m_owner->m_board ) ); |
1269 | 4035 | 4032 | ||
1271 | 4036 | std::string footprintName = StrPurge( line + SZ( "$MODULE" ) ); | 4033 | std::string footprintName = StrPurge( line + SZ( "$MODULE" ) ); |
1272 | 4037 | 4034 | ||
1273 | 4038 | // The footprint names in legacy libraries can contain the '/' and ':' | 4035 | // The footprint names in legacy libraries can contain the '/' and ':' |
1274 | 4039 | // characters which will cause the FPID parser to choke. | 4036 | // characters which will cause the FPID parser to choke. |
1275 | 4040 | 4037 | ||
1276 | === modified file 'pcbnew/pcb_parser.cpp' | |||
1277 | --- pcbnew/pcb_parser.cpp 2013-09-24 18:45:57 +0000 | |||
1278 | +++ pcbnew/pcb_parser.cpp 2013-12-04 08:51:30 +0000 | |||
1279 | @@ -51,9 +51,6 @@ | |||
1280 | 51 | #include <pcb_parser.h> | 51 | #include <pcb_parser.h> |
1281 | 52 | 52 | ||
1282 | 53 | 53 | ||
1283 | 54 | using namespace std; | ||
1284 | 55 | |||
1285 | 56 | |||
1286 | 57 | void PCB_PARSER::init() | 54 | void PCB_PARSER::init() |
1287 | 58 | { | 55 | { |
1288 | 59 | m_layerIndices.clear(); | 56 | m_layerIndices.clear(); |
1289 | @@ -263,7 +260,7 @@ | |||
1290 | 263 | 260 | ||
1291 | 264 | T token; | 261 | T token; |
1292 | 265 | 262 | ||
1294 | 266 | auto_ptr< S3D_MASTER > n3D( new S3D_MASTER( NULL ) ); | 263 | std::auto_ptr< S3D_MASTER > n3D( new S3D_MASTER( NULL ) ); |
1295 | 267 | 264 | ||
1296 | 268 | NeedSYMBOLorNUMBER(); | 265 | NeedSYMBOLorNUMBER(); |
1297 | 269 | n3D->m_Shape3DName = FromUTF8(); | 266 | n3D->m_Shape3DName = FromUTF8(); |
1298 | @@ -1084,7 +1081,7 @@ | |||
1299 | 1084 | 1081 | ||
1300 | 1085 | T token; | 1082 | T token; |
1301 | 1086 | 1083 | ||
1303 | 1087 | auto_ptr<NETCLASS> nc( new NETCLASS( m_board, wxEmptyString ) ); | 1084 | std::auto_ptr<NETCLASS> nc( new NETCLASS( m_board, wxEmptyString ) ); |
1304 | 1088 | 1085 | ||
1305 | 1089 | // Read netclass name (can be a name or just a number like track width) | 1086 | // Read netclass name (can be a name or just a number like track width) |
1306 | 1090 | NeedSYMBOLorNUMBER(); | 1087 | NeedSYMBOLorNUMBER(); |
1307 | @@ -1164,7 +1161,7 @@ | |||
1308 | 1164 | 1161 | ||
1309 | 1165 | T token; | 1162 | T token; |
1310 | 1166 | wxPoint pt; | 1163 | wxPoint pt; |
1312 | 1167 | auto_ptr< DRAWSEGMENT > segment( new DRAWSEGMENT( NULL ) ); | 1164 | std::auto_ptr< DRAWSEGMENT > segment( new DRAWSEGMENT( NULL ) ); |
1313 | 1168 | 1165 | ||
1314 | 1169 | switch( CurTok() ) | 1166 | switch( CurTok() ) |
1315 | 1170 | { | 1167 | { |
1316 | @@ -1325,7 +1322,7 @@ | |||
1317 | 1325 | 1322 | ||
1318 | 1326 | T token; | 1323 | T token; |
1319 | 1327 | 1324 | ||
1321 | 1328 | auto_ptr< TEXTE_PCB > text( new TEXTE_PCB( m_board ) ); | 1325 | std::auto_ptr<TEXTE_PCB> text( new TEXTE_PCB( m_board ) ); |
1322 | 1329 | NeedSYMBOLorNUMBER(); | 1326 | NeedSYMBOLorNUMBER(); |
1323 | 1330 | 1327 | ||
1324 | 1331 | text->SetText( FromUTF8() ); | 1328 | text->SetText( FromUTF8() ); |
1325 | @@ -1393,7 +1390,7 @@ | |||
1326 | 1393 | 1390 | ||
1327 | 1394 | T token; | 1391 | T token; |
1328 | 1395 | 1392 | ||
1330 | 1396 | auto_ptr< DIMENSION > dimension( new DIMENSION( NULL ) ); | 1393 | std::auto_ptr<DIMENSION> dimension( new DIMENSION( NULL ) ); |
1331 | 1397 | 1394 | ||
1332 | 1398 | dimension->SetValue( parseBoardUnits( "dimension value" ) ); | 1395 | dimension->SetValue( parseBoardUnits( "dimension value" ) ); |
1333 | 1399 | NeedLEFT(); | 1396 | NeedLEFT(); |
1334 | @@ -1545,7 +1542,7 @@ | |||
1335 | 1545 | T token; | 1542 | T token; |
1336 | 1546 | FPID fpid; | 1543 | FPID fpid; |
1337 | 1547 | 1544 | ||
1339 | 1548 | auto_ptr< MODULE > module( new MODULE( m_board ) ); | 1545 | std::auto_ptr<MODULE> module( new MODULE( m_board ) ); |
1340 | 1549 | 1546 | ||
1341 | 1550 | module->SetInitialComments( aInitialComments ); | 1547 | module->SetInitialComments( aInitialComments ); |
1342 | 1551 | 1548 | ||
1343 | @@ -1773,7 +1770,7 @@ | |||
1344 | 1773 | 1770 | ||
1345 | 1774 | T token = NextTok(); | 1771 | T token = NextTok(); |
1346 | 1775 | 1772 | ||
1348 | 1776 | auto_ptr< TEXTE_MODULE > text( new TEXTE_MODULE( NULL ) ); | 1773 | std::auto_ptr<TEXTE_MODULE> text( new TEXTE_MODULE( NULL ) ); |
1349 | 1777 | 1774 | ||
1350 | 1778 | switch( token ) | 1775 | switch( token ) |
1351 | 1779 | { | 1776 | { |
1352 | @@ -1858,7 +1855,7 @@ | |||
1353 | 1858 | wxPoint pt; | 1855 | wxPoint pt; |
1354 | 1859 | T token; | 1856 | T token; |
1355 | 1860 | 1857 | ||
1357 | 1861 | auto_ptr< EDGE_MODULE > segment( new EDGE_MODULE( NULL ) ); | 1858 | std::auto_ptr< EDGE_MODULE > segment( new EDGE_MODULE( NULL ) ); |
1358 | 1862 | 1859 | ||
1359 | 1863 | switch( CurTok() ) | 1860 | switch( CurTok() ) |
1360 | 1864 | { | 1861 | { |
1361 | @@ -2023,7 +2020,7 @@ | |||
1362 | 2023 | 2020 | ||
1363 | 2024 | wxSize sz; | 2021 | wxSize sz; |
1364 | 2025 | wxPoint pt; | 2022 | wxPoint pt; |
1366 | 2026 | auto_ptr< D_PAD > pad( new D_PAD( NULL ) ); | 2023 | std::auto_ptr< D_PAD > pad( new D_PAD( NULL ) ); |
1367 | 2027 | 2024 | ||
1368 | 2028 | NeedSYMBOLorNUMBER(); | 2025 | NeedSYMBOLorNUMBER(); |
1369 | 2029 | pad->SetPadName( FromUTF8() ); | 2026 | pad->SetPadName( FromUTF8() ); |
1370 | @@ -2260,7 +2257,7 @@ | |||
1371 | 2260 | wxPoint pt; | 2257 | wxPoint pt; |
1372 | 2261 | T token; | 2258 | T token; |
1373 | 2262 | 2259 | ||
1375 | 2263 | auto_ptr< TRACK > track( new TRACK( m_board ) ); | 2260 | std::auto_ptr< TRACK > track( new TRACK( m_board ) ); |
1376 | 2264 | 2261 | ||
1377 | 2265 | for( token = NextTok(); token != T_RIGHT; token = NextTok() ) | 2262 | for( token = NextTok(); token != T_RIGHT; token = NextTok() ) |
1378 | 2266 | { | 2263 | { |
1379 | @@ -2322,7 +2319,7 @@ | |||
1380 | 2322 | wxPoint pt; | 2319 | wxPoint pt; |
1381 | 2323 | T token; | 2320 | T token; |
1382 | 2324 | 2321 | ||
1384 | 2325 | auto_ptr< SEGVIA > via( new SEGVIA( m_board ) ); | 2322 | std::auto_ptr< SEGVIA > via( new SEGVIA( m_board ) ); |
1385 | 2326 | 2323 | ||
1386 | 2327 | for( token = NextTok(); token != T_RIGHT; token = NextTok() ) | 2324 | for( token = NextTok(); token != T_RIGHT; token = NextTok() ) |
1387 | 2328 | { | 2325 | { |
1388 | @@ -2407,7 +2404,7 @@ | |||
1389 | 2407 | // bigger scope since each filled_polygon is concatenated in here | 2404 | // bigger scope since each filled_polygon is concatenated in here |
1390 | 2408 | CPOLYGONS_LIST pts; | 2405 | CPOLYGONS_LIST pts; |
1391 | 2409 | 2406 | ||
1393 | 2410 | auto_ptr< ZONE_CONTAINER > zone( new ZONE_CONTAINER( m_board ) ); | 2407 | std::auto_ptr< ZONE_CONTAINER > zone( new ZONE_CONTAINER( m_board ) ); |
1394 | 2411 | 2408 | ||
1395 | 2412 | zone->SetPriority( 0 ); | 2409 | zone->SetPriority( 0 ); |
1396 | 2413 | 2410 | ||
1397 | @@ -2721,8 +2718,7 @@ | |||
1398 | 2721 | wxPoint pt; | 2718 | wxPoint pt; |
1399 | 2722 | T token; | 2719 | T token; |
1400 | 2723 | 2720 | ||
1403 | 2724 | auto_ptr< PCB_TARGET > target( new PCB_TARGET( NULL ) ); | 2721 | std::auto_ptr< PCB_TARGET > target( new PCB_TARGET( NULL ) ); |
1402 | 2725 | |||
1404 | 2726 | 2722 | ||
1405 | 2727 | for( token = NextTok(); token != T_RIGHT; token = NextTok() ) | 2723 | for( token = NextTok(); token != T_RIGHT; token = NextTok() ) |
1406 | 2728 | { | 2724 | { |
1407 | 2729 | 2725 | ||
1408 | === modified file 'pcbnew/router/pns_line.cpp' | |||
1409 | --- pcbnew/router/pns_line.cpp 2013-10-14 18:40:36 +0000 | |||
1410 | +++ pcbnew/router/pns_line.cpp 2013-12-04 08:51:30 +0000 | |||
1411 | @@ -29,7 +29,6 @@ | |||
1412 | 29 | #include "pns_utils.h" | 29 | #include "pns_utils.h" |
1413 | 30 | #include "pns_router.h" | 30 | #include "pns_router.h" |
1414 | 31 | 31 | ||
1415 | 32 | using namespace std; | ||
1416 | 33 | using boost::optional; | 32 | using boost::optional; |
1417 | 34 | 33 | ||
1418 | 35 | PNS_LINE* PNS_LINE::Clone() const | 34 | PNS_LINE* PNS_LINE::Clone() const |
1419 | @@ -321,10 +320,10 @@ | |||
1420 | 321 | 320 | ||
1421 | 322 | SHAPE_LINE_CHAIN l_orig( m_line ); | 321 | SHAPE_LINE_CHAIN l_orig( m_line ); |
1422 | 323 | SHAPE_LINE_CHAIN l_hull; | 322 | SHAPE_LINE_CHAIN l_hull; |
1424 | 324 | vector<bool> outside, on_edge, inside; | 323 | std::vector<bool> outside, on_edge, inside; |
1425 | 325 | SHAPE_LINE_CHAIN path; | 324 | SHAPE_LINE_CHAIN path; |
1426 | 326 | 325 | ||
1428 | 327 | vector<INTERSECTION> isects; | 326 | std::vector<INTERSECTION> isects; |
1429 | 328 | 327 | ||
1430 | 329 | // don't calculate walkaround for empty lines | 328 | // don't calculate walkaround for empty lines |
1431 | 330 | if( m_line.PointCount() < 2 ) | 329 | if( m_line.PointCount() < 2 ) |
1432 | 331 | 330 | ||
1433 | === modified file 'pcbnew/router/pns_line_placer.cpp' | |||
1434 | --- pcbnew/router/pns_line_placer.cpp 2013-10-14 18:40:36 +0000 | |||
1435 | +++ pcbnew/router/pns_line_placer.cpp 2013-12-04 08:51:30 +0000 | |||
1436 | @@ -18,7 +18,6 @@ | |||
1437 | 18 | * with this program. If not, see <http://www.gnu.or/licenses/>. | 18 | * with this program. If not, see <http://www.gnu.or/licenses/>. |
1438 | 19 | */ | 19 | */ |
1439 | 20 | 20 | ||
1440 | 21 | #include <vector> | ||
1441 | 22 | #include <boost/foreach.hpp> | 21 | #include <boost/foreach.hpp> |
1442 | 23 | #include <boost/optional.hpp> | 22 | #include <boost/optional.hpp> |
1443 | 24 | 23 | ||
1444 | @@ -30,7 +29,6 @@ | |||
1445 | 30 | #include "pns_shove.h" | 29 | #include "pns_shove.h" |
1446 | 31 | #include "pns_utils.h" | 30 | #include "pns_utils.h" |
1447 | 32 | 31 | ||
1448 | 33 | using namespace std; | ||
1449 | 34 | using boost::optional; | 32 | using boost::optional; |
1450 | 35 | 33 | ||
1451 | 36 | PNS_LINE_PLACER::PNS_LINE_PLACER( PNS_NODE* aWorld ) | 34 | PNS_LINE_PLACER::PNS_LINE_PLACER( PNS_NODE* aWorld ) |
1452 | @@ -528,7 +526,7 @@ | |||
1453 | 528 | 526 | ||
1454 | 529 | const int TailLookbackSegments = 5; | 527 | const int TailLookbackSegments = 5; |
1455 | 530 | 528 | ||
1457 | 531 | int threshold = min( tail.PointCount(), TailLookbackSegments + 1 ); | 529 | int threshold = std::min( tail.PointCount(), TailLookbackSegments + 1 ); |
1458 | 532 | 530 | ||
1459 | 533 | if( tail.SegmentCount() < 3 ) | 531 | if( tail.SegmentCount() < 3 ) |
1460 | 534 | return false; | 532 | return false; |
1461 | 535 | 533 | ||
1462 | === modified file 'pcbnew/router/pns_node.cpp' | |||
1463 | --- pcbnew/router/pns_node.cpp 2013-10-14 18:40:36 +0000 | |||
1464 | +++ pcbnew/router/pns_node.cpp 2013-12-04 08:51:30 +0000 | |||
1465 | @@ -37,8 +37,6 @@ | |||
1466 | 37 | #include "pns_joint.h" | 37 | #include "pns_joint.h" |
1467 | 38 | #include "pns_index.h" | 38 | #include "pns_index.h" |
1468 | 39 | 39 | ||
1469 | 40 | using namespace std; | ||
1470 | 41 | |||
1471 | 42 | using boost::unordered_set; | 40 | using boost::unordered_set; |
1472 | 43 | using boost::unordered_map; | 41 | using boost::unordered_map; |
1473 | 44 | 42 | ||
1474 | @@ -138,7 +136,7 @@ | |||
1475 | 138 | if( isRoot() ) | 136 | if( isRoot() ) |
1476 | 139 | return; | 137 | return; |
1477 | 140 | 138 | ||
1479 | 141 | for( vector<PNS_NODE*>::iterator i = m_parent->m_children.begin(); | 139 | for( std::vector<PNS_NODE*>::iterator i = m_parent->m_children.begin(); |
1480 | 142 | i != m_parent->m_children.end(); ++i ) | 140 | i != m_parent->m_children.end(); ++i ) |
1481 | 143 | { | 141 | { |
1482 | 144 | if( *i == this ) | 142 | if( *i == this ) |
1483 | @@ -284,7 +282,7 @@ | |||
1484 | 284 | VECTOR2I ip_first, ip_last; | 282 | VECTOR2I ip_first, ip_last; |
1485 | 285 | int dist_max = INT_MIN; | 283 | int dist_max = INT_MIN; |
1486 | 286 | 284 | ||
1488 | 287 | vector<SHAPE_LINE_CHAIN::INTERSECTION> isect_list; | 285 | std::vector<SHAPE_LINE_CHAIN::INTERSECTION> isect_list; |
1489 | 288 | 286 | ||
1490 | 289 | int clearance = GetClearance( obs.item, &aLine ); | 287 | int clearance = GetClearance( obs.item, &aLine ); |
1491 | 290 | 288 | ||
1492 | @@ -564,7 +562,7 @@ | |||
1493 | 564 | 562 | ||
1494 | 565 | void PNS_NODE::removeLine( PNS_LINE* aLine ) | 563 | void PNS_NODE::removeLine( PNS_LINE* aLine ) |
1495 | 566 | { | 564 | { |
1497 | 567 | vector<PNS_SEGMENT*>* segRefs = aLine->GetLinkedSegments(); | 565 | std::vector<PNS_SEGMENT*>* segRefs = aLine->GetLinkedSegments(); |
1498 | 568 | 566 | ||
1499 | 569 | if( !segRefs ) | 567 | if( !segRefs ) |
1500 | 570 | return; | 568 | return; |
1501 | @@ -700,7 +698,7 @@ | |||
1502 | 700 | } | 698 | } |
1503 | 701 | 699 | ||
1504 | 702 | 700 | ||
1506 | 703 | int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& a, PNS_JOINT& b, vector<PNS_LINE*>& aLines ) | 701 | int PNS_NODE::FindLinesBetweenJoints( PNS_JOINT& a, PNS_JOINT& b, std::vector<PNS_LINE*>& aLines ) |
1507 | 704 | { | 702 | { |
1508 | 705 | BOOST_FOREACH( PNS_ITEM* item, a.GetLinkList() ) | 703 | BOOST_FOREACH( PNS_ITEM* item, a.GetLinkList() ) |
1509 | 706 | { | 704 | { |
1510 | @@ -763,7 +761,7 @@ | |||
1511 | 763 | // try to find the joint in this node. | 761 | // try to find the joint in this node. |
1512 | 764 | JointMap::iterator f = m_joints.find( tag ); | 762 | JointMap::iterator f = m_joints.find( tag ); |
1513 | 765 | 763 | ||
1515 | 766 | pair<JointMap::iterator, JointMap::iterator> range; | 764 | std::pair<JointMap::iterator, JointMap::iterator> range; |
1516 | 767 | 765 | ||
1517 | 768 | // not found and we are not root? find in the root and copy results here. | 766 | // not found and we are not root? find in the root and copy results here. |
1518 | 769 | if( f == m_joints.end() && !isRoot() ) | 767 | if( f == m_joints.end() && !isRoot() ) |
1519 | @@ -895,7 +893,7 @@ | |||
1520 | 895 | printf( "Line: %s, net %d ", l->GetLine().Format().c_str(), l->GetNet() ); | 893 | printf( "Line: %s, net %d ", l->GetLine().Format().c_str(), l->GetNet() ); |
1521 | 896 | 894 | ||
1522 | 897 | 895 | ||
1524 | 898 | for( vector<PNS_SEGMENT*>::iterator j = seg_refs->begin(); j != seg_refs->end(); ++j ) | 896 | for( std::vector<PNS_SEGMENT*>::iterator j = seg_refs->begin(); j != seg_refs->end(); ++j ) |
1525 | 899 | { | 897 | { |
1526 | 900 | printf( "%s ", (*j)->GetSeg().A.Format().c_str() ); | 898 | printf( "%s ", (*j)->GetSeg().A.Format().c_str() ); |
1527 | 901 | 899 | ||
1528 | @@ -932,7 +930,7 @@ | |||
1529 | 932 | void PNS_NODE::releaseChildren() | 930 | void PNS_NODE::releaseChildren() |
1530 | 933 | { | 931 | { |
1531 | 934 | // copy the kids as the PNS_NODE destructor erases the item from the parent node. | 932 | // copy the kids as the PNS_NODE destructor erases the item from the parent node. |
1533 | 935 | vector<PNS_NODE*> kids = m_children; | 933 | std::vector<PNS_NODE*> kids = m_children; |
1534 | 936 | 934 | ||
1535 | 937 | BOOST_FOREACH( PNS_NODE * node, kids ) { | 935 | BOOST_FOREACH( PNS_NODE * node, kids ) { |
1536 | 938 | node->releaseChildren(); | 936 | node->releaseChildren(); |
1537 | 939 | 937 | ||
1538 | === modified file 'pcbnew/router/pns_optimizer.cpp' | |||
1539 | --- pcbnew/router/pns_optimizer.cpp 2013-10-14 18:40:36 +0000 | |||
1540 | +++ pcbnew/router/pns_optimizer.cpp 2013-12-04 08:51:30 +0000 | |||
1541 | @@ -28,8 +28,6 @@ | |||
1542 | 28 | #include "pns_optimizer.h" | 28 | #include "pns_optimizer.h" |
1543 | 29 | #include "pns_utils.h" | 29 | #include "pns_utils.h" |
1544 | 30 | 30 | ||
1545 | 31 | using namespace std; | ||
1546 | 32 | |||
1547 | 33 | /** | 31 | /** |
1548 | 34 | * | 32 | * |
1549 | 35 | * Cost Estimator Methods | 33 | * Cost Estimator Methods |
1550 | @@ -620,8 +618,8 @@ | |||
1551 | 620 | const int ForbiddenAngles = DIRECTION_45::ANG_ACUTE | DIRECTION_45::ANG_RIGHT | | 618 | const int ForbiddenAngles = DIRECTION_45::ANG_ACUTE | DIRECTION_45::ANG_RIGHT | |
1552 | 621 | DIRECTION_45::ANG_HALF_FULL | DIRECTION_45::ANG_UNDEFINED; | 619 | DIRECTION_45::ANG_HALF_FULL | DIRECTION_45::ANG_UNDEFINED; |
1553 | 622 | 620 | ||
1556 | 623 | typedef pair<int, SHAPE_LINE_CHAIN> RtVariant; | 621 | typedef std::pair<int, SHAPE_LINE_CHAIN> RtVariant; |
1557 | 624 | vector<RtVariant> variants; | 622 | std::vector<RtVariant> variants; |
1558 | 625 | 623 | ||
1559 | 626 | BreakoutList breakouts = computeBreakouts( aLine->GetWidth(), aPad, true ); | 624 | BreakoutList breakouts = computeBreakouts( aLine->GetWidth(), aPad, true ); |
1560 | 627 | 625 | ||
1561 | @@ -629,7 +627,7 @@ | |||
1562 | 629 | 627 | ||
1563 | 630 | // bool startDiagonal = DIRECTION_45( line.CSegment(0) ).IsDiagonal(); | 628 | // bool startDiagonal = DIRECTION_45( line.CSegment(0) ).IsDiagonal(); |
1564 | 631 | 629 | ||
1566 | 632 | int p_end = min( aEndVertex, min( 3, line.PointCount() - 1 ) ); | 630 | int p_end = std::min( aEndVertex, std::min( 3, line.PointCount() - 1 ) ); |
1567 | 633 | 631 | ||
1568 | 634 | for( int p = 1; p <= p_end; p++ ) | 632 | for( int p = 1; p <= p_end; p++ ) |
1569 | 635 | { | 633 | { |
1570 | 636 | 634 | ||
1571 | === modified file 'pcbnew/router/pns_router.cpp' | |||
1572 | --- pcbnew/router/pns_router.cpp 2013-10-14 18:40:36 +0000 | |||
1573 | +++ pcbnew/router/pns_router.cpp 2013-12-04 08:51:30 +0000 | |||
1574 | @@ -51,8 +51,6 @@ | |||
1575 | 51 | #include <class_track.h> | 51 | #include <class_track.h> |
1576 | 52 | #include <layers_id_colors_and_visibility.h> | 52 | #include <layers_id_colors_and_visibility.h> |
1577 | 53 | 53 | ||
1578 | 54 | using namespace std; | ||
1579 | 55 | |||
1580 | 56 | // an ugly singleton for drawing debug items within the router context. | 54 | // an ugly singleton for drawing debug items within the router context. |
1581 | 57 | // To be fixed sometime in the future. | 55 | // To be fixed sometime in the future. |
1582 | 58 | static PNS_ROUTER* theRouter; | 56 | static PNS_ROUTER* theRouter; |
1583 | @@ -89,7 +87,7 @@ | |||
1584 | 89 | } | 87 | } |
1585 | 90 | 88 | ||
1586 | 91 | private: | 89 | private: |
1588 | 92 | vector<int> m_clearanceCache; | 90 | std::vector<int> m_clearanceCache; |
1589 | 93 | int m_defaultClearance; | 91 | int m_defaultClearance; |
1590 | 94 | }; | 92 | }; |
1591 | 95 | 93 | ||
1592 | @@ -232,7 +230,7 @@ | |||
1593 | 232 | 230 | ||
1594 | 233 | void PNS_ROUTER::SyncWorld() | 231 | void PNS_ROUTER::SyncWorld() |
1595 | 234 | { | 232 | { |
1597 | 235 | vector<D_PAD*> pads; | 233 | std::vector<D_PAD*> pads; |
1598 | 236 | 234 | ||
1599 | 237 | if( !m_board ) | 235 | if( !m_board ) |
1600 | 238 | { | 236 | { |
1601 | @@ -662,7 +660,7 @@ | |||
1602 | 662 | PNS_NODE* cleaned = aNode->Branch(); | 660 | PNS_NODE* cleaned = aNode->Branch(); |
1603 | 663 | PNS_JOINT a, b; | 661 | PNS_JOINT a, b; |
1604 | 664 | 662 | ||
1606 | 665 | vector<PNS_LINE*> lines; | 663 | std::vector<PNS_LINE*> lines; |
1607 | 666 | 664 | ||
1608 | 667 | cleaned->FindLineEnds( ourLine, a, b ); | 665 | cleaned->FindLineEnds( ourLine, a, b ); |
1609 | 668 | cleaned->FindLinesBetweenJoints( a, b, lines ); | 666 | cleaned->FindLinesBetweenJoints( a, b, lines ); |
1610 | @@ -699,7 +697,7 @@ | |||
1611 | 699 | if( aEndItem && m_currentNet >= 0 && m_currentNet == aEndItem->GetNet() ) | 697 | if( aEndItem && m_currentNet >= 0 && m_currentNet == aEndItem->GetNet() ) |
1612 | 700 | real_end = true; | 698 | real_end = true; |
1613 | 701 | 699 | ||
1615 | 702 | int last = ( real_end || m_placingVia ) ? l.SegmentCount() : max( 1, l.SegmentCount() - 1 ); | 700 | int last = ( real_end || m_placingVia ) ? l.SegmentCount() : std::max( 1, l.SegmentCount() - 1 ); |
1616 | 703 | 701 | ||
1617 | 704 | PNS_NODE* latest = m_placer->GetCurrentNode(); | 702 | PNS_NODE* latest = m_placer->GetCurrentNode(); |
1618 | 705 | 703 | ||
1619 | @@ -771,7 +769,7 @@ | |||
1620 | 771 | if( m_placer->GetTail().GetCLine().SegmentCount() == 0 ) | 769 | if( m_placer->GetTail().GetCLine().SegmentCount() == 0 ) |
1621 | 772 | { | 770 | { |
1622 | 773 | m_start_diagonal = !m_start_diagonal; | 771 | m_start_diagonal = !m_start_diagonal; |
1624 | 774 | m_placer->SetInitialDirection( m_start_diagonal ? | 772 | m_placer->SetInitialDirection( m_start_diagonal ? |
1625 | 775 | DIRECTION_45( DIRECTION_45::NE ) : DIRECTION_45( DIRECTION_45::N ) ); | 773 | DIRECTION_45( DIRECTION_45::NE ) : DIRECTION_45( DIRECTION_45::N ) ); |
1626 | 776 | } | 774 | } |
1627 | 777 | else | 775 | else |
1628 | 778 | 776 | ||
1629 | === modified file 'pcbnew/router/pns_shove.cpp' | |||
1630 | --- pcbnew/router/pns_shove.cpp 2013-11-27 08:46:59 +0000 | |||
1631 | +++ pcbnew/router/pns_shove.cpp 2013-12-04 08:51:30 +0000 | |||
1632 | @@ -35,8 +35,6 @@ | |||
1633 | 35 | 35 | ||
1634 | 36 | #include <profile.h> | 36 | #include <profile.h> |
1635 | 37 | 37 | ||
1636 | 38 | using namespace std; | ||
1637 | 39 | |||
1638 | 40 | PNS_SHOVE::PNS_SHOVE( PNS_NODE* aWorld ) | 38 | PNS_SHOVE::PNS_SHOVE( PNS_NODE* aWorld ) |
1639 | 41 | { | 39 | { |
1640 | 42 | m_root = aWorld; | 40 | m_root = aWorld; |
1641 | @@ -280,9 +278,9 @@ | |||
1642 | 280 | 278 | ||
1643 | 281 | PNS_SHOVE::ShoveStatus PNS_SHOVE::ShoveLines( PNS_LINE* aCurrentHead ) | 279 | PNS_SHOVE::ShoveStatus PNS_SHOVE::ShoveLines( PNS_LINE* aCurrentHead ) |
1644 | 282 | { | 280 | { |
1646 | 283 | stack <PNS_LINE*> lineStack; | 281 | std::stack<PNS_LINE*> lineStack; |
1647 | 284 | PNS_NODE* node, * parent; | 282 | PNS_NODE* node, * parent; |
1649 | 285 | PNS_VIA* headVia = NULL; | 283 | PNS_VIA* headVia = NULL; |
1650 | 286 | bool fail = false; | 284 | bool fail = false; |
1651 | 287 | int iter = 0; | 285 | int iter = 0; |
1652 | 288 | 286 | ||
1653 | 289 | 287 | ||
1654 | === modified file 'pcbnew/router/pns_walkaround.cpp' | |||
1655 | --- pcbnew/router/pns_walkaround.cpp 2013-10-14 18:40:36 +0000 | |||
1656 | +++ pcbnew/router/pns_walkaround.cpp 2013-12-04 08:51:30 +0000 | |||
1657 | @@ -18,8 +18,6 @@ | |||
1658 | 18 | * with this program. If not, see <http://www.gnu.or/licenses/>. | 18 | * with this program. If not, see <http://www.gnu.or/licenses/>. |
1659 | 19 | */ | 19 | */ |
1660 | 20 | 20 | ||
1661 | 21 | #include <vector> | ||
1662 | 22 | |||
1663 | 23 | #include <boost/foreach.hpp> | 21 | #include <boost/foreach.hpp> |
1664 | 24 | #include <boost/optional.hpp> | 22 | #include <boost/optional.hpp> |
1665 | 25 | 23 | ||
1666 | @@ -29,8 +27,6 @@ | |||
1667 | 29 | #include "pns_optimizer.h" | 27 | #include "pns_optimizer.h" |
1668 | 30 | #include "pns_utils.h" | 28 | #include "pns_utils.h" |
1669 | 31 | #include "pns_router.h" | 29 | #include "pns_router.h" |
1670 | 32 | |||
1671 | 33 | using namespace std; | ||
1672 | 34 | using boost::optional; | 30 | using boost::optional; |
1673 | 35 | 31 | ||
1674 | 36 | void PNS_WALKAROUND::start( const PNS_LINE& aInitialPath ) | 32 | void PNS_WALKAROUND::start( const PNS_LINE& aInitialPath ) |
1675 | 37 | 33 | ||
1676 | === modified file 'pcbnew/router/router_tool.cpp' | |||
1677 | --- pcbnew/router/router_tool.cpp 2013-10-15 08:41:00 +0000 | |||
1678 | +++ pcbnew/router/router_tool.cpp 2013-12-04 08:51:30 +0000 | |||
1679 | @@ -39,7 +39,6 @@ | |||
1680 | 39 | #include "trace.h" | 39 | #include "trace.h" |
1681 | 40 | 40 | ||
1682 | 41 | using namespace KIGFX; | 41 | using namespace KIGFX; |
1683 | 42 | using namespace std; | ||
1684 | 43 | using boost::optional; | 42 | using boost::optional; |
1685 | 44 | 43 | ||
1686 | 45 | static TOOL_ACTION ACT_AutoEndRoute( "AutoEndRoute", AS_CONTEXT, 'F' ); | 44 | static TOOL_ACTION ACT_AutoEndRoute( "AutoEndRoute", AS_CONTEXT, 'F' ); |
1687 | 46 | 45 | ||
1688 | === modified file 'polygon/SutherlandHodgmanClipPoly.h' | |||
1689 | --- polygon/SutherlandHodgmanClipPoly.h 2009-02-20 14:31:16 +0000 | |||
1690 | +++ polygon/SutherlandHodgmanClipPoly.h 2013-12-04 08:51:30 +0000 | |||
1691 | @@ -31,7 +31,6 @@ | |||
1692 | 31 | #include <vector> | 31 | #include <vector> |
1693 | 32 | #include <functional> | 32 | #include <functional> |
1694 | 33 | 33 | ||
1695 | 34 | using namespace std; | ||
1696 | 35 | #ifndef _GDIPLUS_H | 34 | #ifndef _GDIPLUS_H |
1697 | 36 | 35 | ||
1698 | 37 | // I designed this with GDI+ in mind. However, this particular code doesn't | 36 | // I designed this with GDI+ in mind. However, this particular code doesn't |
1699 | @@ -80,9 +79,9 @@ | |||
1700 | 80 | 79 | ||
1701 | 81 | #endif // _GDIPLUS_H | 80 | #endif // _GDIPLUS_H |
1702 | 82 | 81 | ||
1706 | 83 | typedef vector<PointF> pointVector; | 82 | typedef std::vector<PointF> pointVector; |
1707 | 84 | typedef vector<PointF>::iterator pointIterator; | 83 | typedef std::vector<PointF>::iterator pointIterator; |
1708 | 85 | typedef vector<PointF>::const_iterator cpointIterator; | 84 | typedef std::vector<PointF>::const_iterator cpointIterator; |
1709 | 86 | 85 | ||
1710 | 87 | class SutherlandHodgman | 86 | class SutherlandHodgman |
1711 | 88 | { | 87 | { |
1712 | @@ -249,10 +248,10 @@ | |||
1713 | 249 | // rectangles, we include the left and top boundaries, but not the right and bottom boundaries. | 248 | // rectangles, we include the left and top boundaries, but not the right and bottom boundaries. |
1714 | 250 | // In other words: a vertex on the left boundary is considered to be inside, but a vertex | 249 | // In other words: a vertex on the left boundary is considered to be inside, but a vertex |
1715 | 251 | // on the right boundary is considered to be outside. | 250 | // on the right boundary is considered to be outside. |
1720 | 252 | typedef BoundaryVert < less<REAL> > BoundaryRight; | 251 | typedef BoundaryVert<std::less<REAL> > BoundaryRight; |
1721 | 253 | typedef BoundaryHor < greater_equal<REAL> > BoundaryTop; | 252 | typedef BoundaryHor<std::greater_equal<REAL> > BoundaryTop; |
1722 | 254 | typedef BoundaryVert < greater_equal<REAL> > BoundaryLeft; | 253 | typedef BoundaryVert<std::greater_equal<REAL> > BoundaryLeft; |
1723 | 255 | typedef BoundaryHor < less<REAL> > BoundaryBottom; | 254 | typedef BoundaryHor<std::less<REAL> > BoundaryBottom; |
1724 | 256 | 255 | ||
1725 | 257 | // Next typedefs define the four stages. First template parameter is the boundary, | 256 | // Next typedefs define the four stages. First template parameter is the boundary, |
1726 | 258 | // second template parameter is the next stage. | 257 | // second template parameter is the next stage. |
1727 | 259 | 258 | ||
1728 | === modified file 'polygon/poly2tri/common/shapes.cc' | |||
1729 | --- polygon/poly2tri/common/shapes.cc 2013-09-13 13:28:20 +0000 | |||
1730 | +++ polygon/poly2tri/common/shapes.cc 2013-12-04 08:51:30 +0000 | |||
1731 | @@ -1,4 +1,4 @@ | |||
1733 | 1 | /* | 1 | /* |
1734 | 2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors | 2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors |
1735 | 3 | * http://code.google.com/p/poly2tri/ | 3 | * http://code.google.com/p/poly2tri/ |
1736 | 4 | * | 4 | * |
1737 | @@ -96,14 +96,14 @@ | |||
1738 | 96 | } | 96 | } |
1739 | 97 | else if( neighbors_[1] == triangle ) | 97 | else if( neighbors_[1] == triangle ) |
1740 | 98 | { | 98 | { |
1742 | 99 | neighbors_[1] = NULL; | 99 | neighbors_[1] = NULL; |
1743 | 100 | } | 100 | } |
1744 | 101 | else | 101 | else |
1745 | 102 | { | 102 | { |
1746 | 103 | neighbors_[2] = NULL; | 103 | neighbors_[2] = NULL; |
1747 | 104 | } | 104 | } |
1748 | 105 | } | 105 | } |
1750 | 106 | 106 | ||
1751 | 107 | void Triangle::ClearNeighbors() | 107 | void Triangle::ClearNeighbors() |
1752 | 108 | { | 108 | { |
1753 | 109 | neighbors_[0] = NULL; | 109 | neighbors_[0] = NULL; |
1754 | @@ -357,10 +357,9 @@ | |||
1755 | 357 | 357 | ||
1756 | 358 | void Triangle::DebugPrint() | 358 | void Triangle::DebugPrint() |
1757 | 359 | { | 359 | { |
1762 | 360 | using namespace std; | 360 | std::cout << points_[0]->x << "," << points_[0]->y << " "; |
1763 | 361 | cout << points_[0]->x << "," << points_[0]->y << " "; | 361 | std::cout << points_[1]->x << "," << points_[1]->y << " "; |
1764 | 362 | cout << points_[1]->x << "," << points_[1]->y << " "; | 362 | std::cout << points_[2]->x << "," << points_[2]->y << "\n"; |
1761 | 363 | cout << points_[2]->x << "," << points_[2]->y << endl; | ||
1765 | 364 | } | 363 | } |
1766 | 365 | 364 | ||
1767 | 366 | } | 365 | } |
1768 | 367 | 366 | ||
1769 | === modified file 'scripting/kicad.i' | |||
1770 | --- scripting/kicad.i 2013-11-01 15:29:50 +0000 | |||
1771 | +++ scripting/kicad.i 2013-12-04 08:51:30 +0000 | |||
1772 | @@ -63,8 +63,6 @@ | |||
1773 | 63 | #include <cstddef> | 63 | #include <cstddef> |
1774 | 64 | #include <vector> | 64 | #include <vector> |
1775 | 65 | 65 | ||
1776 | 66 | using namespace std; | ||
1777 | 67 | |||
1778 | 68 | #include <class_title_block.h> | 66 | #include <class_title_block.h> |
1779 | 69 | #include <class_colors_design_settings.h> | 67 | #include <class_colors_design_settings.h> |
1780 | 70 | #include <class_marker_base.h> | 68 | #include <class_marker_base.h> |
I wish we had added this text to the coding standards:
******* ******* ******* *****
The project should never use 'using namespace ...' in a header file, but using
it in a *.cpp file is OK, according to the author of the *.cpp file's preference.
If it occurs in a *.cpp file, it must occur after any #include statements.
******* ******* ******* *****
The consequences of that make it impossible not to use std:: for all STL objects which
present themselves in a header file. This is the public API.
The above policy also gives the implementation author the freedom of brevity in a file which is not affecting usage of the API in (client callaing) *.cpp files.
I personally have followed this policy in everything I've contributed, never once put a "using namespace" into a header file. I was not aware that we had strayed from this common sense approach.
So I only like about 25% of this patch, because for my *.cpp files, I really don't care to see them be changed in a way other than I wrote them for something other than a bug. Of course, this is an understatement.
It is general, not limited to me. It is respectful of the original author's wishes, the person who we often call upon to *support* the code when something goes wrong.