File gcc7.diff of Package ptokax
From: Jan Engelhardt <jengelh@inai.de>
Date: 2017-06-08 01:30:00.201233233 +0200
Repair some ancient code that newer g++ rightfully flags.
[ 49s] error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
[ 49s] if(SetBoolCom[szi] != '\0') {
[ 49s] if(SetShortCom[szi] != '\0') {
[ 49s] if(SetTxtCom[szi] != '\0') {
---
core/SettingManager.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: PtokaX/core/SettingManager.cpp
===================================================================
--- PtokaX.orig/core/SettingManager.cpp
+++ PtokaX/core/SettingManager.cpp
@@ -504,12 +504,12 @@ void SettingManager::Save() {
for(size_t szi = 0; szi < SETBOOL_IDS_END; szi++) {
// Don't save empty hint
- if(SetBoolCom[szi] != '\0') {
+ if(SetBoolCom[szi] != NULL) {
fputs(SetBoolCom[szi], fSettingsFile);
}
// Don't save setting with empty id
- if(SetBoolStr[szi][0] == '\0') {
+ if(SetBoolStr[szi] == NULL || SetBoolStr[szi][0] == '\0') {
continue;
}
@@ -527,12 +527,12 @@ void SettingManager::Save() {
for(size_t szi = 0; szi < SETSHORT_IDS_END; szi++) {
// Don't save empty hint
- if(SetShortCom[szi] != '\0') {
+ if(SetShortCom[szi] != NULL) {
fputs(SetShortCom[szi], fSettingsFile);
}
// Don't save setting with empty id
- if(SetShortStr[szi][0] == '\0') {
+ if(SetShortStr[szi] == NULL || SetShortStr[szi][0] == '\0') {
continue;
}
@@ -550,12 +550,12 @@ void SettingManager::Save() {
for(size_t szi = 0; szi < SETTXT_IDS_END; szi++) {
// Don't save empty hint
- if(SetTxtCom[szi] != '\0') {
+ if(SetTxtCom[szi] != NULL) {
fputs(SetTxtCom[szi], fSettingsFile);
}
// Don't save setting with empty id
- if(SetTxtStr[szi][0] == '\0') {
+ if(SetTxtStr[szi] == NULL || SetTxtStr[szi][0] == '\0') {
continue;
}