mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
minor tweaks
This commit is contained in:
@@ -224,7 +224,7 @@ static void jpeg_buffer_src( j_decompress_ptr cinfo, void* buffer, int bufsize )
|
||||
* This makes it unsafe to use this manager and a different source
|
||||
* manager serially with the same JPEG object. Caveat programmer.
|
||||
*/
|
||||
if ( cinfo->src == NULL ) { /* first time for this JPEG object? */
|
||||
if ( cinfo->src == nullptr ) { /* first time for this JPEG object? */
|
||||
cinfo->src = (struct jpeg_source_mgr *)
|
||||
( *cinfo->mem->alloc_small )( (j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||
sizeof( my_source_mgr ) );
|
||||
@@ -243,7 +243,7 @@ static void jpeg_buffer_src( j_decompress_ptr cinfo, void* buffer, int bufsize )
|
||||
src->src_buffer = (JOCTET *)buffer;
|
||||
src->src_size = bufsize;
|
||||
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
|
||||
src->pub.next_input_byte = NULL; /* until buffer loaded */
|
||||
src->pub.next_input_byte = nullptr; /* until buffer loaded */
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
@@ -324,7 +324,7 @@ Image* LoadKTXBuff( PointerInputStream& istream ){
|
||||
auto *image = new RGBAImage( width, height );
|
||||
|
||||
if ( type ) {
|
||||
KTX_Decoder* decoder = NULL;
|
||||
KTX_Decoder* decoder = nullptr;
|
||||
switch ( type )
|
||||
{
|
||||
case KTX_TYPE_UNSIGNED_BYTE:
|
||||
|
||||
@@ -58,7 +58,7 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
|
||||
// http://www.libpng.org/pub/png/libpng-manual.html
|
||||
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
( PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
( PNG_LIBPNG_VER_STRING, (png_voidp)nullptr,
|
||||
user_error_fn, user_warning_fn );
|
||||
if ( !png_ptr ) {
|
||||
globalErrorStream() << "libpng error: png_create_read_struct\n";
|
||||
@@ -67,14 +67,14 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
|
||||
|
||||
png_infop info_ptr = png_create_info_struct( png_ptr );
|
||||
if ( !info_ptr ) {
|
||||
png_destroy_read_struct( &png_ptr, (png_infopp)NULL, (png_infopp)NULL );
|
||||
png_destroy_read_struct( &png_ptr, (png_infopp)nullptr, (png_infopp)nullptr );
|
||||
globalErrorStream() << "libpng error: png_create_info_struct (info_ptr)\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_infop end_info = png_create_info_struct( png_ptr );
|
||||
if ( !end_info ) {
|
||||
png_destroy_read_struct( &png_ptr, &info_ptr, (png_infopp)NULL );
|
||||
png_destroy_read_struct( &png_ptr, &info_ptr, (png_infopp)nullptr );
|
||||
globalErrorStream() << "libpng error: png_create_info_struct (end_info)\n";
|
||||
return 0;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
|
||||
png_read_end( png_ptr, info_ptr );
|
||||
|
||||
/* free up the memory structure */
|
||||
png_destroy_read_struct( &png_ptr, &info_ptr, NULL );
|
||||
png_destroy_read_struct( &png_ptr, &info_ptr, nullptr );
|
||||
|
||||
free( row_pointers );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user