From f237aad2923b7d402b7fd2a0a71aa1a030ddeebb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 5 May 2011 00:54:04 +0100 Subject: [PATCH] Make retrace_call void() --- glretrace_main.cpp | 9 +++++---- retrace.hpp | 2 +- retrace.py | 10 ++-------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/glretrace_main.cpp b/glretrace_main.cpp index 922ec30..4fd8304 100644 --- a/glretrace_main.cpp +++ b/glretrace_main.cpp @@ -158,15 +158,16 @@ static void display(void) { const std::string &name = call->name(); bool skipCall = false; + if (retrace::verbosity >= 1) { + std::cout << *call; + std::cout.flush(); + } + if ((name[0] == 'w' && name[1] == 'g' && name[2] == 'l') || (name[0] == 'g' && name[1] == 'l' && name[2] == 'X')) { // XXX: We ignore the majority of the OS-specific calls for now if (name == "glXSwapBuffers" || name == "wglSwapBuffers") { - if (retrace::verbosity >= 1) { - std::cout << *call; - std::cout.flush(); - }; frame_complete(call->no); if (double_buffer) drawable->swapBuffers(); diff --git a/retrace.hpp b/retrace.hpp index 916cf38..05cef59 100644 --- a/retrace.hpp +++ b/retrace.hpp @@ -82,7 +82,7 @@ public: extern int verbosity; -bool retrace_call(Trace::Call &call); +void retrace_call(Trace::Call &call); } /* namespace retrace */ diff --git a/retrace.py b/retrace.py index 27d0afe..6c688b9 100644 --- a/retrace.py +++ b/retrace.py @@ -246,14 +246,9 @@ class Retracer: if function.sideeffects: self.retrace_function(function) - print 'bool retrace::retrace_call(Trace::Call &call) {' + print 'void retrace::retrace_call(Trace::Call &call) {' print ' const char *name = call.name().c_str();' print - print ' if (retrace::verbosity >= 1) {' - print ' std::cout << call;' - print ' std::cout.flush();' - print ' };' - print func_dict = dict([(function.name, function) for function in functions]) @@ -261,13 +256,12 @@ class Retracer: function = func_dict[function_name] if function.sideeffects: print ' retrace_%s(call);' % function.name - print ' return true;' + print ' return;' string_switch('name', func_dict.keys(), handle_case) print ' if (retrace::verbosity >= 0)' print ' std::cerr << call.no << ": warning: unknown call " << call.name() << "\\n";' - print ' return false;' print '}' print -- 2.7.4