GSL + CPP core guidelines changes.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2017-11-18 14:29:30 +00:00
parent dea1847280
commit 67c27d4a3e
27 changed files with 162 additions and 150 deletions
+1 -1
View File
@@ -70,5 +70,5 @@ void EightBit::Bus::write(register16_t address, uint8_t value) {
uint8_t& EightBit::Bus::reference() {
bool rom;
auto& value = reference(ADDRESS().word, rom);
return rom ? placeDATA(value) : referenceDATA(value);
return GSL_LIKELY(!rom) ? referenceDATA(value) : placeDATA(value);
}
+4 -4
View File
@@ -70,16 +70,16 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>../inc;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
<IncludePath>..\inc;..\libraries\GSL\include;C:\Libraries\boost_1_65_1;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
+4 -4
View File
@@ -15,7 +15,7 @@ void EightBit::Processor::initialise() {
int EightBit::Processor::run(int limit) {
int current = 0;
while (powered() && current < limit) {
while (GSL_LIKELY(powered()) && current < limit) {
current += singleStep();
}
return current;
@@ -35,7 +35,7 @@ void EightBit::Processor::fetchWord(register16_t& output) {
}
int EightBit::Processor::fetchExecute() {
if (!powered())
return 0;
return execute(fetchByte());
if (GSL_LIKELY(powered()))
return execute(fetchByte());
return 0;
}
+2
View File
@@ -19,3 +19,5 @@
#else
#include <x86intrin.h>
#endif
#include <gsl/gsl>