зеркало из https://github.com/mozilla/pjs.git
Update libmng snapshot. Not in default build.
This commit is contained in:
Родитель
64478188e4
Коммит
1e807dcdbd
|
@ -57,7 +57,9 @@ core:
|
|||
- fixed problem with cheap transparency for 4-bit gray
|
||||
- fixed display_xxxx routines for interlaced images
|
||||
- added precaution against faulty iCCP chunks from PS
|
||||
- changed userdata variable to mng_ptr
|
||||
- changed userdata variable to mng_ptr
|
||||
- added typedef for mng_size_t
|
||||
- changed size parameter for memory allocation to mng_size_t
|
||||
|
||||
samples:
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
/* * * */
|
||||
/* * 0.5.3 - 06/12/2000 - G.Juyn * */
|
||||
/* * - swapped MNG_COPY parameter-names * */
|
||||
/* * 0.5.3 - 06/27/2000 - G.Juyn * */
|
||||
/* * - changed size parameter to mng_size_t * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -41,20 +43,20 @@
|
|||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
#define MNG_ALLOC(H,P,L) { P = calloc (1, L); \
|
||||
#define MNG_ALLOC(H,P,L) { P = calloc (1, (mng_size_t)(L)); \
|
||||
if (P == 0) { MNG_ERROR (H, MNG_OUTOFMEMORY) } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = calloc (1, L); }
|
||||
#define MNG_ALLOCX(H,P,L) { P = calloc (1, (mng_size_t)(L)); }
|
||||
#define MNG_FREE(H,P,L) { if (P) { free (P); P = 0; } }
|
||||
#define MNG_FREEX(H,P,L) { if (P) free (P); }
|
||||
#else
|
||||
#define MNG_ALLOC(H,P,L) { P = H->fMemalloc (L); \
|
||||
#define MNG_ALLOC(H,P,L) { P = H->fMemalloc ((mng_size_t)(L)); \
|
||||
if (P == 0) { MNG_ERROR (H, MNG_OUTOFMEMORY) } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = H->fMemalloc (L); }
|
||||
#define MNG_FREE(H,P,L) { if (P) { H->fMemfree (P, L); P = 0; } }
|
||||
#define MNG_FREEX(H,P,L) { if (P) { H->fMemfree (P, L); } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = H->fMemalloc ((mng_size_t)(L)); }
|
||||
#define MNG_FREE(H,P,L) { if (P) { H->fMemfree (P, (mng_size_t)(L)); P = 0; } }
|
||||
#define MNG_FREEX(H,P,L) { if (P) { H->fMemfree (P, (mng_size_t)(L)); } }
|
||||
#endif /* mng_internal_memmngmt */
|
||||
|
||||
#define MNG_COPY(D,S,L) { memcpy (D, S, L); }
|
||||
#define MNG_COPY(D,S,L) { memcpy (D, S, (mng_size_t)(L)); }
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
/* * * */
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - added speedtype to facilitate testing * */
|
||||
/* * 0.5.3 - 06/27/2000 - G.Juyn * */
|
||||
/* * - added typedef for mng_size_t * */
|
||||
/* * - changed size parameter for memory callbacks to * */
|
||||
/* * mng_size_t * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -167,6 +171,8 @@ typedef unsigned char mng_uint8;
|
|||
|
||||
typedef double mng_float; /* basic float */
|
||||
|
||||
typedef size_t mng_size_t; /* size field for memory allocation */
|
||||
|
||||
typedef char * mng_pchar; /* string */
|
||||
typedef void * mng_ptr; /* generic pointer */
|
||||
|
||||
|
@ -280,9 +286,9 @@ typedef enum mng_speedtypes mng_speedtype;
|
|||
/* ************************************************************************** */
|
||||
|
||||
/* memory management callbacks */
|
||||
typedef mng_ptr MNG_DECL (*mng_memalloc) (mng_uint32 iLen);
|
||||
typedef mng_ptr MNG_DECL (*mng_memalloc) (mng_size_t iLen);
|
||||
typedef void MNG_DECL (*mng_memfree) (mng_ptr iPtr,
|
||||
mng_uint32 iLen);
|
||||
mng_size_t iLen);
|
||||
|
||||
/* I/O management callbacks */
|
||||
typedef mng_bool MNG_DECL (*mng_openstream) (mng_handle hHandle);
|
||||
|
|
|
@ -223,7 +223,7 @@ il_mng_settimer(mng_handle handle, mng_uint32 msec)
|
|||
}
|
||||
|
||||
static mng_ptr
|
||||
il_mng_alloc(mng_uint32 size)
|
||||
il_mng_alloc(mng_size_t size)
|
||||
{
|
||||
// dprintf((stderr, "=== malloc(%d)\n", size));
|
||||
void *ptr = nsMemory::Alloc(size);
|
||||
|
@ -232,7 +232,7 @@ il_mng_alloc(mng_uint32 size)
|
|||
}
|
||||
|
||||
static void
|
||||
il_mng_free(mng_ptr ptr, mng_uint32 size)
|
||||
il_mng_free(mng_ptr ptr, mng_size_t size)
|
||||
{
|
||||
// dprintf((stderr, "=== free(%d)\n", size));
|
||||
nsMemory::Free(ptr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче