Mercurial > sdl-ios-xcode
view test/testendian.c @ 929:03fb90fc135e
Date: Mon, 05 Jul 2004 14:37:59 +0200
From: Yves Maurischat
Subject: [SDL] Crashes when using aRts on Linux
We had a problem with my app using SDL. It always crashed after SDL_OpenAudio(),
if the artsd was running on a Linux machine with KDE. After some investigation
(and searching for differences in other apps using arts) we found out, that the
problem resulted from loading, calling arts_init(), calling arts_free() and
unloading the aRts-Library in .../src/audio/arts/SDL_artsaudio.c twice: first in
"static int Audio_Available()", the second time in "static SDL_AudioDevice
*Audio_CreateDevice(int devindex)".
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 18 Aug 2004 21:41:39 +0000 |
parents | c203b4a42701 |
children | 983df4f9c1c6 |
line wrap: on
line source
/* Test program to check SDL's CPU endian detection and byte swapping routines */ #include <stdio.h> #include "SDL.h" #include "SDL_endian.h" int main(int argc, char *argv[]) { Uint16 value16 = 0xCDAB; Uint32 value32 = 0xEFBEADDE; #if defined(__GNUC__) && defined(SDL_HAS_64BIT_TYPE) Uint64 value64 = 0xEFBEADDECDAB3412LL; #endif printf("This is a %s endian machine.\n", (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big"); printf("Value 16 = 0x%X, swapped = 0x%X\n", value16, SDL_Swap16(value16)); printf("Value 32 = 0x%X, swapped = 0x%X\n", value32, SDL_Swap32(value32)); #if defined(__GNUC__) && defined(SDL_HAS_64BIT_TYPE) printf("Value 64 = 0x%llX, swapped = 0x%llX\n", value64, SDL_Swap64(value64)); #endif return(0); }