DISABLEAVRMIN Broken


#1

Continuing the discussion from Windows & Linux Simulator repository on github:

I believe that the solution outlined here (Windows & Linux Simulator repository on github) is no longer working.

I am on:

  • Windows
  • codeblock 16.01
  • gcc (MinGW.org GCC-6.3.0-1) 6.3.0

Adding DISABLEAVRMIN results in multiple errors in the Pokitto libs:

||=== Build: HelloWorld in Pokitto_sim (compiler: GNU GCC Compiler) ===|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Examples\HelloWorld\main.cpp||In function 'int SDL_main()':|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Examples\HelloWorld\main.cpp|14|warning: no return statement in function returning non-void [-Wreturn-type]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoConsole.cpp|287|warning: unused variable 'oldenable' [-Wunused-variable]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoCore.cpp|393|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoCore.cpp|484|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoCore.cpp|716|warning: unused variable 'counter' [-Wunused-variable]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoCore.cpp|1014|warning: variable 'fc' set but not used [-Wunused-but-set-variable]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoCore.cpp|1014|warning: variable 'bc' set but not used [-Wunused-but-set-variable]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoCore.cpp|1047|warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]|
..\..\Pokitto\Pokitto_settings.h|344|warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|514|note: in expansion of macro 'POK_BITFRAME'|
..\..\Pokitto\Pokitto_settings.h|344|warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|515|note: in expansion of macro 'POK_BITFRAME'|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|516|warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|517|warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|1431|error: 'max' was not declared in this scope|
C:\Users\Matt\Documents\Dev\Game\PokittoLib\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|1432|error: 'min' was not declared in this scope|
||=== Build failed: 2 error(s), 12 warning(s) (0 minute(s), 25 second(s)) ===|

Edit: After hacking in a fix for this, a few more pop up in SimLCD, which I also fixed.

I’m just not sure what the proper fix is though, so I am hesitent to submit a pull request. (I just added the std includes and made some c-style casts which were tripping up the min/max template code).

Edit 2: I ended up just submitting a Pull Request. I’ll let you figure out if this is the right fix :slight_smile: