Commit graph

18 commits

Author SHA1 Message Date
Amaury Pouly
d7871914ac Fix dangerous casts
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is
not valid. In any case, one should use intptr_t and ptrdiff_t when casting
to integers. This commit attempts to fix all instances reported by GCC.
When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h

Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-02-04 17:24:47 +01:00
Thomas Jarosch
b681e932a9 mikmod plugin: Remove bogus doubled return statement
Stick to the safer version of those two.

Tested mikmod still works with some nice Necros .s3m files.

Change-Id: I6774cdf3345a4c89b2f9cf3bb8d832963ca30c38
2014-12-22 22:33:28 +01:00
Thomas Jarosch
c54537a663 Prevent theoretical out-of-bounds access in STM_Load()
We should be safe since STM_Load() should
never be called if STM_Test() fails.
Still it's better safe than sorry.

cppcheck reported:
[rockbox/apps/plugins/mikmod/load_stm.c:302]: (error) Array 'STM_Version[3]' accessed at index 3, which is out of bounds.

Change-Id: I914935fd108c492d013de24d17dcb9c227af6cd8
2014-12-20 13:37:40 +01:00
Björn Stenberg
1501df045f Deprecate the EXTRA_LIBS variable.
Instead specify explicit library dependencies for codecs and plugins.
2013-01-24 16:06:45 +01:00
Bertrik Sikken
c26ab37aca mikmod plugin: make functions static when possible
Change-Id: Ic0102071318c55c19952029be6998ecf5f33eb98
2012-04-14 17:31:14 +02:00
Thomas Martitz
c56950ea3a tlsf: move to /lib (it's also used by plugins).
Change-Id: I5e37b28c1ce4608d60b036343f280af3311ad490
2012-03-28 23:02:39 +02:00
Thomas Martitz
f269aa0060 build system: unify/simplify library handling a bit.
libs in $ROOT/lib now add to $(CORE_LIBS) and $(EXTRA_LIBS) and are
automatically linked by the core and codecs/plugins respectively.

Change-Id: Iff482c792a8c8142718f6a16a450c6e2f1497c9a
2012-03-26 22:27:40 +02:00
Michael Sevakis
286a4c5caa Revise the PCM callback system after adding multichannel audio.
Additional status callback is added to pcm_play/rec_data instead of
using a special function to set it. Status includes DMA error
reporting to the status callback. Playback and recording callback
become more alike except playback uses "const void **addr" (because
the data should not be altered) and recording  uses "void **addr".
"const" is put in place throughout where appropriate.

Most changes are fairly trivial. One that should be checked in
particular because it isn't so much is telechips, if anyone cares to
bother. PP5002 is not so trivial either but that tested as working.

Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2
Reviewed-on: http://gerrit.rockbox.org/166
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-03-03 07:23:38 +01:00
Jonathan Gordon
aa0f4a4bbe FS#12273 - use buflib for font storage. thanks to the testers :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 13:19:34 +00:00
Nils Wallménius
060b3fa4f1 mikmod: enable compiler optimizations for coldfire, they were disabled to work around a bug in the old toolchain.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30427 a1c6a512-1295-4272-9138-f99709370657
2011-09-04 08:32:02 +00:00
Andree Buschmann
6cb5ec1bfe Remove several 'set but not used' GCC 4.6.1 warnings from MikMod.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30426 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 23:54:43 +00:00
Andree Buschmann
bd9c172b9e Fix yellow and red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30425 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 23:42:50 +00:00
Andree Buschmann
e2186479d5 FS#12259: Remove '-w' compiler option for MikMod. Resolve all yet unreported compiler warnings and fix a bug in load_gt2.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30424 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 23:17:42 +00:00
Andree Buschmann
d3de6d65ec Fix compiler warnings in mikmod. Initialize 'status' and 'incnt'.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30422 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 19:12:33 +00:00
Thomas Martitz
baa070cca6 GSoC/Buflib: Enable compaction in buflib.
This enables the ability to allocate (and free) memory dynamically
without fragmentation, through compaction. This means allocations can move
and fragmentation be reduced. Most changes are preparing Rockbox for this,
which many times means adding a move callback which can temporarily disable
movement when the corresponding code is in a critical section.

For now, the audio buffer allocation has a central role, because it's the one
having allocated most. This buffer is able to shrink itself, for which it
needs to stop playback for a very short moment. For this,
audio_buffer_available() returns the size of the audio buffer which can
possibly be used by other allocations because the audio buffer can shrink.

lastfm scrobbling and timestretch can now be toggled at runtime without
requiring a reboot.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
2011-08-30 14:01:45 +00:00
Thomas Martitz
98096970e0 Cleanup tree.c cache handling a bit.
* Rename stuff to not re-use the term dircache
 * Move cache to own struct
 * Encapsulate retrieving entries a bit

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30242 a1c6a512-1295-4272-9138-f99709370657
2011-08-03 09:49:25 +00:00
Michael Sevakis
b15aa47c56 All kernel objects in code shared amongs targets (core, plugins, codecs) should be declared SHAREDBSS_ATTR as any core could potentially touch them even though they seem only to involve threads on one core. The exception is target code for particular CPUs where proper allocation is fixed. playlist.c was a little odd too-- use one mutex for the current playlist and a separate one for created playlists (still pondering the necessity of more than one).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29305 a1c6a512-1295-4272-9138-f99709370657
2011-02-14 11:27:45 +00:00
Frank Gevaerts
26f2bfde03 Add MikMod plugin, ported by Jason Yu, with some minor work by Craig Mann and William Peters (FS#8806)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28810 a1c6a512-1295-4272-9138-f99709370657
2010-12-12 15:03:30 +00:00