Internal: Renamed ImLoadFileToMemory to ImFileLoadToMemory to be consistent with ImFileOpen + fix mismatching .h name (#917)

This commit is contained in:
omar 2017-01-14 13:47:16 +01:00
parent 6257b5814a
commit b8043d3ee5
3 changed files with 5 additions and 5 deletions

View File

@ -1311,7 +1311,7 @@ FILE* ImFileOpen(const char* filename, const char* mode)
// Load file content into memory // Load file content into memory
// Memory allocated with ImGui::MemAlloc(), must be freed by user using ImGui::MemFree() // Memory allocated with ImGui::MemAlloc(), must be freed by user using ImGui::MemFree()
void* ImLoadFileToMemory(const char* filename, const char* file_open_mode, int* out_file_size, int padding_bytes) void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, int* out_file_size, int padding_bytes)
{ {
IM_ASSERT(filename && file_open_mode); IM_ASSERT(filename && file_open_mode);
if (out_file_size) if (out_file_size)
@ -2462,7 +2462,7 @@ static void LoadIniSettingsFromDisk(const char* ini_filename)
return; return;
int file_size; int file_size;
char* file_data = (char*)ImLoadFileToMemory(ini_filename, "rb", &file_size, 1); char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", &file_size, 1);
if (!file_data) if (!file_data)
return; return;

View File

@ -1195,7 +1195,7 @@ ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template)
ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
{ {
int data_size = 0; int data_size = 0;
void* data = ImLoadFileToMemory(filename, "rb", &data_size, 0); void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0);
if (!data) if (!data)
{ {
IM_ASSERT(0); // Could not load file. IM_ASSERT(0); // Could not load file.

View File

@ -88,8 +88,8 @@ IMGUI_API int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, cons
// Helpers: Misc // Helpers: Misc
IMGUI_API ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings IMGUI_API ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings
IMGUI_API void* ImLoadFileToMemory(const char* filename, const char* file_open_mode, int* out_file_size = NULL, int padding_bytes = 0); IMGUI_API void* ImFileLoadToMemory(const char* filename, const char* file_open_mode, int* out_file_size = NULL, int padding_bytes = 0);
IMGUI_API FILE* ImOpenFile(const char* filename, const char* file_open_mode); IMGUI_API FILE* ImFileOpen(const char* filename, const char* file_open_mode);
IMGUI_API bool ImIsPointInTriangle(const ImVec2& p, const ImVec2& a, const ImVec2& b, const ImVec2& c); IMGUI_API bool ImIsPointInTriangle(const ImVec2& p, const ImVec2& a, const ImVec2& b, const ImVec2& c);
static inline bool ImCharIsSpace(int c) { return c == ' ' || c == '\t' || c == 0x3000; } static inline bool ImCharIsSpace(int c) { return c == ' ' || c == '\t' || c == 0x3000; }
static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; } static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }