# HG changeset patch # User John W. Eaton # Date 1420827952 18000 # Node ID d7057df2968e6d683b9bca61c8f4795471884778 # Parent 9bd2f0a07c959ce90891aba99739fbfaec76b2b1 use existing function to determine endianness in audiodevinfo.cc * audiodevinfo.cc (is_big_endian): Delete. (octave_play_callback, portaudio_play_callback): Use oct_mach_info::words_big_endian instead of local big_endian function. diff -r 9bd2f0a07c95 -r d7057df2968e libinterp/dldfcn/audiodevinfo.cc --- a/libinterp/dldfcn/audiodevinfo.cc Fri Jan 09 13:19:50 2015 -0500 +++ b/libinterp/dldfcn/audiodevinfo.cc Fri Jan 09 13:25:52 2015 -0500 @@ -30,6 +30,8 @@ #include #include +#include "mach-info.h" + #include "defun-dld.h" #include "error.h" #include "gripes.h" @@ -515,17 +517,6 @@ DEFINE_OCTAVE_ALLOCATOR (audioplayer); DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (audioplayer, "audioplayer", "audioplayer"); -int -is_big_endian (void) -{ - union - { - uint32_t i; - char c[4]; - } bint = { 0x01020304 }; - return bint.c[0] == 1; -} - static int octave_play_callback (const void *, void *output, unsigned long frames, const PaStreamCallbackTimeInfo *, @@ -603,7 +594,7 @@ { static double scale_factor = pow (2.0, 23) - 1.0; - static int big_endian = is_big_endian (); + static int big_endian = oct_mach_info::words_big_endian (); uint8_t *buffer = static_cast (output); @@ -719,7 +710,7 @@ { static double scale_factor = pow (2.0, 23) - 1.0; - static int big_endian = is_big_endian (); + static int big_endian = oct_mach_info::words_big_endian (); uint8_t *buffer = static_cast (output);