[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9566: Minor addition to image clean
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9566: Minor addition to image cleanup. |
Date: |
Thu, 07 Aug 2008 12:05:12 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9566
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2008-08-07 12:05:12 +0200
message:
Minor addition to image cleanup.
Drop SIZET_FMT everywhere.
modified:
backend/render_handler_ogl.cpp
configure.ac
libbase/GC.cpp
libbase/GC.h
libbase/image.cpp
libbase/image.h
libbase/noseek_fd_adapter.cpp
libcore/parser/action_buffer.cpp
libcore/parser/button_character_def.cpp
libcore/parser/shape_character_def.cpp
libcore/parser/sprite_definition.h
libcore/swf/tag_loaders.cpp
libcore/vm/ActionExec.cpp
utilities/processor.cpp
------------------------------------------------------------
revno: 9565.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-08-07 10:08:28 +0200
message:
Return images by auto_ptr.
modified:
libbase/image.cpp
libbase/image.h
------------------------------------------------------------
revno: 9565.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-08-07 10:08:57 +0200
message:
image now returned by auto_ptr.
modified:
libcore/swf/tag_loaders.cpp
------------------------------------------------------------
revno: 9565.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-08-07 12:02:35 +0200
message:
Drop all SIZET_FMT use. Comment out in configure.ac.
modified:
backend/render_handler_ogl.cpp
configure.ac
libbase/GC.cpp
libbase/GC.h
libbase/noseek_fd_adapter.cpp
libcore/parser/action_buffer.cpp
libcore/parser/button_character_def.cpp
libcore/parser/shape_character_def.cpp
libcore/parser/sprite_definition.h
libcore/vm/ActionExec.cpp
utilities/processor.cpp
=== modified file 'backend/render_handler_ogl.cpp'
--- a/backend/render_handler_ogl.cpp 2008-06-30 16:06:18 +0000
+++ b/backend/render_handler_ogl.cpp 2008-08-07 10:02:35 +0000
@@ -129,8 +129,8 @@
// FIXME: is there any reason to do this?
OSMesaColorClamp(GL_TRUE);
- log_debug("OSMesa handle successfully created. with width " SIZET_FMT \
- " and height " SIZET_FMT ".", width, height);
+ log_debug("OSMesa handle successfully created. with width %d"
+ " and height %d.", width, height);
}
~OSRenderMesa()
=== modified file 'configure.ac'
--- a/configure.ac 2008-08-06 08:23:16 +0000
+++ b/configure.ac 2008-08-07 10:02:35 +0000
@@ -179,6 +179,9 @@
AM_CONDITIONAL(HAS_GETTEXT, test x$ac_cv_path_XGETTEXT != x)
dnl AM_GNU_GETTEXT_VERSION(0.15)
+dnl We shouldn't need SIZET_FMT anywhere anymore, so all of this
+dnl is useless.
+
dnl AC_CHECK_SIZEOF([size_t], 4, AC_INCLUDES_DEFAULT)
dnl AC_DEFINE(SIZET_FMT, ["%z"], [size_t printf modifier is z])
@@ -187,46 +190,45 @@
dnl We need to know the size of size_t in the *target* host,
dnl not the build host (right?)
dnl
-AC_LANG_PUSH(C++)
-if test "$GXX" = yes; then
-save_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS="$CXXFLAGS -Werror -Wformat"
-fi
-
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <stdio.h>], [
- size_t num = 0;
- printf("%d", num); ],
- AC_DEFINE(SIZET_FMT, ["%d"], [size_t printf modifier is d]), [
-
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <stdio.h>], [
- size_t num = 0;
- printf("%u", num); ],
- AC_DEFINE(SIZET_FMT, ["%u"], [size_t printf modifier is u]), [
-
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <stdio.h>], [
- size_t num = 0;
- printf("%lu", num); ],
- AC_DEFINE(SIZET_FMT, ["%lu"], [size_t printf modifier is lu]), [
-
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <stdio.h>], [
- size_t num = 0;
- printf("%ld", num); ],
- AC_DEFINE(SIZET_FMT, ["%ld"], [size_t printf modifier is ld])
-)])])])
-
-if test "$GXX" = yes; then
-CXXFLAGS="$save_CXXFLAGS"
-fi
-AC_LANG_POP(C++)
+dnl AC_LANG_PUSH(C++)
+dnl if test "$GXX" = yes; then
+dnl save_CXXFLAGS="$CXXFLAGS"
+dnl CXXFLAGS="$CXXFLAGS -Werror -Wformat"
+dnl fi
+
+dnl AC_TRY_COMPILE([#include <sys/types.h>
+dnl #include <stdio.h>], [
+dnl size_t num = 0;
+dnl printf("%d", num); ],
+dnl AC_DEFINE(SIZET_FMT, ["%d"], [size_t printf modifier is d]), [
+
+dnl AC_TRY_COMPILE([#include <sys/types.h>
+dnl #include <stdio.h>], [
+dnl size_t num = 0;
+dnl printf("%u", num); ],
+dnl AC_DEFINE(SIZET_FMT, ["%u"], [size_t printf modifier is u]), [
+
+dnl AC_TRY_COMPILE([#include <sys/types.h>
+dnl #include <stdio.h>], [
+dnl size_t num = 0;
+dnl printf("%lu", num); ],
+dnl AC_DEFINE(SIZET_FMT, ["%lu"], [size_t printf modifier is lu]), [
+
+dnl AC_TRY_COMPILE([#include <sys/types.h>
+dnl #include <stdio.h>], [
+dnl size_t num = 0;
+dnl printf("%ld", num); ],
+dnl AC_DEFINE(SIZET_FMT, ["%ld"], [size_t printf modifier is ld])
+dnl )])])])
+
+dnl if test "$GXX" = yes; then
+dnl CXXFLAGS="$save_CXXFLAGS"
+dnl fi
+dnl AC_LANG_POP(C++)
dnl This is primarily used when compiling for a similar architecture,
dnl like pentium->geode, which can use the same compiler, but have
-dnl different developmentAC_ARG_WITH(top_level,
AC_HELP_STRING([--with-top-level], [top level directory for cross compiling
files]), with_top_level=${withval} ; cross_compiling=yes)
-
+dnl different development libraries.
AC_ARG_WITH(top_level,
AC_HELP_STRING([--with-top-level],
=== modified file 'libbase/GC.cpp'
--- a/libbase/GC.cpp 2008-05-27 15:54:46 +0000
+++ b/libbase/GC.cpp 2008-08-07 10:02:35 +0000
@@ -67,7 +67,7 @@
GC::~GC()
{
#ifdef GNASH_GC_DEBUG
- log_debug(_("GC %p deleted, deleting all managed resources - collector
run " SIZET_FMT " times"), (void*)this, _collectorRuns);
+ log_debug(_("GC %p deleted, deleting all managed resources - collector
run %d times"), (void*)this, _collectorRuns);
#endif
#if 1
@@ -109,7 +109,7 @@
}
}
#ifdef GNASH_GC_DEBUG
- log_debug(_("GC %p: cleanUnreachable deleted " SIZET_FMT
+ log_debug(_("GC %p: cleanUnreachable deleted %d"
" resources marked as unreachable"),
(void*)this, deleted);
#endif
@@ -124,7 +124,7 @@
if ( (curResSize - _lastResCount) < maxNewCollectablesCount )
{
#if GNASH_GC_DEBUG > 1
- log_debug(_("Garbage collection skipped since number of
collectables added since last run is too low (" SIZET_FMT ")"),
+ log_debug(_("Garbage collection skipped since number of
collectables added since last run is too low (%d)"),
curResSize - _lastResCount);
#endif // GNASH_GC_DEBUG
return;
@@ -135,7 +135,7 @@
#endif
#ifdef GNASH_GC_DEBUG
- log_debug(_("GC %p Starting collector: " SIZET_FMT " collectables"),
(void *)this, curResSize);
+ log_debug(_("GC %p Starting collector: %d collectables"), (void *)this,
curResSize);
#endif // GNASH_GC_DEBUG
#ifndef NDEBUG
=== modified file 'libbase/GC.h'
--- a/libbase/GC.h 2008-04-22 13:06:49 +0000
+++ b/libbase/GC.h 2008-08-07 10:02:35 +0000
@@ -238,7 +238,7 @@
_resList.push_back(item);
#if GNASH_GC_DEBUG > 1
- log_debug(_("GC %p: collectable %p added, num collectables: "
SIZET_FMT), (void*)this, (void*)item, _resList.size());
+ log_debug(_("GC %p: collectable %p added, num collectables:
%d"), (void*)this, (void*)item, _resList.size());
#endif
}
=== modified file 'libbase/image.cpp'
--- a/libbase/image.cpp 2008-08-06 19:25:21 +0000
+++ b/libbase/image.cpp 2008-08-07 08:08:28 +0000
@@ -233,7 +233,7 @@
return im;
}
- rgb* readSWFJpeg2WithTables(JpegImageInput* j_in)
+ std::auto_ptr<rgb> readSWFJpeg2WithTables(JpegImageInput* j_in)
// Create and read a new image, using a input object that
// already has tables loaded. The IJG documentation describes
// this as "abbreviated" format.
@@ -250,7 +250,7 @@
j_in->finishImage();
- return im.release();
+ return im;
}
=== modified file 'libbase/image.h'
--- a/libbase/image.h 2008-08-06 19:25:21 +0000
+++ b/libbase/image.h 2008-08-07 08:08:28 +0000
@@ -234,7 +234,7 @@
/// \brief
/// For reading SWF JPEG2-style image data, using pre-loaded
/// headers stored in the given jpeg::input object.
- DSOEXPORT rgb* readSWFJpeg2WithTables(JpegImageInput* loader);
+ DSOEXPORT std::auto_ptr<rgb> readSWFJpeg2WithTables(JpegImageInput*
loader);
/// \brief
/// For reading SWF JPEG3-style image data, like ordinary JPEG,
=== modified file 'libbase/noseek_fd_adapter.cpp'
--- a/libbase/noseek_fd_adapter.cpp 2008-07-17 07:51:59 +0000
+++ b/libbase/noseek_fd_adapter.cpp 2008-08-07 10:02:35 +0000
@@ -25,7 +25,6 @@
#include "log.h"
#include <unistd.h> // for ::read
-#include <cstring>
#include <boost/scoped_array.hpp>
@@ -34,10 +33,8 @@
// define this if you want seeks back to be reported (on stderr)
//#define GNASH_NOSEEK_FD_WARN_SEEKSBACK 1
-
-#include <stdexcept>
+#include <cerrno>
#include <cstdio>
-#include <cerrno>
#include <sys/types.h>
#include <sys/stat.h>
@@ -150,48 +147,46 @@
{
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "cache(%p, " SIZET_FMT ") called\n", from, sz);
+ std::cerr << boost::format("cache(%p, %d) called") % from % sz <<
std::endl;
#endif
// take note of current position
long curr_pos = ftell(_cache);
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, " current position: %ld\n", curr_pos);
+ std::cerr << boost::format(" current position: %ld)") % curr_pos <<
std::endl;
#endif
// seek to the end
fseek(_cache, 0, SEEK_END);
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, " after SEEK_END, position: %ld\n", ftell(_cache));
+ std::cerr << boost::format(" after SEEK_END, position: %ld") %
ftell(_cache) << std::endl;
#endif
size_t wrote = fwrite(from, 1, sz, _cache);
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, " write " SIZET_FMT " bytes\n", wrote);
+ std::cerr << boost::format(" write %d bytes") % wrote;
#endif
if ( wrote < 1 )
{
- char errmsg[256];
-
- snprintf(errmsg, 255,
- "writing to cache file: requested " SIZET_FMT ", wrote
" SIZET_FMT " (%s)",
- sz, wrote, strerror(errno));
- fprintf(stderr, "%s\n", errmsg);
- throw IOException(errmsg);
+ boost::format err = boost::format("writing to cache file: requested
%d, wrote %d (%s)")
+ % sz % wrote % std::strerror(errno);
+
+ std::cerr << err << std::endl;
+ throw IOException(err.str());
}
_cached += sz;
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, " after write, position: %ld\n", ftell(_cache));
+ std::cerr << boost::format(" after write, position: %ld") %
std::ftell(_cache) << std::endl;
#endif
// reset position for next read
fseek(_cache, curr_pos, SEEK_SET);
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, " after seek-back, position: %ld\n", ftell(_cache));
+ std::cerr << boost::format(" after seek-back, position: %ld") %
std::ftell(_cache) << std::endl;
#endif
clearerr(_cache);
@@ -205,7 +200,7 @@
NoSeekFile::fill_cache(size_t size)
{
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "fill_cache(%d) called\n", size);
+ std::cerr << boost::format(" fill_cache(%d) called") % size << std::endl;
#endif
// See how big is the cache
@@ -219,7 +214,7 @@
bytesNeeded = chunkSize; // why read less ?
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, " bytes needed = " SIZET_FMT "\n", bytesNeeded);
+ std::cerr << boost::format(" bytes needed = %d") % bytesNeeded <<
std::endl;
#endif
ssize_t bytesRead = ::read(_fd, (void*)_buf, bytesNeeded);
@@ -237,7 +232,7 @@
if ( bytesRead == 0 )
{
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "EOF reached\n");
+ std::cerr << "EOF reached" << std::endl;
#endif
_running = false;
return;
@@ -301,13 +296,13 @@
NoSeekFile::read(void *dst, int bytes)
{
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "read_cache(%d) called\n", bytes);
+ std::cerr << boost::format("read_cache(%d) called") % bytes <<
std::endl;
#endif
if ( eof() )
{
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "read_cache: at eof!\n");
+ std::cerr << "read_cache: at eof!" << std::endl;
#endif
return 0;
}
@@ -325,18 +320,18 @@
{
if ( ferror(_cache) )
{
- fprintf(stderr, "an error occurred while reading from cache\n");
+ std::cerr << "an error occurred while reading from cache" <<
std::endl;
}
#if GNASH_NOSEEK_FD_VERBOSE
if ( feof(_cache) )
{
- fprintf(stderr, "EOF reached while reading from cache\n");
+ std::cerr << "EOF reached while reading from cache" << std::endl;
}
#endif
}
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "fread from _cache returned " SIZET_FMT "\n", ret);
+ std::cerr << boost::format("fread from _cache returned %d") % ret <<
std::endl;
#endif
return ret;
@@ -350,7 +345,7 @@
bool ret = ( ! _running && feof(_cache) );
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "eof() returning %d\n", ret);
+ std::cerr << boost::format("eof() returning %d") % ret << std::endl;
#endif
return ret;
@@ -360,10 +355,10 @@
int
NoSeekFile::tell() const
{
- int ret = ftell(_cache);
+ int ret = std::ftell(_cache);
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "tell() returning %ld\n", ret);
+ std::cerr << boost::format("tell() returning %ld") % ret << std::endl;
#endif
return ret;
@@ -376,16 +371,15 @@
{
#ifdef GNASH_NOSEEK_FD_WARN_SEEKSBACK
if ( pos < tell() ) {
- fprintf(stderr,
- "Warning: seek backward requested (%ld from %ld)\n",
- pos, tell());
+ std::cerr << boost::format("Warning: seek backward requested "
+ "(%ld from %ld)") % pos % tell() << std::endl;
}
#endif
fill_cache(pos);
- if ( fseek(_cache, pos, SEEK_SET) == -1 ) {
- fprintf(stderr, "Warning: fseek failed\n");
+ if ( std::fseek(_cache, pos, SEEK_SET) == -1 ) {
+ std::cerr << "Warning: fseek failed" << std::endl;
return -1;
} else {
return 0;
@@ -404,7 +398,7 @@
make_stream(int fd, const char* cachefilename)
{
#ifdef GNASH_NOSEEK_FD_VERBOSE
- fprintf(stderr, "making NoSeekFile stream for fd %d\n", fd);
+ std::cerr << boost::format("making NoSeekFile stream for fd %d") % fd
<< std::endl;
#endif
NoSeekFile* stream = NULL;
@@ -412,7 +406,7 @@
try {
stream = new NoSeekFile(fd, cachefilename);
} catch (const std::exception& ex) {
- fprintf(stderr, "NoSeekFile stream: %s\n", ex.what());
+ std::cerr << boost::format("NoSeekFile stream: %s") % ex.what()
<< std::endl;
delete stream;
return NULL;
}
=== modified file 'libcore/parser/action_buffer.cpp'
--- a/libcore/parser/action_buffer.cpp 2008-06-17 10:34:58 +0000
+++ b/libcore/parser/action_buffer.cpp 2008-08-07 10:02:35 +0000
@@ -127,7 +127,7 @@
#if 0 // debugging
if (m_decl_dict_processed_at != -1) {
- log_debug(_("process_decl_dict(" SIZET_FMT ", " SIZET_FMT "): decl_dict
was already processed at %d. "
+ log_debug(_("process_decl_dict(%d, %d): decl_dict was already processed at
%d. "
"Overriding."),
start_pc, stop_pc, m_decl_dict_processed_at);
//return;
=== modified file 'libcore/parser/button_character_def.cpp'
--- a/libcore/parser/button_character_def.cpp 2008-06-09 17:12:54 +0000
+++ b/libcore/parser/button_character_def.cpp 2008-08-07 10:02:35 +0000
@@ -300,7 +300,7 @@
log_parse(" in_point = %d", m_in_point);
log_parse(" out_point = %d", m_out_point);
log_parse(" loop_count = %d", m_loop_count);
- log_parse(" envelope size = " SIZET_FMT , m_envelopes.size());
+ log_parse(" envelope size = %d", m_envelopes.size());
);
}
=== modified file 'libcore/parser/shape_character_def.cpp'
--- a/libcore/parser/shape_character_def.cpp 2008-07-09 07:33:34 +0000
+++ b/libcore/parser/shape_character_def.cpp 2008-08-07 10:02:35 +0000
@@ -304,7 +304,7 @@
if ( style > m_fill_styles.size() )
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror(_("Invalid fill style %d in
fillStyle0Change record - " SIZET_FMT " defined. Set to 0."), style,
m_fill_styles.size());
+ log_swferror(_("Invalid fill style %d in
fillStyle0Change record - %d defined. Set to 0."), style, m_fill_styles.size());
);
style = 0;
}
@@ -350,7 +350,7 @@
if ( style > m_fill_styles.size() )
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror(_("Invalid fill style %d in
fillStyle1Change record - " SIZET_FMT " defined. Set to 0."), style,
m_fill_styles.size());
+ log_swferror(_("Invalid fill style %d in
fillStyle1Change record - %d defined. Set to 0."), style, m_fill_styles.size());
);
style = 0;
}
@@ -394,7 +394,7 @@
if ( style > m_line_styles.size() )
{
IF_VERBOSE_MALFORMED_SWF(
- log_swferror(_("Invalid fill style %d in
lineStyleChange record - " SIZET_FMT " defined. Set to 0."), style,
m_line_styles.size());
+ log_swferror(_("Invalid fill style %d in
lineStyleChange record - %d defined. Set to 0."), style, m_line_styles.size());
);
style = 0;
}
=== modified file 'libcore/parser/sprite_definition.h'
--- a/libcore/parser/sprite_definition.h 2008-07-23 17:50:23 +0000
+++ b/libcore/parser/sprite_definition.h 2008-08-07 10:02:35 +0000
@@ -301,8 +301,8 @@
while ( m_loading_frame < framenum )
{
log_debug(_("sprite_definition: "
- "loading of frame " SIZET_FMT " requested "
- "(we are at " SIZET_FMT "/" SIZET_FMT ")"),
+ "loading of frame %d requested "
+ "(we are at %d/%d)"),
framenum, m_loading_frame, m_frame_count);
// Could this ever happen ? YES ! See
tuner_7_6_0_0_pandora.swf
return false;
=== modified file 'libcore/swf/tag_loaders.cpp'
--- a/libcore/swf/tag_loaders.cpp 2008-08-06 19:25:21 +0000
+++ b/libcore/swf/tag_loaders.cpp 2008-08-07 08:08:57 +0000
@@ -296,7 +296,7 @@
std::auto_ptr<image::rgb> im;
try
{
- im.reset ( image::readSWFJpeg2WithTables(j_in) );
+ im = image::readSWFJpeg2WithTables(j_in);
}
catch (std::exception& e)
{
=== modified file 'libcore/vm/ActionExec.cpp'
--- a/libcore/vm/ActionExec.cpp 2008-08-04 11:26:37 +0000
+++ b/libcore/vm/ActionExec.cpp 2008-08-07 10:02:35 +0000
@@ -261,9 +261,6 @@
// Do we still need this ?
if ( action_id == SWF::ACTION_END )
{
- // this would turn into an assertion (next_pc==stop_pc)
- // log_debug(_("At ACTION_END next_pc=" SIZET_FMT
- // ", stop_pc=" SIZET_FMT), next_pc, stop_pc);
break;
}
=== modified file 'utilities/processor.cpp'
--- a/utilities/processor.cpp 2008-06-17 11:42:15 +0000
+++ b/utilities/processor.cpp 2008-08-07 10:02:35 +0000
@@ -468,7 +468,7 @@
++nadvances;
if ( limit_advances && nadvances >= limit_advances)
{
- log_debug("exiting after " SIZET_FMT " advances\n", nadvances);
+ log_debug("exiting after %d advances", nadvances);
break;
}
@@ -479,8 +479,8 @@
{
if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
{
- log_debug("exiting after " SIZET_FMT
- " times last frame was reached\n", end_hitcount);
+ log_debug("exiting after %d"
+ " times last frame was reached", end_hitcount);
break;
}
}
@@ -520,8 +520,8 @@
if ( last_frame > latest_frame ) latest_frame = last_frame;
if ( ++loop_back_count > allowloopbacks )
{
- log_debug(SIZET_FMT " loop backs; jumping one-after "
- "latest frame (" SIZET_FMT ")\n",
+ log_debug("%d loop backs; jumping one-after "
+ "latest frame (%d)",
loop_back_count, latest_frame+1);
m.goto_frame(latest_frame + 1);
loop_back_count = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r9566: Minor addition to image cleanup.,
Benjamin Wolsey <=