diff options
author | David Shah <davey1576@gmail.com> | 2018-07-04 12:15:23 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-07-04 12:15:23 +0200 |
commit | e0a851976f7bc51702bc6ba667f36749cd554ebb (patch) | |
tree | 7ad0979da5cf954ccef6a21884d23fd55c3d7299 /ice40/resource | |
parent | b96727549ccd319f61d33982f678075880fad166 (diff) | |
download | nextpnr-e0a851976f7bc51702bc6ba667f36749cd554ebb.tar.gz nextpnr-e0a851976f7bc51702bc6ba667f36749cd554ebb.tar.bz2 nextpnr-e0a851976f7bc51702bc6ba667f36749cd554ebb.zip |
refactor: Replace assert with NPNR_ASSERT
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/resource')
-rw-r--r-- | ice40/resource/embed.cc | 23 | ||||
-rw-r--r-- | ice40/resource/resource.h | 10 |
2 files changed, 16 insertions, 17 deletions
diff --git a/ice40/resource/embed.cc b/ice40/resource/embed.cc index 15245355..74f2eee9 100644 --- a/ice40/resource/embed.cc +++ b/ice40/resource/embed.cc @@ -1,31 +1,30 @@ -#include <windows.h> #include <cstdio> +#include <windows.h> #include "nextpnr.h" #include "resource.h" NEXTPNR_NAMESPACE_BEGIN -const char* chipdb_blob_384; -const char* chipdb_blob_1k; -const char* chipdb_blob_5k; -const char* chipdb_blob_8k; +const char *chipdb_blob_384; +const char *chipdb_blob_1k; +const char *chipdb_blob_5k; +const char *chipdb_blob_8k; -const char* LoadFileInResource(int name, int type, DWORD& size) +const char *LoadFileInResource(int name, int type, DWORD &size) { HMODULE handle = ::GetModuleHandle(NULL); - HRSRC rc = ::FindResource(handle, MAKEINTRESOURCE(name), - MAKEINTRESOURCE(type)); + HRSRC rc = ::FindResource(handle, MAKEINTRESOURCE(name), MAKEINTRESOURCE(type)); HGLOBAL rcData = ::LoadResource(handle, rc); size = ::SizeofResource(handle, rc); - return static_cast<const char*>(::LockResource(rcData)); + return static_cast<const char *>(::LockResource(rcData)); } void load_chipdb() { DWORD size = 0; chipdb_blob_384 = LoadFileInResource(IDR_CHIPDB_384, BINARYFILE, size); - chipdb_blob_1k = LoadFileInResource(IDR_CHIPDB_1K, BINARYFILE, size); - chipdb_blob_5k = LoadFileInResource(IDR_CHIPDB_5K, BINARYFILE, size); - chipdb_blob_8k = LoadFileInResource(IDR_CHIPDB_8K, BINARYFILE, size); + chipdb_blob_1k = LoadFileInResource(IDR_CHIPDB_1K, BINARYFILE, size); + chipdb_blob_5k = LoadFileInResource(IDR_CHIPDB_5K, BINARYFILE, size); + chipdb_blob_8k = LoadFileInResource(IDR_CHIPDB_8K, BINARYFILE, size); } NEXTPNR_NAMESPACE_END
\ No newline at end of file diff --git a/ice40/resource/resource.h b/ice40/resource/resource.h index 8348fea1..46997ae5 100644 --- a/ice40/resource/resource.h +++ b/ice40/resource/resource.h @@ -1,5 +1,5 @@ -#define BINARYFILE 256 -#define IDR_CHIPDB_384 101 -#define IDR_CHIPDB_1K 102 -#define IDR_CHIPDB_5K 103 -#define IDR_CHIPDB_8K 104 +#define BINARYFILE 256 +#define IDR_CHIPDB_384 101 +#define IDR_CHIPDB_1K 102 +#define IDR_CHIPDB_5K 103 +#define IDR_CHIPDB_8K 104 |