Skip to content

Commit

Permalink
define a size type usize and use it instead of size_t or u64
Browse files Browse the repository at this point in the history
  • Loading branch information
uwefoken authored and nem0 committed May 6, 2024
1 parent 0ff07f7 commit 8e26404
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ofbx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4046,7 +4046,7 @@ bool Scene::finalize() {
return true;
}

IScene* load(const u8* data, u64 size, u16 flags, JobProcessor job_processor, void* job_user_ptr)
IScene* load(const u8* data, usize size, u16 flags, JobProcessor job_processor, void* job_user_ptr)
{
std::unique_ptr<Scene> scene(new Scene());
scene->m_data.resize(size);
Expand Down
3 changes: 2 additions & 1 deletion src/ofbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static_assert(sizeof(u32) == 4, "u32 is not 4 bytes");
static_assert(sizeof(u64) == 8, "u64 is not 8 bytes");
static_assert(sizeof(i64) == 8, "i64 is not 8 bytes");

typedef decltype(sizeof(0)) usize;

using JobFunction = void (*)(void*);
using JobProcessor = void (*)(JobFunction, void*, void*, u32, u32);
Expand Down Expand Up @@ -756,7 +757,7 @@ struct IScene
};


IScene* load(const u8* data, u64 size, u16 flags, JobProcessor job_processor = nullptr, void* job_user_ptr = nullptr);
IScene* load(const u8* data, usize size, u16 flags, JobProcessor job_processor = nullptr, void* job_user_ptr = nullptr);
const char* getError();
double fbxTimeToSeconds(i64 value);
i64 secondsToFbxTime(double value);
Expand Down

0 comments on commit 8e26404

Please sign in to comment.