diff options
| author | Greg Ercolano <erco@seriss.com> | 2013-09-21 16:41:23 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2013-09-21 16:41:23 +0000 |
| commit | 2082d7e1978952138155be7dce29f20004bd71a5 (patch) | |
| tree | 0c64cec27ca635de750158a18715cf39d482bfa7 /src/Fl_PNG_Image.cxx | |
| parent | 2fc6c3a39b6be6f8a6b9a9dd1d030b46d7ea71bf (diff) | |
Fixes STR# 2973: collection of Sun compiler fixes.
Applied str_2973_r9979_sun-fix-warnings-7.patch (with small mods)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9980 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_PNG_Image.cxx')
| -rw-r--r-- | src/Fl_PNG_Image.cxx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx index 9f8e368b3..3f5164fee 100644 --- a/src/Fl_PNG_Image.cxx +++ b/src/Fl_PNG_Image.cxx @@ -51,20 +51,22 @@ typedef struct { const unsigned char *last; } fl_png_memory; -static void png_read_data_from_mem( png_structp png_ptr, //pointer to our data - png_bytep data, // where to copy the image data for libpng computing - png_size_t length) // length of data to copy -{ - fl_png_memory *png_mem_data = (fl_png_memory*)png_get_io_ptr(png_ptr); // get the pointer to our struct - if (png_mem_data->current + length > png_mem_data->last) { - png_error(png_mem_data->pp, "Invalid attempt to read row data"); - return; +extern "C" { + static void png_read_data_from_mem( png_structp png_ptr, //pointer to our data + png_bytep data, // where to copy the image data for libpng computing + png_size_t length) // length of data to copy + { + fl_png_memory *png_mem_data = (fl_png_memory*)png_get_io_ptr(png_ptr); // get the pointer to our struct + if (png_mem_data->current + length > png_mem_data->last) { + png_error(png_mem_data->pp, "Invalid attempt to read row data"); + return; + } + /* copy data from image buffer */ + memcpy (data, png_mem_data->current, length); + /* advance in the memory data */ + png_mem_data->current += length; } - /* copy data from image buffer */ - memcpy (data, png_mem_data->current, length); - /* advance in the memory data */ - png_mem_data->current += length; -} +} // extern "C" #endif // HAVE_LIBPNG && HAVE_LIBZ |
