diff --git a/NEWS.md b/NEWS.md
index ce26f9ad..cdafc19a 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,8 @@
+Red Panda C++ Version 2.20
+
+ - change: Change compiler set option "Syntax error when object larger than" to "Syntax error when function frame larger than"
+ - fix: Projects created by some templates are not correct when editor's default encoding is not utf8.
+
Red Panda C++ Version 2.19
- fix: Crash when directive line ends with '\' and at the last line.
diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro
index 8c06bf85..cdbd5981 100644
--- a/RedPandaIDE/RedPandaIDE.pro
+++ b/RedPandaIDE/RedPandaIDE.pro
@@ -8,7 +8,7 @@ isEmpty(APP_NAME) {
}
isEmpty(APP_VERSION) {
- APP_VERSION = 2.19
+ APP_VERSION = 2.20
}
contains(QMAKE_HOST.arch, x86_64):{
diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp
index c1701182..064a82cd 100644
--- a/RedPandaIDE/compiler/compiler.cpp
+++ b/RedPandaIDE/compiler/compiler.cpp
@@ -424,9 +424,9 @@ QString Compiler::getCCompileArguments(bool checkSyntax)
result += " "+ parseMacros(param);
}
} else {
- if (compilerSet()->maxObjectSize()>0 && compilerSet()->warnLargeObject()) {
- long long size = std::ceil(compilerSet()->maxObjectSize()*1024*1024);
- result += QString(" -Werror=larger-than-%1").arg(size);
+ if (compilerSet()->maxFrameSize()>0 && compilerSet()->warnLargeFrame()) {
+ long long size = std::ceil(compilerSet()->maxFrameSize()*1024*1024);
+ result += QString(" -Werror=frame-larger-than=%1").arg(size);
}
}
return result;
@@ -469,9 +469,9 @@ QString Compiler::getCppCompileArguments(bool checkSyntax)
result += " "+ parseMacros(param);
}
} else {
- if (compilerSet()->maxObjectSize()>0 && compilerSet()->warnLargeObject()) {
- long long size = std::ceil(compilerSet()->maxObjectSize()*1024*1024);
- result += QString(" -Werror=larger-than-%1").arg(size);
+ if (compilerSet()->maxFrameSize()>0 && compilerSet()->warnLargeFrame()) {
+ long long size = std::ceil(compilerSet()->maxFrameSize()*1024*1024);
+ result += QString(" -Werror=frame-larger-than=%1").arg(size);
}
}
return result;
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index 1e40373c..e798d70b 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -1669,7 +1669,7 @@ Settings::CompilerSet::CompilerSet():
mAutoAddCharsetParams{false},
mExecCharset{ENCODING_SYSTEM_DEFAULT},
mStaticLink{false},
- mMaxObjectSize{0},
+ mMaxFrameSize{0},
mWarnLargeObject{false},
mPreprocessingSuffix{DEFAULT_PREPROCESSING_SUFFIX},
mCompilationProperSuffix{DEFAULT_COMPILATION_SUFFIX},
@@ -1685,7 +1685,7 @@ Settings::CompilerSet::CompilerSet(const QString& compilerFolder, const QString&
mAutoAddCharsetParams{true},
mExecCharset{ENCODING_SYSTEM_DEFAULT},
mStaticLink{true},
- mMaxObjectSize{0},
+ mMaxFrameSize{0},
mWarnLargeObject{false},
mPreprocessingSuffix{DEFAULT_PREPROCESSING_SUFFIX},
mCompilationProperSuffix{DEFAULT_COMPILATION_SUFFIX},
@@ -1742,7 +1742,7 @@ Settings::CompilerSet::CompilerSet(const Settings::CompilerSet &set):
mAutoAddCharsetParams{set.mAutoAddCharsetParams},
mExecCharset{set.mExecCharset},
mStaticLink{set.mStaticLink},
- mMaxObjectSize{set.mMaxObjectSize},
+ mMaxFrameSize{set.mMaxFrameSize},
mWarnLargeObject{set.mWarnLargeObject},
mPreprocessingSuffix{set.mPreprocessingSuffix},
@@ -2569,24 +2569,24 @@ QByteArray Settings::CompilerSet::getCompilerOutput(const QString &binDir, const
return result.trimmed();
}
-bool Settings::CompilerSet::warnLargeObject() const
+bool Settings::CompilerSet::warnLargeFrame() const
{
return mWarnLargeObject;
}
-void Settings::CompilerSet::setWarnLargeObject(bool newWarnLargeObject)
+void Settings::CompilerSet::setWarnLargeFrame(bool newWarnLargeObject)
{
mWarnLargeObject = newWarnLargeObject;
}
-double Settings::CompilerSet::maxObjectSize() const
+double Settings::CompilerSet::maxFrameSize() const
{
- return mMaxObjectSize;
+ return mMaxFrameSize;
}
-void Settings::CompilerSet::setMaxObjectSize(double maxObjectSize)
+void Settings::CompilerSet::setMaxFrameSize(double maxFrameSize)
{
- mMaxObjectSize = maxObjectSize;
+ mMaxFrameSize = maxFrameSize;
}
Settings::CompilerSet::CompilationStage Settings::CompilerSet::compilationStage() const
@@ -2758,8 +2758,8 @@ static void setReleaseOptions(Settings::PCompilerSet pSet) {
pSet->setCompileOption(LINK_CMD_OPT_STRIP_EXE, COMPILER_OPTION_ON);
pSet->setCompileOption(CC_CMD_OPT_USE_PIPE, COMPILER_OPTION_ON);
pSet->setStaticLink(true);
- pSet->setMaxObjectSize(2); //default stack size of gcc is 2MB
- pSet->setWarnLargeObject(false);
+ pSet->setMaxFrameSize(2); //default stack size of gcc is 2MB
+ pSet->setWarnLargeFrame(false);
}
static void setDebugOptions(Settings::PCompilerSet pSet, bool enableAsan = false) {
@@ -2779,8 +2779,8 @@ static void setDebugOptions(Settings::PCompilerSet pSet, bool enableAsan = false
pSet->setCompileOption(CC_CMD_OPT_STACK_PROTECTOR, "-strong");
pSet->setStaticLink(false);
- pSet->setMaxObjectSize(2); //default stack size of gcc is 2MB
- pSet->setWarnLargeObject(true);
+ pSet->setMaxFrameSize(2); //default stack size of gcc is 2MB
+ pSet->setWarnLargeFrame(true);
}
bool Settings::CompilerSets::addSets(const QString &folder, const QString& c_prog) {
@@ -3122,8 +3122,9 @@ void Settings::CompilerSets::saveSet(int index)
mSettings->mSettings.setValue("AddCharset", pSet->autoAddCharsetParams());
mSettings->mSettings.setValue("StaticLink", pSet->staticLink());
mSettings->mSettings.setValue("ExecCharset", pSet->execCharset());
- mSettings->mSettings.setValue("WarnLargeObject",pSet->warnLargeObject());
- mSettings->mSettings.setValue("MaxObjectSize",pSet->maxObjectSize());
+ mSettings->mSettings.setValue("WarnLargeFrame",pSet->warnLargeFrame());
+ mSettings->mSettings.setValue("MaxFrameSize",pSet->maxFrameSize());
+
mSettings->mSettings.setValue("preprocessingSuffix", pSet->preprocessingSuffix());
mSettings->mSettings.setValue("compilationProperSuffix", pSet->compilationProperSuffix());
@@ -3207,8 +3208,8 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index)
pSet->setCustomLinkParams(mSettings->mSettings.value("customLinkParams").toString());
pSet->setAutoAddCharsetParams(mSettings->mSettings.value("AddCharset", true).toBool());
pSet->setStaticLink(mSettings->mSettings.value("StaticLink", false).toBool());
- pSet->setMaxObjectSize(mSettings->mSettings.value("MaxObjectSize", 2).toDouble());
- pSet->setWarnLargeObject(mSettings->mSettings.value("WarnLargeObject", false).toBool());
+ pSet->setMaxFrameSize(mSettings->mSettings.value("MaxFrameSize", 1).toDouble());
+ pSet->setWarnLargeFrame(mSettings->mSettings.value("WarnLargeFrame", false).toBool());
pSet->setExecCharset(mSettings->mSettings.value("ExecCharset", ENCODING_SYSTEM_DEFAULT).toString());
if (pSet->execCharset().isEmpty()) {
diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h
index e98bf593..c2ed4746 100644
--- a/RedPandaIDE/settings.h
+++ b/RedPandaIDE/settings.h
@@ -1427,11 +1427,11 @@ public:
bool isOutputExecutable();
bool isOutputExecutable(Settings::CompilerSet::CompilationStage stage);
- double maxObjectSize() const;
- void setMaxObjectSize(double maxObjectSize);
+ double maxFrameSize() const;
+ void setMaxFrameSize(double maxFrameSize);
- bool warnLargeObject() const;
- void setWarnLargeObject(bool newWarnLargeObject);
+ bool warnLargeFrame() const;
+ void setWarnLargeFrame(bool newWarnLargeObject);
private:
void setDirectories(const QString& binDir, CompilerType mCompilerType);
@@ -1478,7 +1478,7 @@ public:
bool mAutoAddCharsetParams;
QString mExecCharset;
bool mStaticLink;
- double mMaxObjectSize;
+ double mMaxFrameSize;
bool mWarnLargeObject;
QString mPreprocessingSuffix;
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
index 2e6c34b5..461b774d 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
@@ -88,8 +88,8 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet
ui->txtCustomLinkParams->setEnabled(pSet->useCustomLinkParams());
ui->chkAutoAddCharset->setChecked(pSet->autoAddCharsetParams());
ui->chkStaticLink->setChecked(pSet->staticLink());
- ui->spinMaxObjectSize->setValue(pSet->maxObjectSize());
- ui->chkWarnLargeObject->setChecked(pSet->warnLargeObject());
+ ui->spinMaxObjectSize->setValue(pSet->maxFrameSize());
+ ui->chkWarnLargeObject->setChecked(pSet->warnLargeFrame());
//rest tabs in the options widget
ui->optionTabs->resetUI(pSet,pSet->compileOptions());
@@ -201,8 +201,8 @@ void CompilerSetOptionWidget::saveCurrentCompilerSet()
pSet->setCustomLinkParams(ui->txtCustomLinkParams->toPlainText().trimmed());
pSet->setAutoAddCharsetParams(ui->chkAutoAddCharset->isChecked());
pSet->setStaticLink(ui->chkStaticLink->isChecked());
- pSet->setMaxObjectSize(ui->spinMaxObjectSize->value());
- pSet->setWarnLargeObject(ui->chkWarnLargeObject->isChecked());
+ pSet->setMaxFrameSize(ui->spinMaxObjectSize->value());
+ pSet->setWarnLargeFrame(ui->chkWarnLargeObject->isChecked());
pSet->setCCompiler(ui->txtCCompiler->text().trimmed());
pSet->setCppCompiler(ui->txtCppCompiler->text().trimmed());
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
index 35781e5c..b3dab9a5 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
@@ -189,7 +189,7 @@
-
- Syntax error for objects larger than
+ Syntax error for stack frame larger than
diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts
index a7e35ac5..8d70ea7b 100644
--- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts
+++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts
@@ -760,7 +760,7 @@
MB
-
+
@@ -7822,10 +7822,6 @@
Falha ao gravar o arquivo de configurações '%1'.
-
-
-
-
WatchModel
diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts
index c392a058..7b336fc9 100644
--- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts
@@ -760,9 +760,8 @@ p, li { white-space: pre-wrap; }
编译器配置方案
-
- 当变量占用栈空间大于此值时报错
+ 当变量占用栈空间大于此值时报错
@@ -834,6 +833,11 @@ p, li { white-space: pre-wrap; }
用静态链接方式链接库文件
+
+
+
+ 单个函数栈大小超过指定值时报错:
+
@@ -4751,7 +4755,7 @@ Are you really want to continue?
-
+
新建试题集
@@ -4773,7 +4777,7 @@ Are you really want to continue?
-
+
保存试题集
@@ -4781,7 +4785,7 @@ Are you really want to continue?
-
+
载入试题集
@@ -4912,14 +4916,14 @@ Are you really want to continue?
-
+
导入FPS试题集
-
+
导出FPS试题集
@@ -5493,13 +5497,13 @@ Are you really want to continue?
-
+
导出为RTF
-
+
导出为HTML
@@ -5998,22 +6002,22 @@ Are you really want to continue?
全部复制
-
+
跳转到行
-
+
行
-
+
模板已存在
-
+
模板%1已存在。是否覆盖?
@@ -6039,7 +6043,7 @@ Are you really want to continue?
-
+
试题集%1
@@ -6109,15 +6113,15 @@ Are you really want to continue?
-
-
+
+
书签描述
-
-
+
+
描述:
@@ -6447,12 +6451,12 @@ Are you really want to continue?
保存设置失败
-
+
被监控的变量
-
+
当下面的变量被修改时暂停执行(该变量必须可以从当前程序处访问):
@@ -6461,17 +6465,17 @@ Are you really want to continue?
中止
-
+
FPS试题集文件(*.fps;*.xml)
-
+
FPS试题集文件(*.fps)
-
+
导出时出错
@@ -6532,7 +6536,7 @@ Are you really want to continue?
-
+
需要保存吗?
@@ -6544,15 +6548,15 @@ Are you really want to continue?
-
-
+
+
新建项目文件?
-
-
+
+
您是否要将新建的文件加入项目?
@@ -6561,7 +6565,7 @@ Are you really want to continue?
-
+
保存失败
@@ -6660,18 +6664,18 @@ Are you really want to continue?
你真的要删除它吗?
-
+
改变工作文件夹
-
+
File '%1' is not in the current working folder
文件'%1'不在当前工作文件夹中。
-
+
是否将工作文件夹改设为'%1'?
@@ -6680,28 +6684,28 @@ Are you really want to continue?
正在删除试题...
-
+
无法提交
-
+
Git需要用信息进行提交。
-
+
选择输入数据文件
-
-
+
+
所有文件 (*.*)
-
+
Choose Expected Input Data File
选择期望输出文件
@@ -6713,59 +6717,59 @@ Are you really want to continue?
-
+
选择工作文件夹
-
-
+
+
头文件已存在
-
-
+
+
头文件"%1"已存在!
-
+
源文件已存在!
-
+
源文件"%1"已存在!
-
+
无法提交!
-
+
下列文件处于冲突状态,请解决后重新添加和提交:
-
+
提交信息
-
+
提交信息:
-
+
提交失败
-
+
提交信息不能为空!
@@ -6906,58 +6910,58 @@ Are you really want to continue?
新名称
-
-
-
-
+
+
+
+
替换出错
-
+
无法打开文件'%1'进行替换!
-
+
内容和上次查找时不一致。
-
+
RTF格式文件 (*.rtf)
-
+
HTML文件 (*.html)
-
+
当前的试题集不是空的。
-
+
试题%1
-
-
+
+
试题集文件 (*.pbs)
-
-
+
+
载入失败
-
+
试题案例%1
@@ -6975,7 +6979,7 @@ Are you really want to continue?
-
+
错误
@@ -7051,7 +7055,7 @@ Are you really want to continue?
-
+
确认转换
@@ -7059,7 +7063,7 @@ Are you really want to continue?
-
+
当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?
@@ -7745,43 +7749,43 @@ Are you really want to continue?
- 资源文件: %1
-
+
正在编译项目修改...
-
+
- 项目文件名: %1
-
+
- 编译器配置: %1
-
+
Make程序“%1”不存在!
-
+
请检查编译器配置中的“程序”页。
-
+
正在处理makefile...
-
+
- makefile处理器: %1
-
+
- 命令: %1 %2
@@ -10172,7 +10176,7 @@ Are you really want to continue?
-
+
@@ -10181,7 +10185,7 @@ Are you really want to continue?
-
+
@@ -10193,7 +10197,7 @@ Are you really want to continue?
自动链接
-
+
@@ -10269,15 +10273,15 @@ Are you really want to continue?
杂项
-
-
+
+
程序运行
-
+
试题集
@@ -10763,9 +10767,8 @@ Are you really want to continue?
删除编译文件
-
- 在文件管理器中打开编译结果
+ 在文件管理器中打开编译结果
diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts
index 71b3995f..68cbb6dc 100644
--- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts
+++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts
@@ -657,7 +657,7 @@
-
+
@@ -7158,10 +7158,6 @@
-
-
-
-
WatchModel
diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro
index fd771ad1..d01a700b 100644
--- a/Red_Panda_CPP.pro
+++ b/Red_Panda_CPP.pro
@@ -14,7 +14,7 @@ qsynedit.subdir = libs/qsynedit
APP_NAME = RedPandaCPP
-APP_VERSION = 2.19
+APP_VERSION = 2.20
# Add the dependencies so that the RedPandaIDE project can add the depended programs
# into the main app bundle
diff --git a/platform/windows/templates/1-WinApp/info.template b/platform/windows/templates/1-WinApp/info.template
index 5dbe24d2..7defb323 100644
--- a/platform/windows/templates/1-WinApp/info.template
+++ b/platform/windows/templates/1-WinApp/info.template
@@ -20,3 +20,4 @@ Cpp[zh_CN]=WinApp_zh_CN.c
[Project]
UnitCount=1
Type=0
+Encoding=UTF-8
diff --git a/platform/windows/templates/rdrawing-doraemon/info.template b/platform/windows/templates/rdrawing-doraemon/info.template
index 6d9ca521..894a673b 100644
--- a/platform/windows/templates/rdrawing-doraemon/info.template
+++ b/platform/windows/templates/rdrawing-doraemon/info.template
@@ -17,4 +17,5 @@ UnitCount=1
Type=1
IsCpp=0
linker=-lrdrawing -lraylib -lopengl32 -lgdi32 -lwinmm
+Encoding=UTF-8
ExecEncoding=UTF-8