| 1 | Fix type comparison issue that is a hard error in GCC 10.
|
| 2 |
|
| 3 | Taken from upstream:
|
| 4 |
|
| 5 | https://github.com/OpenTTD/grfcodec/commit/bb692b2c723c5e87cc8f89f445928e97594d5b8f
|
| 6 |
|
| 7 | diff --git a/src/command.cpp b/src/command.cpp
|
| 8 | index 9aa0e14..1f32cf1 100644
|
| 9 | |
| 10 | |
| 11 | @@ -300,8 +300,9 @@ bool parse_comment(const string&line){
|
| 12 | break;
|
| 13 | case BEAUTIFY:{
|
| 14 | commandstream>>command_part;
|
| 15 | - uint val=find_command(command_part,beaut),togglebit;
|
| 16 | - if(val!=(uint)-1&&val!=OFF)_commandState.beautifier=true;
|
| 17 | + int val=find_command(command_part,beaut);
|
| 18 | + uint togglebit;
|
| 19 | + if(val!=-1&&val!=OFF)_commandState.beautifier=true;
|
| 20 | switch(val){
|
| 21 | case -1:
|
| 22 | IssueMessage(0,COMMAND_INVALID_ARG,gen[BEAUTIFY].name);
|
| 23 | @@ -372,7 +373,7 @@ bool parse_comment(const string&line){
|
| 24 | dotoggle:
|
| 25 | commandstream>>command_part;
|
| 26 | val=find_command(command_part,beaut);
|
| 27 | - if(!commandstream||val==(uint)-1){
|
| 28 | + if(!commandstream||val==-1){
|
| 29 | IssueMessage(0,COMMAND_INVALID_ARG,gen[BEAUTIFY].name);
|
| 30 | return true;
|
| 31 | }
|