Skip to content

Commit

Permalink
Compile with all warnings, warnings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
visrealm committed Sep 4, 2023
1 parent af1b116 commit 739e898
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ if (NOT BUILD_SHARED_LIBS)
add_definitions(-DVR_6522_EMU_STATIC)
endif()

if (PROJECT_IS_TOP_LEVEL)
if(MSVC)
add_compile_options(/W4 /WX)
add_compile_options(/arch:AVX2 /Ox)
else()
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
add_compile_options(-march=native)
endif()
endif()

include(CTest)

add_subdirectory(src)
23 changes: 10 additions & 13 deletions src/vrEmu6522.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@
#endif


#pragma warning(disable : 4100)


/* ------------------------------------------------------------------
* PRIVATE DATA STRUCTURE
*/
/* ------------------------------------------------------------------
* PRIVATE DATA STRUCTURE
*/
struct vrEmu6522_s
{
vrEmu6522Model model;
Expand Down Expand Up @@ -74,9 +71,9 @@ struct vrEmu6522_s
#define VIA_IFR_T1 (1 << 6)
#define VIA_IFR_IRQ (1 << 7)

/* ------------------------------------------------------------------
* HELPER FUNCTIONS
* ----------------------------------------------------------------*/
/* ------------------------------------------------------------------
* HELPER FUNCTIONS
* ----------------------------------------------------------------*/
inline static void viaIfrSetIrq(VrEmu6522* vr6522)
{
uint8_t ier = vr6522->reg[VIA_REG_IER] & 0x7f;
Expand Down Expand Up @@ -127,12 +124,12 @@ VR_EMU_6522_DLLEXPORT VrEmu6522* vrEmu6522New(
vr6522->model = model;

vrEmu6522Reset(vr6522);
}
}

return vr6522;
}

/*
/*
* destroy a 6522
*/
VR_EMU_6522_DLLEXPORT void vrEmu6522Destroy(VrEmu6522* vr6522)
Expand All @@ -144,7 +141,7 @@ VR_EMU_6522_DLLEXPORT void vrEmu6522Destroy(VrEmu6522* vr6522)
}
}

/*
/*
* reset the 6522
*/
VR_EMU_6522_DLLEXPORT void vrEmu6522Reset(VrEmu6522* vr6522)
Expand Down Expand Up @@ -238,7 +235,7 @@ VR_EMU_6522_DLLEXPORT uint8_t vrEmu6522ReadDbg(VrEmu6522* vr6522, uint8_t addr)
return vr6522->reg[addr & 0x0f];
}

/*
/*
* a single clock tick
*/
VR_EMU_6522_DLLEXPORT void __time_critical_func(vrEmu6522Tick)(VrEmu6522* vr6522)
Expand Down

0 comments on commit 739e898

Please sign in to comment.