forked from enlightenment/efl
parent
9965849a0e
commit
c127ff73e7
|
@ -1268,7 +1268,8 @@ eet_data_chunk_get(const Eet_Dictionary *ed, Eet_Data_Chunk *chnk,
|
||||||
else
|
else
|
||||||
chnk->group_type = EET_G_UNKNOWN;
|
chnk->group_type = EET_G_UNKNOWN;
|
||||||
if ((chnk->type >= EET_T_LAST) ||
|
if ((chnk->type >= EET_T_LAST) ||
|
||||||
(chnk->group_type >= EET_G_LAST))
|
(chnk->group_type >=
|
||||||
|
EET_G_LAST))
|
||||||
{
|
{
|
||||||
chnk->type = 0;
|
chnk->type = 0;
|
||||||
chnk->group_type = 0;
|
chnk->group_type = 0;
|
||||||
|
@ -1541,11 +1542,11 @@ _eet_descriptor_hash_find(Eet_Data_Descriptor *edd, char *name, int hash)
|
||||||
hash &= 0x3f;
|
hash &= 0x3f;
|
||||||
|
|
||||||
if (!edd->elements.hash.buckets[hash].element)
|
if (!edd->elements.hash.buckets[hash].element)
|
||||||
return NULL; /*
|
return NULL; /*
|
||||||
When we use the dictionnary as a source for chunk name, we will always
|
When we use the dictionnary as a source for chunk name, we will always
|
||||||
have the same pointer in name. It's a good idea to just compare pointer
|
have the same pointer in name. It's a good idea to just compare pointer
|
||||||
instead of running strcmp on both string.
|
instead of running strcmp on both string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (edd->elements.hash.buckets[hash].element->directory_name_ptr == name)
|
if (edd->elements.hash.buckets[hash].element->directory_name_ptr == name)
|
||||||
return edd->elements.hash.buckets[hash].element;
|
return edd->elements.hash.buckets[hash].element;
|
||||||
|
@ -2361,7 +2362,8 @@ _eet_data_dump_token_get(const char *src, int *len)
|
||||||
{
|
{
|
||||||
if ((p[0] == '\"') && (p > src) && (p[-1] != '\\'))
|
if ((p[0] == '\"') && (p > src) && (p[-1] != '\\'))
|
||||||
in_quote = 0;
|
in_quote = 0;
|
||||||
else if ((p[0] == '\\') && (*len > 1) && (p[1] == '\"'))
|
else if ((p[0] == '\\') && (*len > 1) &&
|
||||||
|
(p[1] == '\"'))
|
||||||
{
|
{
|
||||||
/* skip */
|
/* skip */
|
||||||
}
|
}
|
||||||
|
@ -3129,7 +3131,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
|
||||||
memset(&echnk, 0, sizeof(Eet_Data_Chunk));
|
memset(&echnk, 0, sizeof(Eet_Data_Chunk));
|
||||||
eet_data_chunk_get(ed, &echnk, p, size);
|
eet_data_chunk_get(ed, &echnk, p, size);
|
||||||
if (!echnk.name)
|
if (!echnk.name)
|
||||||
goto error; /* FIXME: don't REPLY on edd - work without */
|
goto error; /* FIXME: don't REPLY on edd - work without */
|
||||||
|
|
||||||
if (edd)
|
if (edd)
|
||||||
{
|
{
|
||||||
|
@ -3150,8 +3152,10 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
|
||||||
/* Needed when converting on the fly from FP to Float */
|
/* Needed when converting on the fly from FP to Float */
|
||||||
type = ede->type;
|
type = ede->type;
|
||||||
else if ((echnk.group_type > EET_G_UNKNOWN) &&
|
else if ((echnk.group_type > EET_G_UNKNOWN) &&
|
||||||
(echnk.group_type < EET_G_LAST) &&
|
(echnk.group_type <
|
||||||
(echnk.group_type == ede->group_type))
|
EET_G_LAST) &&
|
||||||
|
(echnk.group_type ==
|
||||||
|
ede->group_type))
|
||||||
group_type = echnk.group_type;
|
group_type = echnk.group_type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3466,7 +3470,7 @@ eet_data_get_array(Eet_Free_Context *context,
|
||||||
|
|
||||||
eet_data_chunk_get(ed, echnk, *p, *size);
|
eet_data_chunk_get(ed, echnk, *p, *size);
|
||||||
if (!echnk->name || strcmp(echnk->name, name) != 0)
|
if (!echnk->name || strcmp(echnk->name, name) != 0)
|
||||||
goto on_error; /* get the data */
|
goto on_error; /* get the data */
|
||||||
|
|
||||||
if (echnk->group_type != group_type
|
if (echnk->group_type != group_type
|
||||||
|| (echnk->type != type && echnk->type != EET_T_NULL))
|
|| (echnk->type != type && echnk->type != EET_T_NULL))
|
||||||
|
@ -4150,7 +4154,7 @@ eet_data_put_array(Eet_Dictionary *ed,
|
||||||
count = *(int *)(((char *)data_in) + ede->count - ede->offset);
|
count = *(int *)(((char *)data_in) + ede->count - ede->offset);
|
||||||
|
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
return; /* Store number of elements */
|
return; /* Store number of elements */
|
||||||
|
|
||||||
data = eet_data_put_type(ed, EET_T_INT, &count, &size);
|
data = eet_data_put_type(ed, EET_T_INT, &count, &size);
|
||||||
if (data)
|
if (data)
|
||||||
|
|
|
@ -730,12 +730,12 @@ eet_init(void)
|
||||||
/* Disable warning messages about problems with the secure memory subsystem.
|
/* Disable warning messages about problems with the secure memory subsystem.
|
||||||
This command should be run right after gcry_check_version. */
|
This command should be run right after gcry_check_version. */
|
||||||
if (gcry_control(GCRYCTL_DISABLE_SECMEM_WARN))
|
if (gcry_control(GCRYCTL_DISABLE_SECMEM_WARN))
|
||||||
goto shutdown_eet; /* This command is used to allocate a pool of secure memory and thus
|
goto shutdown_eet; /* This command is used to allocate a pool of secure memory and thus
|
||||||
enabling the use of secure memory. It also drops all extra privileges the
|
enabling the use of secure memory. It also drops all extra privileges the
|
||||||
process has (i.e. if it is run as setuid (root)). If the argument nbytes
|
process has (i.e. if it is run as setuid (root)). If the argument nbytes
|
||||||
is 0, secure memory will be disabled. The minimum amount of secure memory
|
is 0, secure memory will be disabled. The minimum amount of secure memory
|
||||||
allocated is currently 16384 bytes; you may thus use a value of 1 to
|
allocated is currently 16384 bytes; you may thus use a value of 1 to
|
||||||
request that default size. */
|
request that default size. */
|
||||||
|
|
||||||
if (gcry_control(GCRYCTL_INIT_SECMEM, 16384, 0))
|
if (gcry_control(GCRYCTL_INIT_SECMEM, 16384, 0))
|
||||||
WRN(
|
WRN(
|
||||||
|
@ -1002,7 +1002,7 @@ eet_internal_read2(Eet_File *ef)
|
||||||
|
|
||||||
/* read-only mode, so currently we have no data loaded */
|
/* read-only mode, so currently we have no data loaded */
|
||||||
if (ef->mode == EET_FILE_MODE_READ)
|
if (ef->mode == EET_FILE_MODE_READ)
|
||||||
efn->data = NULL; /* read-write mode - read everything into ram */
|
efn->data = NULL; /* read-write mode - read everything into ram */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
efn->data = malloc(efn->size);
|
efn->data = malloc(efn->size);
|
||||||
|
@ -1283,7 +1283,7 @@ eet_internal_read1(Eet_File *ef)
|
||||||
|
|
||||||
/* read-only mode, so currently we have no data loaded */
|
/* read-only mode, so currently we have no data loaded */
|
||||||
if (ef->mode == EET_FILE_MODE_READ)
|
if (ef->mode == EET_FILE_MODE_READ)
|
||||||
efn->data = NULL; /* read-write mode - read everything into ram */
|
efn->data = NULL; /* read-write mode - read everything into ram */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = malloc(efn->size);
|
data = malloc(efn->size);
|
||||||
|
@ -1352,7 +1352,7 @@ eet_internal_close(Eet_File *ef, Eina_Bool locked)
|
||||||
ef->references--;
|
ef->references--;
|
||||||
/* if its still referenced - dont go any further */
|
/* if its still referenced - dont go any further */
|
||||||
if (ef->references > 0)
|
if (ef->references > 0)
|
||||||
goto on_error; /* flush any writes */
|
goto on_error; /* flush any writes */
|
||||||
|
|
||||||
err = eet_flush2(ef);
|
err = eet_flush2(ef);
|
||||||
|
|
||||||
|
@ -1367,7 +1367,10 @@ eet_internal_close(Eet_File *ef, Eina_Bool locked)
|
||||||
if (ef->mode == EET_FILE_MODE_READ)
|
if (ef->mode == EET_FILE_MODE_READ)
|
||||||
eet_cache_del(ef, &eet_readers, &eet_readers_num, &eet_readers_alloc);
|
eet_cache_del(ef, &eet_readers, &eet_readers_num, &eet_readers_alloc);
|
||||||
else if ((ef->mode == EET_FILE_MODE_WRITE) ||
|
else if ((ef->mode == EET_FILE_MODE_WRITE) ||
|
||||||
(ef->mode == EET_FILE_MODE_READ_WRITE))
|
(
|
||||||
|
ef
|
||||||
|
->
|
||||||
|
mode == EET_FILE_MODE_READ_WRITE))
|
||||||
eet_cache_del(ef, &eet_writers, &eet_writers_num, &eet_writers_alloc);
|
eet_cache_del(ef, &eet_writers, &eet_writers_num, &eet_writers_alloc);
|
||||||
|
|
||||||
/* we can unlock the cache now */
|
/* we can unlock the cache now */
|
||||||
|
@ -1957,7 +1960,7 @@ eet_read_direct(Eet_File *ef, const char *name, int *size_ret)
|
||||||
/* uncompressed data */
|
/* uncompressed data */
|
||||||
if (efn->compression == 0
|
if (efn->compression == 0
|
||||||
&& efn->ciphered == 0)
|
&& efn->ciphered == 0)
|
||||||
data = efn->data ? efn->data : ef->data + efn->offset; /* compressed data */
|
data = efn->data ? efn->data : ef->data + efn->offset; /* compressed data */
|
||||||
else
|
else
|
||||||
data = NULL;
|
data = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue