mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.0.7rc1.tar
This commit is contained in:
@@ -228,7 +228,9 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
|
||||
if ((pbImageData = (png_byte *) malloc(ulRowBytes * (*piHeight)
|
||||
* sizeof(png_byte))) == NULL)
|
||||
{
|
||||
png_error(png_ptr, "Visual PNG: out of memory");
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
*ppbImageData = pbImageData = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
*ppbImageData = pbImageData;
|
||||
|
||||
@@ -237,7 +239,10 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
|
||||
if ((ppbRowPointers = (png_bytepp) malloc((*piHeight)
|
||||
* sizeof(png_bytep))) == NULL)
|
||||
{
|
||||
png_error(png_ptr, "Visual PNG: out of memory");
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
free(pbImageData);
|
||||
*ppbImageData = pbImageData = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// set the individual row-pointers to point at the correct offsets
|
||||
@@ -264,7 +269,6 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
|
||||
Catch (msg)
|
||||
{
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
|
||||
*ppbImageData = pbImageData = NULL;
|
||||
|
||||
if(ppbRowPointers)
|
||||
|
||||
@@ -4,20 +4,13 @@ Microsoft Developer Studio Build File, Format Version 6.00 for VisualPng
|
||||
Copyright 2000, Willem van Schaik. For conditions of distribution and
|
||||
use, see the copyright/license/disclaimer notice in png.h
|
||||
|
||||
As a PNG .dll demo VisualPng is finished. More features would only hinder
|
||||
the program's objective. However, further extensions (like support for other
|
||||
graphics formats) are in development. To get these, or for pre-compiled
|
||||
binaries, go to "http://www.schaik.com/png/visualpng.html".
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Assumes that
|
||||
|
||||
libpng DLLs and LIBs are in ..\..\msvc\win32\libpng
|
||||
zlib DLLs and LIBs are in ..\..\msvc\win32\zlib
|
||||
libpng header files are in ..\..\..\libpng
|
||||
zlib header files are in ..\..\..\zlib
|
||||
the pngsuite images are in ..\pngsuite
|
||||
zlib DLLs and LIBs are in ..\..\msvc\win32\zlib
|
||||
libpng header files are in ..\..\..\libpng
|
||||
zlib header files are in ..\..\..\zlib
|
||||
the pngsuite images are in ..\pngsuite
|
||||
|
||||
To build:
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 208 B |
@@ -1,5 +1,5 @@
|
||||
/*===
|
||||
cexcept.h 1.0.0 (2000-Jun-21-Wed)
|
||||
cexcept.h 0.6.1 (2000-Apr-22-Sat)
|
||||
Adam M. Costello <amc@cs.berkeley.edu>
|
||||
|
||||
An interface for exception-handling in ANSI C, developed jointly with
|
||||
@@ -107,15 +107,14 @@ Catch (expression) statement
|
||||
confusion with the C++ keywords, which have subtly different
|
||||
semantics.
|
||||
|
||||
A Try/Catch statement has a syntax similar to an if/else
|
||||
statement, except that the parenthesized expression goes after
|
||||
the second keyword rather than the first. As with if/else,
|
||||
there are two clauses, each of which may be a simple statement
|
||||
ending with a semicolon or a brace-enclosed compound statement.
|
||||
But whereas the else clause is optional, the Catch clause is
|
||||
required. The expression must be a modifiable lvalue (something
|
||||
capable of being assigned to) of the exact same type passed to
|
||||
define_exception_type().
|
||||
A Try/Catch statement has a syntax similar to an if/else statement,
|
||||
except that the parenthesized expression goes after the second
|
||||
keyword rather than the first. As with if/else, there are two
|
||||
clauses, each of which may be a simple statement ending with a
|
||||
semicolon or a brace-enclosed compound statement. But whereas
|
||||
the else clause is optional, the Catch clause is required. The
|
||||
expression must be an lvalue (something capable of being assigned
|
||||
to) of the exact same type passed to define_exception_type().
|
||||
|
||||
If a Throw that uses the same exception context as the Try/Catch is
|
||||
executed within the Try clause (typically within a function called
|
||||
@@ -136,17 +135,9 @@ Catch (expression) statement
|
||||
return, break, continue, goto, longjmp) is forbidden--the compiler
|
||||
will not complain, but bad things will happen at run-time. Jumping
|
||||
into or out of a Catch clause is okay, and so is jumping around
|
||||
inside a Try clause. In many cases where one is tempted to return
|
||||
from a Try clause, it will suffice to use Throw, and then return
|
||||
from the Catch clause. Another option is to set a flag variable and
|
||||
use goto to jump to the end of the Try clause, then check the flag
|
||||
after the Try/Catch statement.
|
||||
|
||||
IMPORTANT: The values of any non-volatile automatic variables
|
||||
changed within the Try clause are undefined after an exception is
|
||||
caught. Therefore, variables modified inside the Try block whose
|
||||
values are needed later outside the Try block must either use static
|
||||
storage or be declared with the "volatile" type qualifier.
|
||||
inside a Try clause. Also note that the values of any non-volatile
|
||||
automatic variables changed within the Try clause are undefined
|
||||
after an exception is caught.
|
||||
|
||||
|
||||
Throw expression;
|
||||
@@ -158,8 +149,8 @@ Throw expression;
|
||||
be compatible with the type passed to define_exception_type(). The
|
||||
exception must be caught, otherwise the program may crash.
|
||||
|
||||
Slight limitation: If the expression is a comma-expression it must
|
||||
be enclosed in parentheses.
|
||||
Slight limitation: The expression cannot be a comma-expression (but
|
||||
no one would want to use a comma-expression here anyway).
|
||||
|
||||
|
||||
Try statement
|
||||
|
||||
Reference in New Issue
Block a user