comparison aviobuf.c @ 823:e8b4454b997d libavformat

remove non portable get/put_be64_double()
author michael
date Tue, 19 Jul 2005 14:50:22 +0000
parents 2614d3c1f415
children 66cc656ea404
comparison
equal deleted inserted replaced
822:2614d3c1f415 823:e8b4454b997d
208 put_byte(s, val >> 16); 208 put_byte(s, val >> 16);
209 put_byte(s, val >> 8); 209 put_byte(s, val >> 8);
210 put_byte(s, val); 210 put_byte(s, val);
211 } 211 }
212 212
213 /* IEEE format is assumed */
214 void put_be64_double(ByteIOContext *s, double val)
215 {
216 union {
217 double d;
218 uint64_t ull;
219 } u;
220 u.d = val;
221 put_be64(s, u.ull);
222 }
223
224 void put_strz(ByteIOContext *s, const char *str) 213 void put_strz(ByteIOContext *s, const char *str)
225 { 214 {
226 if (str) 215 if (str)
227 put_buffer(s, (const unsigned char *) str, strlen(str) + 1); 216 put_buffer(s, (const unsigned char *) str, strlen(str) + 1);
228 else 217 else
447 val = get_be16(s) << 16; 436 val = get_be16(s) << 16;
448 val |= get_be16(s); 437 val |= get_be16(s);
449 return val; 438 return val;
450 } 439 }
451 440
452 double get_be64_double(ByteIOContext *s)
453 {
454 union {
455 double d;
456 uint64_t ull;
457 } u;
458
459 u.ull = get_be64(s);
460 return u.d;
461 }
462
463 char *get_strz(ByteIOContext *s, char *buf, int maxlen) 441 char *get_strz(ByteIOContext *s, char *buf, int maxlen)
464 { 442 {
465 int i = 0; 443 int i = 0;
466 char c; 444 char c;
467 445