search for: g_little_endian

Displaying 10 results from an estimated 10 matches for "g_little_endian".

Did you mean: __little_endian
2007 Mar 20
0
2 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_net_stream.c
...58:16 2007 +0100 no more type punned pointers diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index e6a38ed..a90ba96 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -336,6 +336,7 @@ swfdec_bits_get_bdouble (SwfdecBits * b) double d; #if G_BYTE_ORDER == G_LITTLE_ENDIAN guint64 tmp; + gpointer p; #endif SWFDEC_BYTES_CHECK (b, 8); @@ -345,7 +346,8 @@ swfdec_bits_get_bdouble (SwfdecBits * b) #elif G_BYTE_ORDER == G_LITTLE_ENDIAN tmp = *((guint64 *) b->ptr); tmp = GUINT64_FROM_BE (tmp); - d = *((double *) &tmp); + p = &tmp; + d = *((dou...
2007 Feb 06
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c libswfdec/swfdec_sprite.c test/dump.c
...ride = image->width * 4; - color_table = g_malloc (color_table_size * 4); - if (have_alpha) { + ptr = lossless (bits.ptr, bits.end - bits.ptr, + color_table_size * 4 + rowstride * image->height); for (i = 0; i < color_table_size; i++) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN - color_table[i * 4 + 0] = ptr[i * 4 + 2]; - color_table[i * 4 + 1] = ptr[i * 4 + 1]; - color_table[i * 4 + 2] = ptr[i * 4 + 0]; - color_table[i * 4 + 3] = ptr[i * 4 + 3]; + guint8 tmp = ptr[i * 4 + 0]; + ptr[i * 4 + 0] = ptr[i * 4 + 2]; + ptr[i * 4...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...gt;rowstride = image->width * 4; - color_table = g_malloc (color_table_size * 4); - if (have_alpha) { + ptr = lossless (bits.ptr, bits.end - bits.ptr, + color_table_size * 4 + rowstride * image->height); for (i = 0; i < color_table_size; i++) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN - color_table[i * 4 + 0] = ptr[i * 4 + 2]; - color_table[i * 4 + 1] = ptr[i * 4 + 1]; - color_table[i * 4 + 2] = ptr[i * 4 + 0]; - color_table[i * 4 + 3] = ptr[i * 4 + 3]; + guint8 tmp = ptr[i * 4 + 0]; + ptr[i * 4 + 0] = ptr[i * 4 + 2]; + ptr[i * 4 + 2] =...
2007 Jul 11
0
libswfdec/swfdec_bits.c
...9;, struct.pack('d', 7.949928895127363e-275))" */ -static double -swfdec_bits_double_to_host (double in) +double +swfdec_bits_get_double (SwfdecBits * b) { union { guint32 i[2]; double d; } conv; - conv.d = in; + SWFDEC_BYTES_CHECK (b, 8); + #if G_BYTE_ORDER == G_LITTLE_ENDIAN - { - int tmp = conv.i[0]; - conv.i[0] = conv.i[1]; - conv.i[1] = tmp; - } + conv.i[1] = (b->ptr[3] << 24) | (b->ptr[2] << 16) | (b->ptr[1] << 8) | b->ptr[0]; + conv.i[0] = (b->ptr[7] << 24) | (b->ptr[6] << 16) | (b->ptr[5] << 8)...
2007 Jul 11
0
Branch 'as' - 3 commits - libswfdec/swfdec_bits.c
...9;, struct.pack('d', 7.949928895127363e-275))" */ -static double -swfdec_bits_double_to_host (double in) +double +swfdec_bits_get_double (SwfdecBits * b) { union { guint32 i[2]; double d; } conv; - conv.d = in; + SWFDEC_BYTES_CHECK (b, 8); + #if G_BYTE_ORDER == G_LITTLE_ENDIAN - { - int tmp = conv.i[0]; - conv.i[0] = conv.i[1]; - conv.i[1] = tmp; - } + conv.i[1] = (b->ptr[3] << 24) | (b->ptr[2] << 16) | (b->ptr[1] << 8) | b->ptr[0]; + conv.i[0] = (b->ptr[7] << 24) | (b->ptr[6] << 16) | (b->ptr[5] << 8)...
2007 Feb 06
0
21 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c
...gt;width); SWFDEC_LOG (" height = %d", image->height); } @@ -355,11 +337,7 @@ merge_alpha (SwfdecImage * image, unsign for (y = 0; y < image->height; y++) { p = image_data + y * image->rowstride; for (x = 0; x < image->width; x++) { -#if G_BYTE_ORDER == G_LITTLE_ENDIAN - p[3] = *alpha; -#else - p[0] = *alpha; -#endif + p[SWFDEC_COLOR_INDEX_ALPHA] = *alpha; p += 4; alpha++; } @@ -375,7 +353,6 @@ swfdec_image_lossless_load (SwfdecImage int len; unsigned char *endptr; SwfdecBits bits; - unsigned char *image_data = NULL;...
2007 Dec 10
0
5 commits - libswfdec/jpeg libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_cached.c libswfdec/swfdec_codec_adpcm.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_flash_security.c libswfdec/swfdec_image.c
...edc79a8..5298012 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -359,9 +359,9 @@ swfdec_bits_get_bdouble (SwfdecBits * b) SWFDEC_BYTES_CHECK (b, 8); #if G_BYTE_ORDER == G_BIG_ENDIAN - d = *((double *) b->ptr); + memcpy (&d, b->ptr, 8); #elif G_BYTE_ORDER == G_LITTLE_ENDIAN - tmp = *((guint64 *) b->ptr); + memcpy (&tmp, b->ptr, 8); tmp = GUINT64_FROM_BE (tmp); p = &tmp; d = *((double *) p); commit 66ec2cbf1f9c456306eb523a7d00921e6e646fb2 Author: Benjamin Otte <otte at gnome.org> Date: Mon Dec 10 22:35:57 2007 +0100 fix unaligned r...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...de * image->height); + if (buffer == NULL) { + SWFDEC_ERROR ("failed to decompress data"); + memset (image->data, 0, 4 * image->width * image->height); + return; + } + ptr = buffer->data; for (i = 0; i < color_table_size; i++) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN guint8 tmp = ptr[i * 4 + 0]; @@ -380,8 +345,13 @@ swfdec_image_lossless_load (SwfdecImage } indexed_data = ptr + color_table_size * 4; } else { - ptr = lossless (bits.ptr, bits.end - bits.ptr, - color_table_size * 3 + rowstride * image->height); + buffer = swfd...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...ride = image->width * 4; - color_table = g_malloc (color_table_size * 4); - if (have_alpha) { + ptr = lossless (bits.ptr, bits.end - bits.ptr, + color_table_size * 4 + rowstride * image->height); for (i = 0; i < color_table_size; i++) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN - color_table[i * 4 + 0] = ptr[i * 4 + 2]; - color_table[i * 4 + 1] = ptr[i * 4 + 1]; - color_table[i * 4 + 2] = ptr[i * 4 + 0]; - color_table[i * 4 + 3] = ptr[i * 4 + 3]; + guint8 tmp = ptr[i * 4 + 0]; + ptr[i * 4 + 0] = ptr[i * 4 + 2]; + ptr[i * 4...
2007 Feb 13
0
libswfdec/jpeg libswfdec/swfdec_image.c
...*up; - unsigned char *vp; - unsigned char *rgbp; - - rgbp = rgbdec->image; - yp = rgbdec->component[0].image; - up = rgbdec->component[1].image; - vp = rgbdec->component[2].image; - for (y = 0; y < rgbdec->height; y++) { - for (x = 0; x < rgbdec->width; x++) { -#if G_LITTLE_ENDIAN == G_BYTE_ORDER - CONVERT (rgbp[2], rgbp[1], rgbp[0], yp[x], up[x], vp[x]); - rgbp[3] = 0xFF; -#else - rgbp[0] = 0xFF; - CONVERT (rgbp[1], rgbp[2], rgbp[3], yp[x], up[x], vp[x]); -#endif - rgbp += 4; - } - yp += rgbdec->component[0].rowstride; - up += rgbdec-&gt...