Software Engineering - Sudoku Code Analysis Report

First, run code analysis

Run code analysis results are as follows:

1> ------ Rebuild All started: Project: suduku_without_gui, Configuration: Release Win32 ------

1>header.cpp

1> interpretor.cpp

1>SudokuChecker.cpp

1>SudokuMaker.cpp

1>SudokuPrinter.cpp

1>SudokuReader.cpp

1> E: \ github \ software_engineering_sudoku \ suduku_without_gui \ suduku_without_gui \ interpretor.cpp (1,1): warning C4819: The file contains a character can not be represented in the current code page (936) in. Please save the file as Unicode format to prevent data loss

1>SudokuSolver.cpp

1>suduku_without_gui.cpp

1> Compiling ...

1> E: \ github \ software_engineering_sudoku \ suduku_without_gui \ suduku_without_gui \ SudokuReader.cpp (73,59): warning C4018: ">": Signed / unsigned mismatch

1> is generated code

1>Previous IPDB not found, fall back to full compilation.

1>All 50 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.

1> Completed generated code

1>suduku_without_gui.vcxproj -> E:\github\software_engineering_sudoku\suduku_without_gui\Release\suduku_without_gui.exe

1> "suduku_without_gui.vcxproj" The operation has completed building the project.

========== Rebuild All: a successful, 0 failed, 0 skipped ==========

Second, the problem summary

1. file encoding format is incorrect

Problem Description

> E: \ github \ software_engineering_sudoku \ suduku_without_gui \ suduku_without_gui \ interpretor.cpp (1,1): warning C4819: The file contains a character can not be represented in the current code page (936) in. Please save the file as Unicode format to prevent data loss

the reason

Project documents are saved in UTF-8 with signature format, the file is UTF-8 encoding without signature.

solution

Save the file as UTF-8 format

 

2. sign mismatch

Problem Description

E: \ github \ software_engineering_sudoku \ suduku_without_gui \ suduku_without_gui \ SudokuReader.cpp (73,59): warning C4018: ">": signed / unsigned mismatch

the reason

SudokuReader::num_bytes_of_sudoku_infile * BUFF_SIZE > n_bytes_read

It is greater than the number of type int left, and right is DWORD comparison operator type, is unsigned long type DWORD

solution

Since ensures SudokuReader :: num_bytes_of_sudoku_infile * BUFF_SIZE not exceed represented by an int, so it can be lifted up as a DWORD type is not recommended n_bytes_read cast to type int, to avoid unnecessary errors.

Third, resolve after effect

1> ------ Rebuild All started: Project: suduku_without_gui, Configuration: Release Win32 ------

1>header.cpp

1> interpretor.cpp

1>SudokuChecker.cpp

1>SudokuMaker.cpp

1>SudokuPrinter.cpp

1>SudokuReader.cpp

1>SudokuSolver.cpp

1>suduku_without_gui.cpp

1> Compiling ...

1> is generated code

1>Previous IPDB not found, fall back to full compilation.

1>All 50 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.

1> Completed generated code

1>suduku_without_gui.vcxproj -> E:\github\software_engineering_sudoku\suduku_without_gui\Release\suduku_without_gui.exe

========== Rebuild All: a successful, 0 failed, 0 skipped ==========

 

 

 

 

Guess you like

Origin www.cnblogs.com/harrypotterjackson/p/12208291.html