Skip to content

Commit

Permalink
Merge pull request #957 from ThomasZecha/current
Browse files Browse the repository at this point in the history
Fix build issues
  • Loading branch information
ra3xdh authored Sep 24, 2024
2 parents 4a9a5a4 + ca16d22 commit 0a0a477
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions qucs/components/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ QString Component::netlist() {
QString Component::form_spice_param_list(QStringList &ignore_list, QStringList &convert_list) {
QString par_str = "";

for (unsigned int i = 0; i < Props.count(); i++) {
for (int i = 0; i < Props.count(); i++) {
if (!ignore_list.contains(Props.at(i)->Name)) {
QString unit, nam;
if (convert_list.contains(Props.at(i)->Name)) {
Expand Down Expand Up @@ -1112,7 +1112,7 @@ bool Component::load(const QString &_s) {
(*p1)->Name = n.section('=', 0, 0);
n = n.section('=', 1);
// allocate memory for a new property (e.g. for equations)
if (Props.size() < (counts >> 1)) {
if (static_cast<unsigned int>(Props.size()) < (counts >> 1)) {
int index = std::distance(Props.begin(), p1);
Props.insert(index + 1, new Property("y", "1", true));
p1 = Props.begin() + index;
Expand Down
2 changes: 1 addition & 1 deletion qucs/components/diode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ QString Diode::spice_netlist(bool isXyce)
QString par_str;
//= form_spice_param_list(spice_incompat,spice_tr);

for (unsigned int i=0;i<Props.count();i++) {
for (int i=0;i<Props.count();i++) {
if (!spice_incompat.contains(Props.at(i)->Name)) {
if (Props.at(i)->Name == "Ikf") { // Bug Ngspice37
if (Props.at(i)->Value == "0") continue; // convergence error if Ikf=0
Expand Down
12 changes: 6 additions & 6 deletions qucs/components/equation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Element* Equation::info(QString& Name, char* &BitmapFile, bool getNewOne)
QString Equation::getVAvariables()
{
QStringList vars;
for (unsigned int i=0;i<Props.count()-1;i++) {
for (int i=0;i<Props.count()-1;i++) {
vars.append(Props.at(i)->Name);
}

Expand All @@ -107,7 +107,7 @@ QString Equation::getVAvariables()
QString Equation::getVAExpressions()
{
QString s;
for (unsigned int i=0;i<Props.count()-1;i++) {
for (int i=0;i<Props.count()-1;i++) {
QStringList tokens;
spicecompat::splitEqn(Props.at(i)->Value,tokens);
vacompat::convert_functions(tokens);
Expand Down Expand Up @@ -138,7 +138,7 @@ QString Equation::getExpression(bool isXyce)
QRegularExpression spicefp_pattern("^[\\+\\-]*\\d*\\.\\d+[A-Za-z]{,3}$"); // float and scaling suffix
QRegularExpression spicedec_pattern("^[\\+\\-]*\\d+[A-Za-z]{,3}$"); // decimal and scaling suffix

for (unsigned int i=0;i<Props.count()-1;i++) {
for (int i=0;i<Props.count()-1;i++) {
QStringList tokens;
QString eqn = Props.at(i)->Value;
spicecompat::splitEqn(eqn,tokens);
Expand Down Expand Up @@ -179,7 +179,7 @@ QString Equation::getEquations(QString sim, QStringList &dep_vars)

QString s;
dep_vars.clear();
for (unsigned int i=0;i<Props.count()-1;i++) {
for (int i=0;i<Props.count()-1;i++) {
QStringList tokens;
QString eqn = Props.at(i)->Value;
spicecompat::splitEqn(eqn,tokens);
Expand Down Expand Up @@ -216,7 +216,7 @@ QString Equation::getNgspiceScript()
s.clear();
if (isActive != COMP_IS_ACTIVE) return QString("");

for (unsigned int i=0;i<Props.count()-1;i++) {
for (int i=0;i<Props.count()-1;i++) {
QStringList tokens;
QString eqn = Props.at(i)->Value;
spicecompat::splitEqn(eqn,tokens);
Expand All @@ -240,7 +240,7 @@ void Equation::getNgnutmegVars(QStringList &vars, QStringList &sims)
{
vars.clear();
sims.clear();
for (unsigned int i=0;i<Props.count()-1;i++) {
for (int i=0;i<Props.count()-1;i++) {
QStringList tokens;
QString eqn = Props.at(i)->Value;
spicecompat::splitEqn(eqn,tokens);
Expand Down
2 changes: 1 addition & 1 deletion qucs/components/source_ac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ QString Source_ac::netlist()
s += " "+p1->Connection->Name; // node names

// output all properties
for(unsigned int i=0; i <= Props.count()-2; i++)
for(int i=0; i <= Props.count()-2; i++)
if(Props.at(i)->Name != "EnableTran")
s += " "+Props.at(i)->Name+"=\""+Props.at(i)->Value+"\"";

Expand Down
2 changes: 1 addition & 1 deletion qucs/components/vacomponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ QString vacomponent::spice_netlist(bool isXyce)
QString tmp_model = QString("mod_%1_%2").arg(Model).arg(Name);
s += tmp_model + "\n";
QString par_str;
for(unsigned int i = 0; i < Props.count(); i++) {
for(int i = 0; i < Props.count(); i++) {
par_str += QString("%1=%2 ")
.arg(Props.at(i)->Name)
.arg(Props.at(i)->Value);
Expand Down
2 changes: 1 addition & 1 deletion qucs/components/volt_ac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ QString Volt_ac::netlist()
s += " "+p1->Connection->Name; // node names

// output all properties
for(unsigned int i=0; i <= Props.count()-3; i++)
for(int i=0; i <= Props.count()-3; i++)
if(Props.at(i)->Name != "Symbol")
s += " "+Props.at(i)->Name+"=\""+Props.at(i)->Value+"\"";

Expand Down
2 changes: 1 addition & 1 deletion qucs/components/vrect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ QString vRect::netlist()
s += " "+p1->Connection->Name; // node names

// output all properties
for(unsigned int i=0; i <= Props.count()-2; i++)
for(int i=0; i <= Props.count()-2; i++)
if(Props.at(i)->Name != "U0")
s += " "+Props.at(i)->Name+"=\""+Props.at(i)->Value+"\"";

Expand Down
4 changes: 0 additions & 4 deletions qucs/qucs_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,6 @@ void QucsApp::slotInsertEquation(bool on)
view->selElem = new Equation();
}

Schematic *Doc = (Schematic*)DocumentTab->currentWidget();

MouseMoveAction = &MouseActions::MMoveElement;
MousePressAction = &MouseActions::MPressElement;
}
Expand Down Expand Up @@ -475,8 +473,6 @@ void QucsApp::slotInsertGround(bool on)

view->selElem = new Ground();

Schematic *Doc = (Schematic*)DocumentTab->currentWidget();

MouseMoveAction = &MouseActions::MMoveElement;
MousePressAction = &MouseActions::MPressElement;
}
Expand Down
1 change: 0 additions & 1 deletion qucs/schematic_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,6 @@ void Schematic::propagateNode(QStringList& Collect,
Q3PtrList<Node> Cons;
Node *p2;
Wire *pw;
Element *pe;

Cons.append(pn);
for(p2 = Cons.first(); p2 != 0; p2 = Cons.next())
Expand Down
4 changes: 2 additions & 2 deletions qucs/spicecomponents/sp_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ QString SpiceOptions::getExpression(bool isXyce)
s.clear();
if (isXyce) {
s += QString(".OPTIONS %1 ").arg(Props.at(0)->Value);
for (unsigned int i=1;i<Props.count();i++) {
for (int i=1;i<Props.count();i++) {
s += QString(" %1 = %2 ").arg(Props.at(i)->Name).arg(Props.at(i)->Value);
}
s += "\n";
} else {
for (unsigned int i=1;i<Props.count();i++) {
for (int i=1;i<Props.count();i++) {
s += QString(".OPTION %1 = %2\n").arg(Props.at(i)->Name).arg(Props.at(i)->Value);
}
}
Expand Down

0 comments on commit 0a0a477

Please sign in to comment.