view test/testendian.c @ 1035:974ba6ae0fa3

Date: Wed, 26 Jan 2005 13:37:09 GMT From: Peter Naulls Subject: RISC OS SDL Patches Sam, I've attached a diff of the latest changes to libSDL for RISC OS support. These changes are by Alan Buckley and myself. The most significant of these are: Optimised assembler blit rountines - I've attached the file src/video/riscos/SDL_riscosASM.s which is needed for this. Move to using /dev/dsp instead of its own audio implementation. This means that src/audio/riscos/SDL_drenderer.c should be removed Typo fixes. Mainly correct spelling of "RISC OS", but some from elsewhere too.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 12 Feb 2005 18:01:31 +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);
}