Commit 4c8eff3826030921dd89718a2a477b48c15c685e

Authored by 김태훈
1 parent 5f1ffa79cd
Exists in master and in 2 other branches fhd, fhd-demo

더 적절한 해결 방법으로 변경

app/gui/oven_control/config.cpp
... ... @@ -153,12 +153,12 @@ bool Config::saveConfig(void){
153 153 }
154 154  
155 155 bool Config::loadConfig(){
156   - char buff[sizeof(config_lists)+1];
  156 + uint8_t buff[sizeof(config_lists)+1];
157 157 qint64 readlen;
158 158 QFile file(CONFIG_FILE_NAME);
159 159 initConfig();
160 160 if(file.open(QIODevice::ReadOnly)){
161   - readlen = file.read(buff,sizeof(config_lists)+1);
  161 + readlen = file.read((char *) buff,sizeof(config_lists)+1);
162 162 file.close();
163 163 if(readlen != (sizeof(configlist)+1)){
164 164 //File size is wrong. apply default config value & save default value;
... ... @@ -166,7 +166,7 @@ bool Config::loadConfig(){
166 166 saveConfig();
167 167 return false;
168 168 }
169   - if((unsigned char) buff[sizeof(config_lists)] ==0x9c){
  169 + if (buff[sizeof(config_lists)] ==0x9c){
170 170 memcpy(configlist.data,buff,sizeof(config_lists));
171 171 qDebug() << "loading config file success";
172 172 }
... ...
app/gui/oven_control/fileprocessdlg.cpp
... ... @@ -658,7 +658,7 @@ void FileProcessDlg::configDownload(){
658 658 }
659 659  
660 660 void FileProcessDlg::configUpload(){
661   - char buff[sizeof(config_lists)+1];
  661 + uint8_t buff[sizeof(config_lists)+1];
662 662 qint64 readlen;
663 663 QString strUsbPath;
664 664 QString strSrcPath;
... ... @@ -668,7 +668,7 @@ void FileProcessDlg::configUpload(){
668 668 QFile srcFile(strSrcPath);
669 669 //Check Source File is valid this machine
670 670 if(srcFile.open(QIODevice::ReadOnly)){
671   - readlen = srcFile.read(buff,sizeof(config_lists)+1);
  671 + readlen = srcFile.read((char *) buff,sizeof(config_lists)+1);
672 672 srcFile.close();
673 673 if(readlen != (sizeof(config_lists)+1)) {
674 674 qDebug() << "SRC config.ini file size wrong";
... ... @@ -676,13 +676,13 @@ void FileProcessDlg::configUpload(){
676 676 QTimer::singleShot(1000,this,SLOT(close()));
677 677 return;
678 678 }
679   - if((unsigned char) buff[sizeof(config_lists)] != 0x9C){
  679 + if(buff[sizeof(config_lists)] != 0x9C){
680 680 qDebug() << "SRC config.ini file check fail";
681 681 ui->ctrLbRemainTime->setText(tr("설정 업로드에 실패하였습니다."));
682 682 QTimer::singleShot(1000,this,SLOT(close()));
683 683 return;
684 684 }
685   - cfg->copyConfigArea(buff);
  685 + cfg->copyConfigArea((char *) buff);
686 686 cfg->saveConfig();
687 687 cfg->applyConfig();
688 688 }
... ...