[speex-dev] minor suggestions

Jean-Marc Valin
2004-08-06T15:01:41Z

I did some modifications to address the problems you have. I think I
fixed the alignment problem without the pragma you suggested, but I
don't have the setup to test it. It's in CVS, so tell me if there are
still some problems left.

        Jean-Marc

Le jeu 30/01/2003 à 18:58, Daniel Vogel a écrit
:
> I just compiled the current code in CVS with VS.NET on Windows and here are
> some minor annoyances:
>
> You might want to put the below code in a central header which is included
> by every file though NOT by speex.h so including speex.h doesn't mess
with
> my warning levels.
>
> #if _MSC_VER
> #pragma warning(disable : 4244) /* conversion to float, possible loss of
> data	*/
> #pragma warning(disable : 4305) /* truncation from double to float */
> #endif
>
>
> The headers define structs which are then passed to the library when using
> libspeex which is a problem as different alignment restrictions will cause
> problems. E.g. the default max alignment is 8 bytes with VC6/ VS.NET though
> we use 4 byte which means speex.h has to ensure that the alignment matches
> the alignment used to compile libspeex. The easiest approach is to do
> something like:
>
> #if SUPPORTS_PRAGMA_PACK
> #pragma pack (push,8)
> #endif
>
> // all struct definitions in speex.h
>
> #if SUPPORTS_PRAGMA_PACK
> #pragma pack (pop)
> #endif
>
> And then define SUPPORTS_PRAGMA_PACK for _MSC_VER, __ICL and __GNUG__
(can't
> remember whether it was 2.96 or 3.0 that added support for this pragma).
>
>
> The last time I checked Ogg Vorbis had the same problem with regard to
> struct packing and it is very annoying having to deal with from a developer
> point of view.
>
> -- Daniel, Epic Games Inc.
>
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to
'speex-dev-request@xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is
needed.
> Unsubscribe messages sent to the list will be ignored/filtered.

--
Jean-Marc Valin, M.Sc.A.
LABORIUS (http://www.gel.usherb.ca/laborius)
Université de Sherbrooke, Québec, Canada


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 242 bytes
Desc: signature.asc