mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Warnings: replace memcpy by assignment
New gcc (v8.2) complains about memcpy()ing an object with non-POD members. Even though this seems not to be an issue for template_options, the warning has some merrit. The compiler will recognize when to do a memcpy() anyway. Moreover, the assignment is easier to read and also more secure, as a-priory we can't know if Qt's QColor copy-constructor does some strange things (hopefully not). Thus, replace memcpy() by simple assignment. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									26a4fb5632
								
							
						
					
					
						commit
						2cd7b9db25
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -147,7 +147,7 @@ void TemplateEdit::saveSettings() | ||||||
| 		msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Cancel); | 		msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Cancel); | ||||||
| 		msgBox.setDefaultButton(QMessageBox::Cancel); | 		msgBox.setDefaultButton(QMessageBox::Cancel); | ||||||
| 		if (msgBox.exec() == QMessageBox::Save) { | 		if (msgBox.exec() == QMessageBox::Save) { | ||||||
| 			memcpy(templateOptions, &newTemplateOptions, sizeof(struct template_options)); | 			*templateOptions = newTemplateOptions; | ||||||
| 			if (templateChanged) { | 			if (templateChanged) { | ||||||
| 				TemplateLayout::writeTemplate(printOptions->p_template, ui->plainTextEdit->toPlainText()); | 				TemplateLayout::writeTemplate(printOptions->p_template, ui->plainTextEdit->toPlainText()); | ||||||
| 				if (printOptions->type == print_options::DIVELIST) | 				if (printOptions->type == print_options::DIVELIST) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue