mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Changed png_struct jmp_buf member name to avoid clash with macro
This commit is contained in:
parent
20786be695
commit
e6dc85bb0b
@ -365,7 +365,7 @@ handling and memory alloc/free functions.
|
|||||||
When libpng encounters an error, it expects to longjmp back
|
When libpng encounters an error, it expects to longjmp back
|
||||||
to your routine. Therefore, you will need to call setjmp and pass
|
to your routine. Therefore, you will need to call setjmp and pass
|
||||||
your png_jmpbuf(png_ptr). If you read the file from different
|
your png_jmpbuf(png_ptr). If you read the file from different
|
||||||
routines, you will need to update the jmpbuf field every time you enter
|
routines, you will need to update the longjmp buffer every time you enter
|
||||||
a new routine that will call a png_*() function.
|
a new routine that will call a png_*() function.
|
||||||
|
|
||||||
See your documentation of setjmp/longjmp for your compiler for more
|
See your documentation of setjmp/longjmp for your compiler for more
|
||||||
@ -3822,7 +3822,7 @@ absolutely necessary) interlace an image.
|
|||||||
|
|
||||||
libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls
|
libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls
|
||||||
the application-provided png_longjmp_ptr on the internal, but application
|
the application-provided png_longjmp_ptr on the internal, but application
|
||||||
initialized, jmpbuf. It is provided as a convenience to avoid the need
|
initialized, longjmp buffer. It is provided as a convenience to avoid the need
|
||||||
to use the png_jmpbuf macro, which had the unnecessary side effect of
|
to use the png_jmpbuf macro, which had the unnecessary side effect of
|
||||||
resetting the internal png_longjmp_ptr value.
|
resetting the internal png_longjmp_ptr value.
|
||||||
|
|
||||||
|
4
libpng.3
4
libpng.3
@ -1308,7 +1308,7 @@ handling and memory alloc/free functions.
|
|||||||
When libpng encounters an error, it expects to longjmp back
|
When libpng encounters an error, it expects to longjmp back
|
||||||
to your routine. Therefore, you will need to call setjmp and pass
|
to your routine. Therefore, you will need to call setjmp and pass
|
||||||
your png_jmpbuf(png_ptr). If you read the file from different
|
your png_jmpbuf(png_ptr). If you read the file from different
|
||||||
routines, you will need to update the jmpbuf field every time you enter
|
routines, you will need to update the longjmp buffer every time you enter
|
||||||
a new routine that will call a png_*() function.
|
a new routine that will call a png_*() function.
|
||||||
|
|
||||||
See your documentation of setjmp/longjmp for your compiler for more
|
See your documentation of setjmp/longjmp for your compiler for more
|
||||||
@ -4765,7 +4765,7 @@ absolutely necessary) interlace an image.
|
|||||||
|
|
||||||
libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls
|
libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls
|
||||||
the application-provided png_longjmp_ptr on the internal, but application
|
the application-provided png_longjmp_ptr on the internal, but application
|
||||||
initialized, jmpbuf. It is provided as a convenience to avoid the need
|
initialized, longjmp buffer. It is provided as a convenience to avoid the need
|
||||||
to use the png_jmpbuf macro, which had the unnecessary side effect of
|
to use the png_jmpbuf macro, which had the unnecessary side effect of
|
||||||
resetting the internal png_longjmp_ptr value.
|
resetting the internal png_longjmp_ptr value.
|
||||||
|
|
||||||
|
12
pngerror.c
12
pngerror.c
@ -272,7 +272,7 @@ png_set_longjmp_fn(png_structp png_ptr, png_longjmp_ptr longjmp_fn,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
png_ptr->longjmp_fn = longjmp_fn;
|
png_ptr->longjmp_fn = longjmp_fn;
|
||||||
return &png_ptr->png_jmpbuf;
|
return &png_ptr->longjmp_buffer;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -335,13 +335,13 @@ png_longjmp,(png_structp png_ptr, int val),PNG_NORETURN)
|
|||||||
{
|
{
|
||||||
# ifdef USE_FAR_KEYWORD
|
# ifdef USE_FAR_KEYWORD
|
||||||
{
|
{
|
||||||
jmp_buf png_jmpbuf;
|
jmp_buf tmp_jmpbuf;
|
||||||
png_memcpy(png_jmpbuf, png_ptr->png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(tmp_jmpbuf, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
|
||||||
png_ptr->longjmp_fn(png_jmpbuf, val);
|
png_ptr->longjmp_fn(tmp_jmpbuf, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
png_ptr->longjmp_fn(png_ptr->png_jmpbuf, val);
|
png_ptr->longjmp_fn(png_ptr->longjmp_buffer, val);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -403,7 +403,7 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
|||||||
/* This function is called when the application wants to use another method
|
/* This function is called when the application wants to use another method
|
||||||
* of handling errors and warnings. Note that the error function MUST NOT
|
* of handling errors and warnings. Note that the error function MUST NOT
|
||||||
* return to the calling routine or serious problems will occur. The return
|
* return to the calling routine or serious problems will occur. The return
|
||||||
* method used in the default routine calls longjmp(png_ptr->png_jmpbuf, 1)
|
* method used in the default routine calls longjmp(png_ptr->longjmp_buffer, 1)
|
||||||
*/
|
*/
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
|
png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
|
||||||
|
10
pngread.c
10
pngread.c
@ -47,7 +47,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
jmp_buf png_jmpbuf;
|
jmp_buf tmp_jmpbuf;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -85,13 +85,13 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
encounter a png_error() will longjmp here. Since the jmpbuf is
|
encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||||
then meaningless we abort instead of returning. */
|
then meaningless we abort instead of returning. */
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
if (setjmp(png_jmpbuf))
|
if (setjmp(tmp_jmpbuf))
|
||||||
#else
|
#else
|
||||||
if (setjmp(png_jmpbuf(png_ptr))) /* Sets longjmp to match setjmp */
|
if (setjmp(png_jmpbuf(png_ptr))) /* Sets longjmp to match setjmp */
|
||||||
#endif
|
#endif
|
||||||
PNG_ABORT();
|
PNG_ABORT();
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
png_memcpy(png_jmpbuf(png_ptr), png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(png_jmpbuf(png_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
#endif /* PNG_SETJMP_SUPPORTED */
|
#endif /* PNG_SETJMP_SUPPORTED */
|
||||||
|
|
||||||
@ -1275,7 +1275,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr,
|
|||||||
* being used again.
|
* being used again.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
png_memcpy(tmp_jmp, png_ptr->png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(tmp_jmp, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
error_fn = png_ptr->error_fn;
|
error_fn = png_ptr->error_fn;
|
||||||
@ -1295,7 +1295,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
png_memcpy(png_ptr->png_jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
|
png_memcpy(png_ptr->longjmp_buffer, tmp_jmp, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
struct png_struct_def
|
struct png_struct_def
|
||||||
{
|
{
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
jmp_buf png_jmpbuf; /* used in png_error */
|
jmp_buf longjmp_buffer; /* used in png_error */
|
||||||
png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */
|
png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */
|
||||||
#endif
|
#endif
|
||||||
png_error_ptr error_fn; /* function for printing errors and aborting */
|
png_error_ptr error_fn; /* function for printing errors and aborting */
|
||||||
|
10
pngtest.c
10
pngtest.c
@ -779,7 +779,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
int bit_depth, color_type;
|
int bit_depth, color_type;
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
jmp_buf png_jmpbuf;
|
jmp_buf tmp_jmpbuf;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
pngtest_debug("Setting jmpbuf for read struct");
|
pngtest_debug("Setting jmpbuf for read struct");
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
if (setjmp(png_jmpbuf))
|
if (setjmp(tmp_jmpbuf))
|
||||||
#else
|
#else
|
||||||
if (setjmp(png_jmpbuf(read_ptr)))
|
if (setjmp(png_jmpbuf(read_ptr)))
|
||||||
#endif
|
#endif
|
||||||
@ -866,14 +866,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
png_memcpy(png_jmpbuf(read_ptr), png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(png_jmpbuf(read_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SUPPORTED
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
pngtest_debug("Setting jmpbuf for write struct");
|
pngtest_debug("Setting jmpbuf for write struct");
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
|
|
||||||
if (setjmp(png_jmpbuf))
|
if (setjmp(tmp_jmpbuf))
|
||||||
#else
|
#else
|
||||||
if (setjmp(png_jmpbuf(write_ptr)))
|
if (setjmp(png_jmpbuf(write_ptr)))
|
||||||
#endif
|
#endif
|
||||||
@ -890,7 +890,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
png_memcpy(png_jmpbuf(write_ptr), png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(png_jmpbuf(write_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
10
pngwrite.c
10
pngwrite.c
@ -462,7 +462,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
png_structp png_ptr;
|
png_structp png_ptr;
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
jmp_buf png_jmpbuf;
|
jmp_buf tmp_jmpbuf;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
int i;
|
int i;
|
||||||
@ -489,12 +489,12 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
encounter a png_error() will longjmp here. Since the jmpbuf is
|
encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||||
then meaningless we abort instead of returning. */
|
then meaningless we abort instead of returning. */
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
if (setjmp(png_jmpbuf))
|
if (setjmp(tmp_jmpbuf))
|
||||||
#else
|
#else
|
||||||
if (setjmp(png_jmpbuf(png_ptr))) /* sets longjmp to match setjmp */
|
if (setjmp(png_jmpbuf(png_ptr))) /* sets longjmp to match setjmp */
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
png_memcpy(png_jmpbuf(png_ptr), png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(png_jmpbuf(png_ptr), tmp_jmpbuf, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
PNG_ABORT();
|
PNG_ABORT();
|
||||||
#endif
|
#endif
|
||||||
@ -1020,7 +1020,7 @@ png_write_destroy(png_structp png_ptr)
|
|||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
/* Reset structure */
|
/* Reset structure */
|
||||||
png_memcpy(tmp_jmp, png_ptr->png_jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(tmp_jmp, png_ptr->longjmp_buffer, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
error_fn = png_ptr->error_fn;
|
error_fn = png_ptr->error_fn;
|
||||||
@ -1040,7 +1040,7 @@ png_write_destroy(png_structp png_ptr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
png_memcpy(png_ptr->png_jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
|
png_memcpy(png_ptr->longjmp_buffer, tmp_jmp, png_sizeof(jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user