Skip to content

Commit 9bee76d

Browse files
committed
Cleanup
Signed-off-by: Krzysztof Boronski <[email protected]>
1 parent f3bf2be commit 9bee76d

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

libs/libtclcpp/src/tclcpp.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@ TclDynList::TclDynList(Tcl_Interp* interp, Tcl_Obj* obj)
134134
if (obj_type == nullptr)
135135
return;
136136

137-
if (obj_type == nullptr || std::strcmp(obj_type->name, "list")) {
138-
Tcl_Obj* item;
137+
if (obj_type == nullptr || std::strcmp(obj_type->name, "list"))
139138
this->_obj = Tcl_NewListObj(1, &obj);
140-
} else {
139+
else
141140
this->_obj = obj;
142-
}
143141
}
144142

145143
TclDynList tcl_obj_getdynlist (TclClient* client, Tcl_Obj* obj) {
@@ -151,7 +149,7 @@ Tcl_Obj* TclDynList::operator[](size_t idx) {
151149
Tcl_Obj* objp;
152150

153151
Tcl_ListObjLength(this->_interp, this->_obj, &count);
154-
if (idx >= count)
152+
if (idx >= size_t(count))
155153
return nullptr;
156154
Tcl_ListObjIndex(this->_interp, this->_obj, idx, &objp);
157155

libs/libtclcpp/src/tclcpp.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ class TclList {
159159
* Client must point to the concrete TclClient instance.
160160
*/
161161
template<typename Container>
162-
TclList(Tcl_Interp* interp, void* client, Container&& elements) {
162+
TclList(Tcl_Interp* interp, void* client, Container&& elements)
163+
: _interp(interp) {
163164
std::vector<Tcl_Obj*> tcl_objs;
164165
for (auto&& elem : elements) {
165166
Tcl_Obj* obj = Tcl_MoveCppObject(client, elem);
@@ -179,12 +180,10 @@ class TclList {
179180
if (obj_type == nullptr)
180181
return;
181182

182-
if (obj_type == nullptr || std::strcmp(obj_type->name, "list")) {
183-
Tcl_Obj* item;
183+
if (obj_type == nullptr || std::strcmp(obj_type->name, "list"))
184184
this->_obj = Tcl_NewListObj(1, &obj);
185-
} else {
185+
else
186186
this->_obj = obj;
187-
}
188187
}
189188

190189
/**
@@ -239,8 +238,8 @@ class TclList {
239238

240239
Iterator(Tcl_Interp* interp, Tcl_Obj* obj, int idx)
241240
: _interp(interp)
242-
, _obj(obj)
243-
, _idx(idx) {}
241+
, _idx(idx)
242+
, _obj(obj) {}
244243

245244
protected:
246245
Tcl_Interp* _interp;
@@ -342,8 +341,8 @@ class TclDynList {
342341

343342
inline Iterator(Tcl_Interp* interp, Tcl_Obj* obj, int idx)
344343
: _interp(interp)
345-
, _obj(obj)
346-
, _idx(idx) {}
344+
, _idx(idx)
345+
, _obj(obj) {}
347346

348347
protected:
349348
Tcl_Interp* _interp;
@@ -486,7 +485,7 @@ class TclClient {
486485
}
487486

488487
template<typename T>
489-
int _ret_list(void* this_, TclList<T>& list) {
488+
int _ret_list(TclList<T>& list) {
490489
this->object = list.tcl_obj();
491490
this->cmd_status = e_TclCommandStatus::TCL_CMD_SUCCESS_LIST;
492491

vpr/src/base/xdc_constraints.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class TclPhysicalConstraintsClient : public TclClient {
8787

8888
std::vector<const char*> port_names;
8989

90-
for (size_t i = 1; i < objc; i++) {
90+
for (int i = 1; i < objc; i++) {
9191
const char* pin_name = Tcl_GetString(objvp[i]);
9292
if (pin_name == nullptr)
9393
return this->_ret_error("get_ports: pin_name should be a string.");
@@ -98,6 +98,8 @@ class TclPhysicalConstraintsClient : public TclClient {
9898
}
9999

100100
int get_cells(int objc, Tcl_Obj* const objvp[]) {
101+
(void)objc;
102+
(void)objvp;
101103
return this->_ret_error("get_cells: unimplemented");
102104
}
103105

@@ -167,7 +169,6 @@ class TclPhysicalConstraintsClient : public TclClient {
167169
}
168170

169171
int _do_set_property_iostandard(const char* io_standard, TclList<AtomPortId>& ports) {
170-
auto iterator = ports.begin();
171172
for (auto port : ports) {
172173
if (port == nullptr)
173174
return this->_ret_error("set_property: port_name of IOSTANDARD should have a `AtomPortId` type.");
@@ -190,7 +191,7 @@ class TclPhysicalConstraintsClient : public TclClient {
190191
}
191192

192193
auto port_list = this->_list<AtomPortId, decltype(port_ids)>(this, std::move(port_ids));
193-
this->_ret_list<AtomPortId>(reinterpret_cast<void*>(this), port_list);
194+
return this->_ret_list<AtomPortId>(port_list);
194195
}
195196

196197
int _do_get_port(const char* pin_name, AtomPortId* port_) {

vpr/src/base/xdc_constraints.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class XDCStream {
3333
*
3434
* This function may modify the netlist by changing its blocks' properties.
3535
*/
36-
VprConstraints read_xdc_constraints_to_vpr(std::vector<XDCStream>& xdc_streams, const t_arch& arch, AtomNetlist& netlist);
36+
VprConstraints read_xdc_constraints_to_vpr(std::vector<XDCStream>&& xdc_streams, const t_arch& arch, AtomNetlist& netlist);
3737

3838
/**
3939
* @brief Parse a file in XDC format and apply it to global FloorplanningContext.

0 commit comments

Comments
 (0)