From 0e3a1fdca98705e8e8fe49d3fbc9cae031fe1474 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 17 May 2024 18:15:12 +0800 Subject: [PATCH] - fix: In compiler options page, Can't save default stack size to 0MB. --- NEWS.md | 5 +++-- RedPandaIDE/compiler/compiler.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 92392793..0862ca8e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,8 +2,9 @@ Red Panda C++ Version 3.1 - fix: Can't correctly select in column mode. - fix: Can't correctly parse template parameters that contains "->", like "std::queuevoid>>"; - - fix: Shouldn't warn "xxx.s is modifed" when "Generate assembly" is reran. - - fix: Shouldn't warn "Makefile is modifed" when "View Makefile" is reran. + - fix: Shouldn't warn "xxx.s is modifed" when "Generate assembly" is rerun. + - fix: Shouldn't warn "Makefile is modifed" when "View Makefile" is rerun. + - fix: In compiler options page, Can't save default stack size to 0MB. Red Panda C++ Version 3.0 diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index 8e7b31e6..d0324a37 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -436,7 +436,7 @@ QStringList Compiler::getCCompileArguments(bool checkSyntax) else if (pOption->type == CompilerOptionType::Number) { bool ok; int val = compileOptions[key].toInt(&ok); - if (ok) { + if (ok && val>0) { val = pOption->scale * val; result += QString("%1%2").arg(pOption->setting).arg(val); } @@ -490,7 +490,7 @@ QStringList Compiler::getCppCompileArguments(bool checkSyntax) else if (pOption->type == CompilerOptionType::Number) { bool ok; int val = compileOptions[key].toInt(&ok); - if (ok) { + if (ok && val>0) { val = pOption->scale * val; result += QString("%1%2").arg(pOption->setting).arg(val); } @@ -607,7 +607,7 @@ QStringList Compiler::getLibraryArguments(FileType fileType) else if (pOption->type == CompilerOptionType::Number) { bool ok; int val = compileOptions[key].toInt(&ok); - if (ok) { + if (ok && val>0) { val = pOption->scale * val; result += QString("%1%2").arg(pOption->setting).arg(val); }