tvg_loader: code refactoring.

renamed internal functions, no logical changes.
This commit is contained in:
Hermet Park 2021-06-14 14:32:05 +09:00
parent 88a85c68fa
commit 26fd6b5dfd
3 changed files with 7 additions and 7 deletions

View file

@ -504,14 +504,14 @@ static LoaderResult _parsePaint(tvgBlock base_block, Paint **paint)
/* External Class Implementation */
/************************************************************************/
bool tvgValidateTvgHeader(const char *ptr, uint32_t size)
bool tvgValidateData(const char *ptr, uint32_t size)
{
auto end = ptr + size;
if (!_readTvgHeader(&ptr) || ptr >= end) return false;
return true;
}
unique_ptr<Scene> tvgLoadTvgData(const char *ptr, uint32_t size)
unique_ptr<Scene> tvgLoadData(const char *ptr, uint32_t size)
{
auto end = ptr + size;

View file

@ -26,7 +26,7 @@
#include "tvgCommon.h"
#include "tvgBinaryDesc.h"
bool tvgValidateTvgHeader(const char *ptr, uint32_t size);
unique_ptr<Scene> tvgLoadTvgData(const char *ptr, uint32_t size);
bool tvgValidateData(const char *ptr, uint32_t size);
unique_ptr<Scene> tvgLoadData(const char *ptr, uint32_t size);
#endif //_TVG_TVG_LOAD_PARSER_H_

View file

@ -79,7 +79,7 @@ bool TvgLoader::open(const string &path)
pointer = buffer;
return tvgValidateTvgHeader(pointer, size);
return tvgValidateData(pointer, size);
}
bool TvgLoader::open(const char *data, uint32_t size)
@ -89,7 +89,7 @@ bool TvgLoader::open(const char *data, uint32_t size)
this->pointer = data;
this->size = size;
return tvgValidateTvgHeader(pointer, size);
return tvgValidateData(pointer, size);
}
bool TvgLoader::read()
@ -111,7 +111,7 @@ bool TvgLoader::close()
void TvgLoader::run(unsigned tid)
{
if (root) root.reset();
root = tvgLoadTvgData(pointer, size);
root = tvgLoadData(pointer, size);
if (!root) clearBuffer();
}