Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Multithreaded Animated GIF (A hack to get the Animated GIF example to work)
Multithreaded Animated GIF [message #44060] Sat, 20 December 2014 19:39 Go to next message
rainbowsally is currently offline  rainbowsally
Messages: 29
Registered: December 2014
Promising Member
Probs with animated gif.

Using Linux, with the default BLITZ stuff. Compiled from 5485 sources.

1. error missing format string.
/home/USER/upp/uppsrc/plugin/tif/tifupp.cpp:909:37: warning: format not a string literal and no format argu
	ments [-Wformat-security]
   TIFFError(TIFFFileName(tiff), emsg);


I modified one line (below).
// around line 908
	char emsg[1024];
	if(!TIFFRGBAImageBegin(this, tiff, 0, emsg)) {
		// TIFFError(TIFFFileName(tiff), emsg);
		TIFFError("%s %s", TIFFFileName(tiff), emsg); // -rs
		page_error = true;
		return false;
	}
// --


The error handler takes a fmt and va_list but I haven't found the definition of TIFFError() and so I'm not sure this is exactly right.

At least gets past the compiler warnings but the parameter list should be verified by someone that knows their way around in the sources.


2. Something in the #includes isn't working right. In order to enable multithreading by way of uppconfig.h all three of these appear to need to be defined.

[Edited to avoid redefs caused by BLITZ or something.]
File: uppsrc/uppconfig.h
// -rs
#ifndef UPPCONFIG_H
#define UPPCONFIG_H

#ifndef flagMT
#define flagMT
#define _MULTITHREADED
#define MULTITHREADED
#endif

#endif // UPPCONFIG_H


[Edited...]
And add the #include in CtrlCore/CtrlCore.h so it gets set
#ifndef CTRLCORE_H
#define CTRLCORE_H

#include <uppconfig.h> /* -rs added */



There IS another way, but that is to add -DflagMT to GCC.bm in the *OPTIONS flags.

And somehow that appears to turn on the _MULTITHREADDED and MULTITHREADDED #defines properly, which is why I suspect something isn't loading the uppconfig.h file at the right time.

Then finally, to see the demo, load an animated gif and hit the "next image" button. That button does nothing in single threaded mode.

[Updated on: Sun, 21 December 2014 10:39]

Report message to a moderator

Re: Multithreaded Animated GIF [message #44092 is a reply to message #44060] Wed, 24 December 2014 12:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
rainbowsally wrote on Sat, 20 December 2014 19:39
Probs with animated gif.

Using Linux, with the default BLITZ stuff. Compiled from 5485 sources.

1. error missing format string.
/home/USER/upp/uppsrc/plugin/tif/tifupp.cpp:909:37: warning: format not a string literal and no format argu
	ments [-Wformat-security]
   TIFFError(TIFFFileName(tiff), emsg);


I modified one line (below).
// around line 908
	char emsg[1024];
	if(!TIFFRGBAImageBegin(this, tiff, 0, emsg)) {
		// TIFFError(TIFFFileName(tiff), emsg);
		TIFFError("%s %s", TIFFFileName(tiff), emsg); // -rs
		page_error = true;
		return false;
	}
// --


The error handler takes a fmt and va_list but I haven't found the definition of TIFFError() and so I'm not sure this is exactly right.

At least gets past the compiler warnings but the parameter list should be verified by someone that knows their way around in the sources.


2. Something in the #includes isn't working right. In order to enable multithreading by way of uppconfig.h all three of these appear to need to be defined.

[Edited to avoid redefs caused by BLITZ or something.]
File: uppsrc/uppconfig.h
// -rs
#ifndef UPPCONFIG_H
#define UPPCONFIG_H

#ifndef flagMT
#define flagMT
#define _MULTITHREADED
#define MULTITHREADED
#endif

#endif // UPPCONFIG_H


[Edited...]
And add the #include in CtrlCore/CtrlCore.h so it gets set
#ifndef CTRLCORE_H
#define CTRLCORE_H

#include <uppconfig.h> /* -rs added */



There IS another way, but that is to add -DflagMT to GCC.bm in the *OPTIONS flags.

And somehow that appears to turn on the _MULTITHREADDED and MULTITHREADDED #defines properly, which is why I suspect something isn't loading the uppconfig.h file at the right time.

Then finally, to see the demo, load an animated gif and hit the "next image" button. That button does nothing in single threaded mode.


MT is main config flag. Click Project/Main package configuration, then click on configuration line, click right arrow, set 'Multithreaded'.

Mirek
Re: Multithreaded Animated GIF [message #44111 is a reply to message #44092] Thu, 25 December 2014 14:53 Go to previous message
rainbowsally is currently offline  rainbowsally
Messages: 29
Registered: December 2014
Promising Member
Thanks.
Previous Topic: AString::Compare missing explicit return value
Next Topic: Raster::Line segfaults ... sometimes.
Goto Forum:
  


Current Time: Thu Mar 28 17:19:27 CET 2024

Total time taken to generate the page: 0.01877 seconds