comparison matroska.c @ 381:7be99ba54f0f libavformat

big endian compile fix by ("Ronald S. Bultje" <R dot S dot Bultje at students dot uu dot nl>)
author michael
date Fri, 12 Mar 2004 02:26:01 +0000
parents 9416dc106e06
children 96f8086bc2ba
comparison
equal deleted inserted replaced
380:9416dc106e06 381:7be99ba54f0f
622 } 622 }
623 623
624 if (size == 4) { 624 if (size == 4) {
625 float f; 625 float f;
626 626
627 while (size-- > 0)
627 #ifdef WORDS_BIGENDIAN 628 #ifdef WORDS_BIGENDIAN
628 f = * (float *) data; 629 ((uint8_t *) &f)[3 - size] = get_byte(pb);
629 #else 630 #else
630 while (size-- > 0)
631 ((uint8_t *) &f)[size] = get_byte(pb); 631 ((uint8_t *) &f)[size] = get_byte(pb);
632 #endif 632 #endif
633 633
634 *num = f; 634 *num = f;
635 } else { 635 } else {
636 double d; 636 double d;
637 637
638 while (size-- > 0)
638 #ifdef WORDS_BIGENDIAN 639 #ifdef WORDS_BIGENDIAN
639 d = * (double *) data; 640 ((uint8_t *) &d)[7 - size] = get_byte(pb);
640 #else 641 #else
641 while (size-- > 0)
642 ((uint8_t *) &d)[size] = get_byte(pb); 642 ((uint8_t *) &d)[size] = get_byte(pb);
643 #endif 643 #endif
644 644
645 *num = d; 645 *num = d;
646 } 646 }