svnno****@sourc*****
svnno****@sourc*****
2011年 4月 6日 (水) 16:15:45 JST
Revision: 525 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=525 Author: yoya Date: 2011-04-06 16:15:45 +0900 (Wed, 06 Apr 2011) Log Message: ----------- tag のメンバ名変更 tag => code Modified Paths: -------------- trunk/src/php_swfed.c trunk/src/swf_fill_style_array.c trunk/src/swf_fill_style_bitmap.c trunk/src/swf_fill_style_gradient.c trunk/src/swf_fill_style_solid.c trunk/src/swf_gradient.c trunk/src/swf_gradient_record.c trunk/src/swf_line_style.c trunk/src/swf_line_style_array.c trunk/src/swf_object.c trunk/src/swf_tag.c trunk/src/swf_tag.h trunk/src/swf_tag_action.c trunk/src/swf_tag_jpeg.c trunk/src/swf_tag_lossless.c trunk/src/swf_tag_place.c trunk/src/swf_tag_shape.c trunk/src/swf_tag_sprite.c trunk/src/tests/isbitmaptag001.phpt trunk/src/tests/isshapetag001.phpt -------------- next part -------------- Modified: trunk/src/php_swfed.c =================================================================== --- trunk/src/php_swfed.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/php_swfed.c 2011-04-06 07:15:45 UTC (rev 525) @@ -419,8 +419,8 @@ for (tag=swf->tag_head ; tag ; tag=tag->next) { ALLOC_INIT_ZVAL(data); array_init(data); - add_assoc_long(data, "tag", tag->tag); - tag_info = get_swf_tag_info(tag->tag); + add_assoc_long(data, "code", tag->code); + tag_info = get_swf_tag_info(tag->code); if (tag_info && tag_info->name) { add_assoc_string_ex(data, "tagName", sizeof("tagName"), @@ -456,14 +456,14 @@ if (tag == NULL) { RETURN_FALSE; } - tag_info = get_swf_tag_info(tag->tag); + tag_info = get_swf_tag_info(tag->code); if ((tag_info == NULL) || (tag_info->detail_handler == NULL)) { RETURN_FALSE; } if (swf_tag_create_input_detail(tag, swf) == NULL) { RETURN_FALSE; // can't create detail } - switch (tag->tag) { + switch (tag->code) { swf_tag_jpeg_detail_t *tag_jpeg; swf_tag_lossless_detail_t *tag_lossless; swf_tag_edit_detail_t *tag_edit; @@ -512,7 +512,7 @@ case 59: // DoInitAction tag_action = tag->detail; array_init(return_value); - if (tag->tag == 59) { // DoInitAction + if (tag->code == 59) { // DoInitAction add_assoc_long(return_value, "action_sprite", tag_action->action_sprite); } if (tag_action->action_record && tag_action->action_record_len) { @@ -567,7 +567,7 @@ case 26: // PlaceObject2 tag_place = tag->detail; array_init(return_value); - if ((tag->tag == 4) || tag_place->flag_has_character) { + if ((tag->code == 4) || tag_place->flag_has_character) { add_assoc_long(return_value, "character_id", tag_place->character_id); } add_assoc_long(return_value, "depth", tag_place->depth); @@ -807,7 +807,7 @@ array_init(return_value); i = 0; for (tag = swf->tag_head ; tag ; tag=tag->next) { - register int tag_code = tag->tag; + register int tag_code = tag->code; if (isShapeTag(tag_code)) { bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num); if (bitmap_id_list) { Modified: trunk/src/swf_fill_style_array.c =================================================================== --- trunk/src/swf_fill_style_array.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_fill_style_array.c 2011-04-06 07:15:45 UTC (rev 525) @@ -20,7 +20,7 @@ } } - if ((tag->tag != 2) && // ! DefineShape + if ((tag->code != 2) && // ! DefineShape (fill_style_array->count == 255)) { fill_style_array->count = bitstream_getbytesLE(bs, 2); } @@ -42,9 +42,9 @@ swf_tag_t *tag) { int i; int ret; - if ((tag->tag == 2) || // DefineShape - ((tag->tag > 2) && (fill_style_array->count < 255))) { - // tag->tag == 2 の時は count == 255 でもここに来るように + if ((tag->code == 2) || // DefineShape + ((tag->code > 2) && (fill_style_array->count < 255))) { + // tag->code == 2 の時は count == 255 でもここに来るように bitstream_putbyte(bs, fill_style_array->count); } else { bitstream_putbyte(bs, 255); Modified: trunk/src/swf_fill_style_bitmap.c =================================================================== --- trunk/src/swf_fill_style_bitmap.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_fill_style_bitmap.c 2011-04-06 07:15:45 UTC (rev 525) @@ -8,7 +8,7 @@ swf_tag_t *tag) { fill_style_bitmap->bitmap_ref = bitstream_getbytesLE(bs, 2); swf_matrix_parse(bs, &(fill_style_bitmap->bitmap_matrix)); - if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2 swf_matrix_parse(bs, &(fill_style_bitmap->bitmap_matrix_morph)); } return 0; @@ -20,7 +20,7 @@ swf_tag_t *tag) { bitstream_putbytesLE(bs, fill_style_bitmap->bitmap_ref, 2); swf_matrix_build(bs, &(fill_style_bitmap->bitmap_matrix)); - if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2 swf_matrix_build(bs, &(fill_style_bitmap->bitmap_matrix_morph)); } return 0; @@ -34,7 +34,7 @@ print_indent(indent_depth); printf("bitmap_ref=%u\n", fill_style_bitmap->bitmap_ref); swf_matrix_print(&(fill_style_bitmap->bitmap_matrix), indent_depth); - if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2 swf_matrix_print(&(fill_style_bitmap->bitmap_matrix_morph), indent_depth); } return 0; Modified: trunk/src/swf_fill_style_gradient.c =================================================================== --- trunk/src/swf_fill_style_gradient.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_fill_style_gradient.c 2011-04-06 07:15:45 UTC (rev 525) @@ -8,7 +8,7 @@ swf_tag_t* tag) { swf_matrix_parse(bs, &(fill_style_gradient->gradient_matrix)); // DefineMorphShape, DefineMorphShape2 - if (tag->tag == 46 || tag->tag == 84) { + if (tag->code == 46 || tag->code == 84) { swf_matrix_parse(bs, &(fill_style_gradient->gradient_matrix_morph)); } swf_gradient_parse(bs, &(fill_style_gradient->gradient), tag, fill_style_gradient->type); @@ -21,7 +21,7 @@ swf_tag_t *tag) { swf_matrix_build(bs, &(fill_style_gradient->gradient_matrix)); // DefineMorphShape, DefineMorphShape2 - if (tag->tag == 46 || tag->tag == 84) { + if (tag->code == 46 || tag->code == 84) { swf_matrix_build(bs, &(fill_style_gradient->gradient_matrix_morph)); } swf_gradient_build(bs, &(fill_style_gradient->gradient), tag, fill_style_gradient->type); @@ -36,7 +36,7 @@ swf_matrix_print(&(fill_style_gradient->gradient_matrix), indent_depth + 1); // DefineMorphShape, DefineMorphShape2 - if (tag->tag == 46 || tag->tag == 84) { + if (tag->code == 46 || tag->code == 84) { swf_matrix_print(&(fill_style_gradient->gradient_matrix_morph), indent_depth + 1); } Modified: trunk/src/swf_fill_style_solid.c =================================================================== --- trunk/src/swf_fill_style_solid.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_fill_style_solid.c 2011-04-06 07:15:45 UTC (rev 525) @@ -6,10 +6,10 @@ swf_fill_style_solid_parse(bitstream_t *bs, swf_fill_style_solid_t *fill_style_solid, swf_tag_t *tag) { - if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2 swf_rgba_parse(bs, &(fill_style_solid->rgba)); swf_rgba_parse(bs, &(fill_style_solid->rgba_morph)); - } else if (tag->tag == 32) { // DefineShape3 + } else if (tag->code == 32) { // DefineShape3 swf_rgba_parse(bs, &(fill_style_solid->rgba)); } else { swf_rgb_parse(bs, &(fill_style_solid->rgb)); @@ -21,10 +21,10 @@ swf_fill_style_solid_build(bitstream_t *bs, swf_fill_style_solid_t *fill_style_solid, swf_tag_t *tag) { - if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2 swf_rgba_build(bs, &(fill_style_solid->rgba)); swf_rgba_build(bs, &(fill_style_solid->rgba_morph)); - } else if (tag->tag == 32) { // DefineShape3 + } else if (tag->code == 32) { // DefineShape3 swf_rgba_build(bs, &(fill_style_solid->rgba)); } else { swf_rgb_build(bs, &(fill_style_solid->rgb)); @@ -38,7 +38,7 @@ ) { print_indent(indent_depth); printf("fill_style_solid"); - if (tag->tag == 46 || tag->tag == 84) { // DefineMorphShape, DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorphShape, DefineMorphShape2 printf(" #%02x%02x%02x(%02x) morph:#%02x%02x%02x(%02x)", fill_style_solid->rgba.red, fill_style_solid->rgba.green, @@ -48,7 +48,7 @@ fill_style_solid->rgba_morph.green, fill_style_solid->rgba_morph.blue, fill_style_solid->rgba_morph.alpha); - } else if (tag->tag == 32) { // DefineShape3 + } else if (tag->code == 32) { // DefineShape3 printf(" #%02x%02x%02x(%02x)", fill_style_solid->rgba.red, fill_style_solid->rgba.green, Modified: trunk/src/swf_gradient.c =================================================================== --- trunk/src/swf_gradient.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_gradient.c 2011-04-06 07:15:45 UTC (rev 525) @@ -7,7 +7,7 @@ swf_tag_t *tag, int type) { int i; bitstream_align(bs); - if (tag->tag == 83) { // DefineShape4 + if (tag->code == 83) { // DefineShape4 gradient->spread_mode = bitstream_getbits(bs, 2); gradient->interpolation_mode = bitstream_getbits(bs, 2); gradient->count = bitstream_getbits(bs, 4); @@ -35,7 +35,7 @@ swf_tag_t *tag, int type) { int i; bitstream_align(bs); - if (tag->tag == 83) { // DefineShape4 + if (tag->code == 83) { // DefineShape4 bitstream_putbits(bs, gradient->spread_mode, 2); bitstream_putbits(bs, gradient->interpolation_mode, 2); bitstream_putbits(bs, gradient->count, 4); @@ -56,7 +56,7 @@ swf_gradient_print(swf_gradient_t *gradient, int indent_depth, swf_tag_t *tag, int type) { int i; - if (tag->tag == 83) { // DefineShape4 + if (tag->code == 83) { // DefineShape4 print_indent(indent_depth); printf("spread_mode=%d interpolation_mode=%d count=%d\n", gradient->spread_mode, gradient->interpolation_mode, Modified: trunk/src/swf_gradient_record.c =================================================================== --- trunk/src/swf_gradient_record.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_gradient_record.c 2011-04-06 07:15:45 UTC (rev 525) @@ -7,12 +7,12 @@ *bs, swf_gradient_record_t *gradient_record, swf_tag_t *tag) { int ret = 0; - if (tag->tag == 46 || tag->tag == 84) { // DefineMorph || DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorph || DefineMorphShape2 gradient_record->position = bitstream_getbyte(bs); swf_rgba_parse(bs, &(gradient_record->rgba)); gradient_record->position_morph = bitstream_getbyte(bs); ret = swf_rgba_parse(bs, &(gradient_record->rgba_morph)); - } else if (tag->tag == 32 || tag->tag == 83) { + } else if (tag->code == 32 || tag->code == 83) { // DefineShape3 || DefineShape4 gradient_record->position = bitstream_getbyte(bs); ret = swf_rgba_parse(bs, &(gradient_record->rgba)); @@ -27,12 +27,12 @@ swf_gradient_record_build(bitstream_t *bs, swf_gradient_record_t *gradient_record, swf_tag_t *tag) { - if (tag->tag == 46 || tag->tag == 84) { // DefineMorph || DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorph || DefineMorphShape2 bitstream_putbyte(bs, gradient_record->position); swf_rgba_build(bs, &(gradient_record->rgba)); bitstream_putbyte(bs, gradient_record->position_morph); swf_rgba_build(bs, &(gradient_record->rgba_morph)); - } else if (tag->tag == 32 || tag->tag == 83) { + } else if (tag->code == 32 || tag->code == 83) { // DefineShape3 || DefineShape4 bitstream_putbyte(bs, gradient_record->position); swf_rgba_build(bs, &(gradient_record->rgba)); @@ -50,14 +50,14 @@ fprintf(stderr, "swf_gradient_record_print: gradient_record == NULL\n"); return 1; } - if (tag->tag == 46 || tag->tag == 84) { // DefineMorph || DefineMorphShape2 + if (tag->code == 46 || tag->code == 84) { // DefineMorph || DefineMorphShape2 print_indent(indent_depth); printf("position=%d\n", gradient_record->position); swf_rgba_print(&(gradient_record->rgba), indent_depth); print_indent(indent_depth); printf("position_morph=%d\n", gradient_record->position_morph); swf_rgba_print(&(gradient_record->rgba_morph), indent_depth); - } else if (tag->tag == 32 || tag->tag == 83) { + } else if (tag->code == 32 || tag->code == 83) { // DefineShape3 || DefineShape4 print_indent(indent_depth); printf("position=%d\n", gradient_record->position); Modified: trunk/src/swf_line_style.c =================================================================== --- trunk/src/swf_line_style.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_line_style.c 2011-04-06 07:15:45 UTC (rev 525) @@ -6,7 +6,7 @@ swf_line_style_parse(bitstream_t *bs, swf_line_style_t *line_style, swf_tag_t *tag) { int result; - if (tag->tag == 46) { // DefineMorphShape + if (tag->code == 46) { // DefineMorphShape result = bitstream_getbytesLE(bs, 2); if (result == -1) { return 1; @@ -15,9 +15,9 @@ line_style->width_morph = bitstream_getbytesLE(bs, 2); swf_rgba_parse(bs, &(line_style->rgba)); swf_rgba_parse(bs, &(line_style->rgba_morph)); - } else if (tag->tag == 83 || tag->tag == 84) { + } else if (tag->code == 83 || tag->code == 84) { // DefineShape4 || DefineMorphShape2 - if (tag->tag == 84) { // DefineMorphShape2 + if (tag->code == 84) { // DefineMorphShape2 line_style->width_morph = bitstream_getbytesLE(bs, 2); } result = bitstream_getbits(bs, 2); @@ -40,11 +40,11 @@ swf_fill_style_parse(bs, &(line_style->fill_style), tag); } else { swf_rgba_parse(bs, &(line_style->rgba)); - if (tag->tag == 84) { // DefineMorphShape2 + if (tag->code == 84) { // DefineMorphShape2 swf_rgba_parse(bs, &(line_style->rgba_morph)); } } - } else if (tag->tag == 32) { // DefineShape3 + } else if (tag->code == 32) { // DefineShape3 result = bitstream_getbytesLE(bs, 2); if (result == -1) { return 1; @@ -65,14 +65,14 @@ int swf_line_style_build(bitstream_t *bs, swf_line_style_t *line_style, swf_tag_t *tag) { - if (tag->tag == 46) { // DefineMorphShape + if (tag->code == 46) { // DefineMorphShape bitstream_putbytesLE(bs, line_style->width, 2); bitstream_putbytesLE(bs, line_style->width_morph, 2); swf_rgba_build(bs, &(line_style->rgba)); swf_rgba_build(bs, &(line_style->rgba_morph)); - } else if (tag->tag == 83 || tag->tag == 84) { + } else if (tag->code == 83 || tag->code == 84) { // DefineShape4 || DefineMorphShape2 - if (tag->tag == 84) { // DefineMorphShape2 + if (tag->code == 84) { // DefineMorphShape2 bitstream_putbytesLE(bs, line_style->width_morph, 2); } bitstream_putbits(bs, line_style->start_cap_style, 2); @@ -91,11 +91,11 @@ swf_fill_style_build(bs, &(line_style->fill_style), tag); } else { swf_rgba_build(bs, &(line_style->rgba)); - if (tag->tag == 84) { // DefineMorphShape2 + if (tag->code == 84) { // DefineMorphShape2 swf_rgba_build(bs, &(line_style->rgba_morph)); } } - } else if (tag->tag == 32) { // DefineShape3 + } else if (tag->code == 32) { // DefineShape3 bitstream_putbytesLE(bs, line_style->width, 2); swf_rgba_build(bs, &(line_style->rgba)); } else { @@ -112,16 +112,16 @@ fprintf(stderr, "swf_line_style_print: line_style == NULL\n"); return 1; } - if (tag->tag == 46) { // DefineMorphShape + if (tag->code == 46) { // DefineMorphShape print_indent(indent_depth); printf("width=%.2f width_morph=%.2f\n", (float) line_style->width / SWF_TWIPS, (float) line_style->width_morph / SWF_TWIPS); swf_rgba_print(&(line_style->rgba), indent_depth); swf_rgba_print(&(line_style->rgba_morph), indent_depth); - } else if (tag->tag == 83 || tag->tag == 84) { + } else if (tag->code == 83 || tag->code == 84) { // DefineShape4 || DefineMorphShape2 - if (tag->tag == 84) { // DefineMorphShape2 + if (tag->code == 84) { // DefineMorphShape2 print_indent(indent_depth); printf("width_morph=%d\n", line_style->width_morph); } @@ -146,11 +146,11 @@ tag); } else { swf_rgba_print(&(line_style->rgba), indent_depth); - if (tag->tag == 84) { // DefineMorphShape2 + if (tag->code == 84) { // DefineMorphShape2 swf_rgba_print(&(line_style->rgba_morph), indent_depth); } } - } else if (tag->tag == 32) { // DefineShape3 + } else if (tag->code == 32) { // DefineShape3 print_indent(indent_depth); printf("width=%.2f ", (float) line_style->width / SWF_TWIPS); swf_rgba_print(&(line_style->rgba), 0); Modified: trunk/src/swf_line_style_array.c =================================================================== --- trunk/src/swf_line_style_array.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_line_style_array.c 2011-04-06 07:15:45 UTC (rev 525) @@ -15,7 +15,7 @@ return 1; } line_style_array->count = result; - if ((tag->tag != 2) && // ! DefineShape + if ((tag->code != 2) && // ! DefineShape (line_style_array->count == 255)) { result = bitstream_getbytesLE(bs, 2); if (result == -1) { @@ -46,9 +46,9 @@ int swf_line_style_array_build(bitstream_t *bs, swf_line_style_array_t *line_style_array, swf_tag_t *tag) { int i; - if ((tag->tag == 2) || // DefineShape - ((tag->tag > 2) && (line_style_array->count < 255))) { - // tag->tag == 2 の時は count == 255 でもここに来るように + if ((tag->code == 2) || // DefineShape + ((tag->code > 2) && (line_style_array->count < 255))) { + // tag->code == 2 の時は count == 255 でもここに来るように bitstream_putbyte(bs, line_style_array->count); } else { bitstream_putbyte(bs, 255); Modified: trunk/src/swf_object.c =================================================================== --- trunk/src/swf_object.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_object.c 2011-04-06 07:15:45 UTC (rev 525) @@ -129,7 +129,7 @@ tag->next = NULL; } swf->tag_tail = tag; - if (tag->tag == 0) { // END Tag + if (tag->code == 0) { // END Tag break; // SUCCESS } prev_tag = tag; @@ -217,7 +217,7 @@ for (tag = swf->tag_head; tag ; tag = tag->next) { printf("[%d] ", i); swf_tag_print(tag, swf, 0); - if (tag->tag == 0) { // END Tag + if (tag->code == 0) { // END Tag break; } i++; @@ -267,7 +267,7 @@ // 以下コンテンツ系のタグ if (trans_table_get(refcid_trans_table, cid) == TRANS_TABLE_RESERVE_ID) { // no purge - if (isShapeTag(tag->tag)) { + if (isShapeTag(tag->code)) { int *bitmap_id_list, bitmap_id_list_num; bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num); if (bitmap_id_list) { @@ -277,7 +277,7 @@ } free(bitmap_id_list); } - } else if (isSpriteTag(tag->tag)) { + } else if (isSpriteTag(tag->code)) { swf_tag_t *t; swf_tag_sprite_detail_t *tag_sprite; tag_sprite = swf_tag_create_input_detail(tag, swf); @@ -293,7 +293,7 @@ } } } else { // Purge! - if (isShapeTag(tag->tag) || isBitmapTag(tag->tag)) { + if (isShapeTag(tag->code) || isBitmapTag(tag->code)) { // TODO: tag == head ? tag == tail ? OK? swf_tag_t *next_tag = tag->next; tag->prev->next = tag->next; @@ -435,7 +435,7 @@ tag = swf_object_search_tag_byseqno(swf, tag_seqno); if (tag) { if (tag_seqno_in_sprite >= 0) { - if (isSpriteTag(tag->tag)) { + if (isSpriteTag(tag->code)) { swf_tag_sprite_detail_t *tag_sprite; swf_tag_t *tag_in_sprite; tag_sprite = swf_tag_create_input_detail(tag, swf); @@ -519,8 +519,8 @@ } } if (tag) { - if (! isShapeTag(tag->tag)) { - fprintf(stderr, "swf_object_get_shapedata: not isShapeTag(%d)\n", tag->tag); + if (! isShapeTag(tag->code)) { + fprintf(stderr, "swf_object_get_shapedata: not isShapeTag(%d)\n", tag->code); return NULL; } if ((tag->data == NULL ) && tag->detail) { @@ -554,7 +554,7 @@ } } if (tag) { - if (! isShapeTag(tag->tag)) { + if (! isShapeTag(tag->code)) { return 1; // failure } if (tag->detail) { @@ -565,8 +565,8 @@ free(tag->data); tag->data = NULL; } - // if (tag->tag == 2) { // DefineShape - // tag->tag = 22; // => DefineShape2 + // if (tag->code == 2) { // DefineShape + // tag->code = 22; // => DefineShape2 // } tag->length = length + 2; tag->data = malloc(length + 2); @@ -638,7 +638,7 @@ return NULL; } for (tag = swf->tag_head ; tag ; tag = tag->next) { - register int tag_code = tag->tag; + register int tag_code = tag->code; if (isBitmapTag(tag_code)) { if (swf_tag_get_cid(tag) == bitmap_id) { return tag; // match @@ -670,7 +670,7 @@ width_scale = (double) old_width / new_width; height_scale = (double) old_height / new_height; for (tag = swf->tag_head ; tag ; tag=tag->next) { - register int tag_code = tag->tag; + register int tag_code = tag->code; if (isShapeTag(tag_code)) { bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num); if (bitmap_id_list) { @@ -694,7 +694,7 @@ width_scale = (double) new_width / old_width; height_scale = (double) new_height / old_height; for (tag = swf->tag_head ; tag ; tag=tag->next) { - register int tag_code = tag->tag; + register int tag_code = tag->code; if (isShapeTag(tag_code)) { bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num); if (bitmap_id_list) { @@ -715,7 +715,7 @@ } if (swf->shape_adjust_mode & SWFED_SHAPE_BITMAP_TYPE_TILLED) { for (tag = swf->tag_head ; tag ; tag=tag->next) { - register int tag_code = tag->tag; + register int tag_code = tag->code; if (isShapeTag(tag_code)) { bitmap_id_list = swf_tag_shape_bitmap_get_refcid_list(tag, &bitmap_id_list_num); if (bitmap_id_list) { @@ -759,12 +759,12 @@ return NULL; } for (tag=swf->tag_head ; tag ; tag=tag->next) { - if (tag->tag == 8) { // JPEGTables + if (tag->code == 8) { // JPEGTables tag_jpegtables = tag; continue; } // ! DefineBitsJPEG(1),2,3 - if ((tag->tag != 6) && (tag->tag != 21) && (tag->tag != 35)) { + if ((tag->code != 6) && (tag->code != 21) && (tag->code != 35)) { continue; } data = swf_tag_get_jpeg_data(tag, length, image_id, tag_jpegtables); @@ -785,7 +785,7 @@ return NULL; } for (tag=swf->tag_head ; tag ; tag=tag->next) { - if (tag->tag != 35) { // ! DefineBitsJPEG3 + if (tag->code != 35) { // ! DefineBitsJPEG3 continue; } data = swf_tag_get_alpha_data(tag, length, image_id); @@ -850,7 +850,7 @@ *length = 0; for (tag=swf->tag_head ; tag ; tag=tag->next) { // DefineBitsLossless(1),2 - if ((tag->tag != 20) && (tag->tag != 36)) { + if ((tag->code != 20) && (tag->code != 36)) { continue; } data = swf_tag_get_png_data(tag, length, image_id); @@ -958,7 +958,7 @@ } for (tag=swf->tag_head ; tag ; tag=tag->next) { // DefineSound - if (tag->tag != 14) { + if (tag->code != 14) { continue; } data = swf_tag_get_sound_data(tag, length, sound_id); @@ -1060,7 +1060,7 @@ if (tag == NULL) { return NULL; } - if ((tag->tag != 12) && (tag->tag != 59)) { // DoAction, DoInitAction + if ((tag->code != 12) && (tag->code != 59)) { // DoAction, DoInitAction return NULL; } swf_tag_action = (swf_tag_action_detail_t *) swf_tag_create_input_detail(tag, swf); @@ -1083,7 +1083,7 @@ return 1; // NG } for (tag=swf->tag_head ; tag ; tag=tag->next) { - switch (tag->tag) { + switch (tag->code) { case 1: // ShowFrame if (prev_tag == NULL) { // ShowFrame までに候補が見つからなければ、ShowFrame の直前 @@ -1148,7 +1148,7 @@ static void trans_table_replace_refcid_recursive(swf_tag_t *tag, trans_table_t *cid_trans_table) { for ( ; tag ; tag=tag->next) { - int tag_no = tag->tag; + int tag_no = tag->code; if (isSpriteTag(tag_no)) { swf_tag_sprite_detail_t *tag_sprite; tag_sprite = swf_tag_create_input_detail(tag, NULL); @@ -1192,7 +1192,7 @@ // インスタンス名から PlaceObject を探し、参照している CID を取得する for (tag = tag_head ; tag ; tag=tag->next) { cid = 0; - if (tag->tag == 26) { // PlaceObject2 + if (tag->code == 26) { // PlaceObject2 cid = swf_tag_place_get_cid_by_instance_name(tag, instance_name, instance_name_len, swf); } if (cid > 0) { @@ -1208,7 +1208,7 @@ // CID で DefineSprite を探す for (tag=swf->tag_head ; tag ; tag=tag->next) { - if (isSpriteTag(tag->tag)) { + if (isSpriteTag(tag->code)) { if (swf_tag_get_cid(tag) == cid) { sprite_tag = tag; break; @@ -1281,7 +1281,7 @@ // trans_table_print(cid_trans_table); // Sprite タグの中を綺麗にする - tag_info = get_swf_tag_info(sprite_tag->tag); + tag_info = get_swf_tag_info(sprite_tag->code); detail_handler = tag_info->detail_handler(); free(sprite_tag->data); sprite_tag->data = NULL; @@ -1295,7 +1295,7 @@ // SWF 中のタグを種類に応じて展開する for (tag = swf4sprite->tag_head ; tag ; tag = tag->next) { - int tag_no = tag->tag; + int tag_no = tag->code; switch (tag_no) { // tag skip default: // misc @@ -1504,7 +1504,7 @@ bitstream_input(bs, data, data_len); tag = swf_tag_create(bs); if (tag) { - if (isShapeTag(tag->tag)) { + if (isShapeTag(tag->code)) { ret = 1; // TRUE } } @@ -1522,7 +1522,7 @@ bitstream_input(bs, data, data_len); tag = swf_tag_create(bs); if (tag) { - if (isBitmapTag(tag->tag)) { + if (isBitmapTag(tag->code)) { ret = 1; // TRUE } } Modified: trunk/src/swf_tag.c =================================================================== --- trunk/src/swf_tag.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag.c 2011-04-06 07:15:45 UTC (rev 525) @@ -91,7 +91,7 @@ return NULL; } tag = calloc(sizeof(*tag), 1); - tag->tag = tag_and_length >> 6; + tag->code = tag_and_length >> 6; tag->length = tag_and_length & 0x3f; tag->length_longformat = 0; if (tag->length == 0x3f) { @@ -138,7 +138,7 @@ if (tag->length >= 0x3f) { tag->length_longformat = 1; } else { - switch (tag->tag) { + switch (tag->code) { case 6: // DefineBitsJPEG case 21: // DefineBitsJPEG2 case 35: // DefineBitsJPEG3 @@ -153,11 +153,11 @@ } } if (tag->length_longformat) { - tag_and_length = (tag->tag << 6) | 0x3f; + tag_and_length = (tag->code << 6) | 0x3f; bitstream_putbytesLE(bs, tag_and_length, 2); bitstream_putbytesLE(bs, tag->length, 4); } else { - tag_and_length = (tag->tag << 6) | tag->length; + tag_and_length = (tag->code << 6) | tag->length; bitstream_putbytesLE(bs, tag_and_length, 2); } return 0; @@ -176,21 +176,21 @@ fprintf(stderr, "swf_tag_build: tag == NULL\n"); return 1; } -// fprintf(stderr, "XXX: swf_tag_build: tag->tag=%d\n",tag->tag); +// fprintf(stderr, "XXX: swf_tag_build: tag->code=%d\n",tag->code); if (tag->data) { swf_tag_and_length_build(bs, tag); bitstream_putstring(bs, tag->data, tag->length); } else if (tag->detail) { - tag_info = get_swf_tag_info(tag->tag); + tag_info = get_swf_tag_info(tag->code); if ((tag_info == NULL) || (tag_info->detail_handler == NULL)) { - fprintf(stderr, "swf_tag_build: not implemented yet. detail build tag->tag=%d\n", - tag->tag); + fprintf(stderr, "swf_tag_build: not implemented yet. detail build tag->code=%d\n", + tag->code); return 1; } detail_handler = tag_info->detail_handler(); if (detail_handler->output == NULL) { - fprintf(stderr, "swf_tag_build: detail_handler->output == NULL: tag->tag=%d\n", - tag->tag); + fprintf(stderr, "swf_tag_build: detail_handler->output == NULL: tag->code=%d\n", + tag->code); return 1; } data = detail_handler->output(tag, &data_len, swf); @@ -214,7 +214,7 @@ swf_tag_info_t *tag_info = NULL; swf_tag_detail_handler_t * detail_handler = NULL; int ret; - tag_info = get_swf_tag_info(tag->tag); + tag_info = get_swf_tag_info(tag->code); if ((tag_info == NULL) || (tag_info->detail_handler == NULL)) { return 1; // no info } @@ -227,7 +227,7 @@ } ret = detail_handler->input(tag, swf); if (ret) { - fprintf(stderr, "swf_tag_rebuild: detail_hander->input failed tag_no=%d\n", tag->tag); + fprintf(stderr, "swf_tag_rebuild: detail_hander->input failed tag_no=%d\n", tag->code); return 1; } free(tag->data); @@ -244,10 +244,10 @@ fprintf(stderr, "swf_tag_print: tag == NULL\n"); return ; } - tag_info = get_swf_tag_info(tag->tag); + tag_info = get_swf_tag_info(tag->code); tag_name = (tag_info)?tag_info->name:"Unknown"; // print_indent(indent_depth); - printf("tag=%s(%d)", tag_name, tag->tag); + printf("tag=%s(%d)", tag_name, tag->code); if (tag->length > 0) { printf(" length=%lu", tag->length); } @@ -273,18 +273,18 @@ if (tag->detail) { return tag->detail; } - tag_info = get_swf_tag_info(tag->tag); + tag_info = get_swf_tag_info(tag->code); if (tag_info && tag_info->detail_handler) { int result; swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler(); if (detail_handler->create == NULL) { fprintf(stderr, "detail_handler->create == NULL (tag=%d)\n", - tag->tag); + tag->code); return NULL; } tag->detail = detail_handler->create(); if (tag->detail == NULL) { - fprintf(stderr, "can't create tag detail (tag=%d)\n", tag->tag); + fprintf(stderr, "can't create tag detail (tag=%d)\n", tag->code); return NULL; } result = detail_handler->input(tag, swf); @@ -301,14 +301,14 @@ return; } if (tag->detail) { - swf_tag_info_t *tag_info = get_swf_tag_info(tag->tag); + swf_tag_info_t *tag_info = get_swf_tag_info(tag->code); if (tag_info && tag_info->detail_handler) { swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler(); if (detail_handler->destroy) { detail_handler->destroy(tag); } else { fprintf(stderr, "detail_handler->destroy == NULL (tag=%d)\n", - tag->tag); + tag->code); } } else { fprintf(stderr, "not impremented yet. destroy tag detail\n"); @@ -326,7 +326,7 @@ fprintf(stderr, "swf_tag_get_cid: tag == NULL\n"); return 1; } - tag_no = tag->tag; + tag_no = tag->code; tag_info = get_swf_tag_info(tag_no); if (tag_info && tag_info->detail_handler) { swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler(); @@ -366,7 +366,7 @@ fprintf(stderr, "swf_tag_replace_cid: tag == NULL\n"); return 1; // failure } - tag_no = tag->tag; + tag_no = tag->code; tag_info = get_swf_tag_info(tag_no); if (tag_info && tag_info->detail_handler) { swf_tag_detail_handler_t * detail_handler = tag_info->detail_handler(); @@ -405,7 +405,7 @@ fprintf(stderr, "swf_tag_get_refcid: tag == NULL\n"); return -1; } - if (isPlaceTag(tag->tag)) { // PlaceObject, PlaceObject2 + if (isPlaceTag(tag->code)) { // PlaceObject, PlaceObject2 swf_tag_place_detail_t *swf_tag_place; swf_tag_place = swf_tag_create_input_detail(tag, NULL); if (swf_tag_place == NULL) { @@ -423,7 +423,7 @@ fprintf(stderr, "swf_tag_replace_refcid: tag == NULL\n"); return 1; // failure } - if (isPlaceTag(tag->tag)) { // PlaceObject, PlaceObject2 + if (isPlaceTag(tag->code)) { // PlaceObject, PlaceObject2 swf_tag_place_detail_t *swf_tag_place; swf_tag_place = swf_tag_create_input_detail(tag, NULL); if (swf_tag_place == NULL) { @@ -457,11 +457,11 @@ fprintf(stderr, "swf_tag_get_bitmap_size: swf_tag_create_input_detail failed\n"); return 1; } - if (isBitsJPEGTag(tag->tag)) { + if (isBitsJPEGTag(tag->code)) { swf_tag_jpeg_detail_t *swf_tag_jpeg = (swf_tag_jpeg_detail_t *) tag->detail; ret = jpeg_size(swf_tag_jpeg->jpeg_data, swf_tag_jpeg->jpeg_data_len, width, height); - } else if (isBitsLosslessTag(tag->tag)) { + } else if (isBitsLosslessTag(tag->code)) { swf_tag_lossless_detail_t *swf_tag_lossless = (swf_tag_lossless_detail_t *) tag->detail; *width = swf_tag_lossless->width; *height = swf_tag_lossless->height; @@ -483,8 +483,8 @@ fprintf(stderr, "swf_tag_get_jpeg_data: length == NULL\n"); return NULL; } - tag_info = get_swf_tag_info(tag->tag); - if ((tag->tag != 6) && (tag->tag != 21) && (tag->tag != 35)) { + tag_info = get_swf_tag_info(tag->code); + if ((tag->code != 6) && (tag->code != 21) && (tag->code != 35)) { return NULL; } if (swf_tag_create_input_detail(tag, NULL) == NULL) { @@ -512,7 +512,7 @@ fprintf(stderr, "swf_tag_get_alpha_data: length == NULL\n"); return NULL; } - if (tag->tag != 35) { // ! DefineBitsJPEG3 + if (tag->code != 35) { // ! DefineBitsJPEG3 return NULL; } if (swf_tag_get_cid(tag) != image_id) { @@ -542,26 +542,26 @@ fprintf(stderr, "swf_tag_replace_jpeg_data: jpeg_data == NULL\n"); return 1; } - if (! isBitmapTag(tag->tag)) { + if (! isBitmapTag(tag->code)) { return 1; } - tag_info = get_swf_tag_info(tag->tag); // Bitmap Tag + tag_info = get_swf_tag_info(tag->code); // Bitmap Tag detail_handler = tag_info->detail_handler(); if (detail_handler->get_cid(tag) != image_id) { return 1; } - if (tag->detail && (! isBitsJPEGTag(tag->tag))) { + if (tag->detail && (! isBitsJPEGTag(tag->code))) { detail_handler->destroy(tag); tag->detail = NULL; } if (alpha_data && (alpha_data_len > 0)) { - tag->tag = 35; // DefineBitsJPEG3 + tag->code = 35; // DefineBitsJPEG3 } else { - tag->tag = 21; // DefineBitsJPEG2 + tag->code = 21; // DefineBitsJPEG2 } - tag_info = get_swf_tag_info(tag->tag); // JPEG Tag + tag_info = get_swf_tag_info(tag->code); // JPEG Tag detail_handler = tag_info->detail_handler(); if (tag->detail == NULL) { tag->detail = detail_handler->create(); @@ -596,8 +596,8 @@ fprintf(stderr, "swf_tag_get_png_data: length == NULL\n"); return NULL; } - tag_info = get_swf_tag_info(tag->tag); - if ((tag->tag != 20) && (tag->tag != 36)) { + tag_info = get_swf_tag_info(tag->code); + if ((tag->code != 20) && (tag->code != 36)) { return NULL; } if (swf_tag_create_input_detail(tag, NULL) == NULL) { @@ -622,26 +622,26 @@ fprintf(stderr, "swf_tag_replace_png_data: png_data == NULL\n"); return 1; } - if (! isBitmapTag(tag->tag)) { + if (! isBitmapTag(tag->code)) { return 1; } - tag_info = get_swf_tag_info(tag->tag); // Bitmap Tag + tag_info = get_swf_tag_info(tag->code); // Bitmap Tag detail_handler = tag_info->detail_handler(); if (detail_handler->get_cid(tag) != image_id) { return 1; } - if (tag->detail && (! isBitsLosslessTag(tag->tag))) { + if (tag->detail && (! isBitsLosslessTag(tag->code))) { detail_handler->destroy(tag); tag->detail = NULL; } - if (tag->tag == 20) { - tag->tag = 20; // DefineBitsLossless + if (tag->code == 20) { + tag->code = 20; // DefineBitsLossless } else { - tag->tag = 36; // DefineBitsLossless2 + tag->code = 36; // DefineBitsLossless2 } - tag_info = get_swf_tag_info(tag->tag); // Lossless Tag + tag_info = get_swf_tag_info(tag->code); // Lossless Tag detail_handler = tag_info->detail_handler(); if (tag->detail == NULL) { tag->detail = detail_handler->create(); @@ -679,26 +679,26 @@ fprintf(stderr, "swf_tag_replace_gif_data: gif_data == NULL\n"); return 1; } - if (! isBitmapTag(tag->tag)) { + if (! isBitmapTag(tag->code)) { return 1; } - tag_info = get_swf_tag_info(tag->tag); // Bitmap Tag + tag_info = get_swf_tag_info(tag->code); // Bitmap Tag detail_handler = tag_info->detail_handler(); if (detail_handler->get_cid(tag) != image_id) { return 1; } - if (tag->detail && (! isBitsLosslessTag(tag->tag))) { + if (tag->detail && (! isBitsLosslessTag(tag->code))) { detail_handler->destroy(tag); tag->detail = NULL; } - if (tag->tag == 20) { - tag->tag = 20; // DefineBitsLossless + if (tag->code == 20) { + tag->code = 20; // DefineBitsLossless } else { - tag->tag = 36; // DefineBitsLossless2 + tag->code = 36; // DefineBitsLossless2 } - tag_info = get_swf_tag_info(tag->tag); // Lossless Tag + tag_info = get_swf_tag_info(tag->code); // Lossless Tag detail_handler = tag_info->detail_handler(); if (tag->detail == NULL) { tag->detail = detail_handler->create(); @@ -735,8 +735,8 @@ fprintf(stderr, "swf_tag_get_sound_data: length == NULL\n"); return NULL; } - tag_info = get_swf_tag_info(tag->tag); - if (tag->tag != 14) { // DefineSound + tag_info = get_swf_tag_info(tag->code); + if (tag->code != 14) { // DefineSound return NULL; } if (! tag->detail) { @@ -762,7 +762,7 @@ fprintf(stderr, "swf_tag_replace_melo_data: melo_data == NULL\n"); return 1; } - if (tag->tag != 14) { // DefineSound + if (tag->code != 14) { // DefineSound return 1; } if (swf_tag_get_cid(tag) != sound_id) { @@ -794,7 +794,7 @@ fprintf(stderr, "swf_tag_get_edit_string: variable_name == NULL\n"); return NULL; } - if (tag->tag != 37) { // DefineEditText + if (tag->code != 37) { // DefineEditText return NULL; } if (swf_tag_create_input_detail(tag, swf) == NULL) { @@ -819,7 +819,7 @@ fprintf(stderr, "swf_tag_replace_edit_string: variable_name == NULL\n"); return 1; } - if (tag->tag != 37) { // DefineEditText + if (tag->code != 37) { // DefineEditText return 1; } if (swf_tag_create_input_detail(tag, swf) == NULL) { @@ -848,8 +848,8 @@ fprintf(stderr, "swf_tag_apply_shape_matrix_factor: tag == NULL\n"); return 1; } - if ((tag->tag != 2) && (tag->tag != 22) && (tag->tag !=32 ) - && (tag->tag != 46)) { + if ((tag->code != 2) && (tag->code != 22) && (tag->code !=32 ) + && (tag->code != 46)) { // ! DefineShape1,2,3, DefineMorphShape return 1; } @@ -882,8 +882,8 @@ fprintf(stderr, "swf_tag_apply_shape_rect_factor: tag == NULL\n"); return 1; } - if ((tag->tag != 2) && (tag->tag != 22) && (tag->tag !=32 ) - && (tag->tag != 46)) { + if ((tag->code != 2) && (tag->code != 22) && (tag->code !=32 ) + && (tag->code != 46)) { // ! DefineShape1,2,3, DefineMorphShape return 1; } @@ -913,8 +913,8 @@ fprintf(stderr, "swf_tag_apply_shape_type_tylled: tag == NULL\n"); return 1; } - if ((tag->tag != 2) && (tag->tag != 22) && (tag->tag !=32 ) - && (tag->tag != 46)) { + if ((tag->code != 2) && (tag->code != 22) && (tag->code !=32 ) + && (tag->code != 46)) { // ! DefineShape1,2,3, DefineMorphShape return 1; } @@ -943,8 +943,8 @@ return NULL; } tag = calloc(sizeof(*tag), 1); - tag->tag = 12; // DoAction - swf_tag_info_t *tag_info = get_swf_tag_info(tag->tag); + tag->code = 12; // DoAction + swf_tag_info_t *tag_info = get_swf_tag_info(tag->code); swf_tag_detail_handler_t *detail_handler = tag_info->detail_handler(); tag->detail = detail_handler->create(); ret = swf_tag_action_create_setvaribles(tag, kv); @@ -992,7 +992,7 @@ return NULL; } to_tag = calloc(sizeof(*to_tag), 1); - to_tag->tag = from_tag->tag; + to_tag->code = from_tag->code; to_tag->length = from_tag->length; to_tag->length_longformat = from_tag->length_longformat; to_tag->data = from_tag->data; Modified: trunk/src/swf_tag.h =================================================================== --- trunk/src/swf_tag.h 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag.h 2011-04-06 07:15:45 UTC (rev 525) @@ -13,7 +13,7 @@ struct swf_object_; // swf_object.h typedef struct swf_tag_ { - int tag; + int code; unsigned long length; int length_longformat; // Modified: trunk/src/swf_tag_action.c =================================================================== --- trunk/src/swf_tag_action.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag_action.c 2011-04-06 07:15:45 UTC (rev 525) @@ -54,7 +54,7 @@ bs = bitstream_open(); bitstream_input(bs, data, length); - if (tag->tag == 59) { // DoInitAction + if (tag->code == 59) { // DoInitAction swf_tag_action->action_sprite = bitstream_getbytesLE(bs, 2); } else { // DoAction swf_tag_action->action_sprite = 0; // fail safe @@ -77,7 +77,7 @@ (void) swf; bs = bitstream_open(); - if (tag->tag == 59) { // DoInitAction + if (tag->code == 59) { // DoInitAction bitstream_putbytesLE(bs, swf_tag_action->action_sprite, 2); } else { // DoAction ; // nothing @@ -97,7 +97,7 @@ swf_tag_action_detail_t *swf_tag_action = (swf_tag_action_detail_t *) tag->detail; (void) swf; print_indent(indent_depth); - if (tag->tag == 59) { // DoInitAction + if (tag->code == 59) { // DoInitAction printf("action_sprite=%d ", swf_tag_action->action_sprite); } printf("action_record =\n"); Modified: trunk/src/swf_tag_jpeg.c =================================================================== --- trunk/src/swf_tag_jpeg.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag_jpeg.c 2011-04-06 07:15:45 UTC (rev 525) @@ -472,7 +472,7 @@ return 1; } swf_tag_jpeg->image_id = image_id; - if (tag->tag == 6) { // DefineBitsJPEG + if (tag->code == 6) { // DefineBitsJPEG if (jpeg_data && jpeg_data_len) { // fail safe free(swf_tag_jpeg->jpeg_data); swf_tag_jpeg->jpeg_data = malloc(jpeg_data_len); Modified: trunk/src/swf_tag_lossless.c =================================================================== --- trunk/src/swf_tag_lossless.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag_lossless.c 2011-04-06 07:15:45 UTC (rev 525) @@ -84,7 +84,7 @@ int bytes_per_color; swf_tag_lossless->colormap_count = bitstream_getbyte(bs) + 1; indices_len = ((swf_tag_lossless->width + 3) & -4) * swf_tag_lossless->height; - if (tag->tag == 20) { // Lossless => rgb (3 bytes) + if (tag->code == 20) { // Lossless => rgb (3 bytes) bytes_per_color = 3; } else { // Lossless2 => rgba (4 bytes) bytes_per_color = 4; @@ -119,7 +119,7 @@ } bs2 = bitstream_open(); bitstream_input(bs2, tmp_buff, origsize); - if (tag->tag == 20) { // Lossless + if (tag->code == 20) { // Lossless swf_tag_lossless->colormap = malloc(sizeof(swf_rgb_t) * swf_tag_lossless->colormap_count); for (i=0 ; i < swf_tag_lossless->colormap_count ; i++) { swf_rgb_t *rgb = swf_tag_lossless->colormap + i; @@ -163,7 +163,7 @@ } bs2 = bitstream_open(); bitstream_input(bs2, tmp_buff, origsize); - if (tag->tag == 20) { // Lossless + if (tag->code == 20) { // Lossless swf_tag_lossless->bitmap = malloc(bitmap_count * sizeof(swf_xrgb_t)); for (i=0 ; i < bitmap_count ; i++) { swf_xrgb_t *xrgb = swf_tag_lossless->bitmap + i; @@ -254,7 +254,7 @@ unsigned long indices_len; bitstream_putbyte(bs, swf_tag_lossless->colormap_count - 1); /* XXX */ bs2 = bitstream_open(); - if (tag->tag == 20) { // Lossless + if (tag->code == 20) { // Lossless for (i=0 ; i < swf_tag_lossless->colormap_count ; i++) { swf_rgb_t *rgb = swf_tag_lossless->colormap + i; swf_rgb_build(bs2, rgb); @@ -292,7 +292,7 @@ } else { unsigned long bitmap_size; bs2 = bitstream_open(); - if (tag->tag == 20) { // Lossless + if (tag->code == 20) { // Lossless bitmap_size = swf_tag_lossless->width * swf_tag_lossless->height; for (i=0 ; i < bitmap_size ; i++) { swf_xrgb_t *xrgb = swf_tag_lossless->bitmap + i; @@ -427,7 +427,7 @@ swf_tag_lossless->format); return NULL; } - if (tag->tag == 20) { + if (tag->code == 20) { if (swf_tag_lossless->format == 3) { index_data = (void *) swf_tag_lossless->colormap; image_data = (void *) swf_tag_lossless->indices; @@ -451,7 +451,7 @@ swf_tag_lossless->height, index_data, swf_tag_lossless->colormap_count, - tag->tag, swf_tag_lossless->format, + tag->code, swf_tag_lossless->format, length); return data; } @@ -484,7 +484,7 @@ fprintf(stderr, "swf_tag_lossess_replace_png_data: pngconv_png2lossless failed at line(%d)\n", __LINE__); return 1; } - tag->tag = tag_no; + tag->code = tag_no; swf_tag_lossless->format = format; swf_tag_lossless->width = width; swf_tag_lossless->height = height; @@ -567,7 +567,7 @@ fprintf(stderr, "swf_tag_lossless_replace_gif_data: gifconv_gif2lossless failed at line(%d)\n", __LINE__); return 1; } - tag->tag = tag_no; + tag->code = tag_no; swf_tag_lossless->format = format; swf_tag_lossless->width = width; swf_tag_lossless->height = height; Modified: trunk/src/swf_tag_place.c =================================================================== --- trunk/src/swf_tag_place.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag_place.c 2011-04-06 07:15:45 UTC (rev 525) @@ -51,7 +51,7 @@ bs = bitstream_open(); bitstream_input(bs, data, length); - if (tag->tag == 4) { // PlaceObject + if (tag->code == 4) { // PlaceObject swf_tag_place->character_id = bitstream_getbytesLE(bs, 2); swf_tag_place->depth = bitstream_getbytesLE(bs, 2); ret = swf_matrix_parse(bs, &(swf_tag_place->matrix)); @@ -66,7 +66,7 @@ bitstream_close(bs); return ret; } - } else if (tag->tag == 26) { // PlaceObject2 + } else if (tag->code == 26) { // PlaceObject2 swf_tag_place->flag_has_clip_action = bitstream_getbit(bs); swf_tag_place->flag_has_clip_depth = bitstream_getbit(bs); swf_tag_place->flag_has_name = bitstream_getbit(bs); @@ -128,7 +128,7 @@ bs = bitstream_open(); - if (tag->tag == 4) { // PlaceObject + if (tag->code == 4) { // PlaceObject bitstream_putbytesLE(bs, swf_tag_place->character_id, 2); bitstream_putbytesLE(bs, swf_tag_place->depth, 2); ret = swf_matrix_build(bs, &(swf_tag_place->matrix)); @@ -143,7 +143,7 @@ bitstream_close(bs); return NULL; } - } else if (tag->tag == 26) { // PlaceObject2 + } else if (tag->code == 26) { // PlaceObject2 bitstream_putbit(bs, swf_tag_place->flag_has_clip_action); bitstream_putbit(bs, swf_tag_place->flag_has_clip_depth); bitstream_putbit(bs, swf_tag_place->flag_has_name); @@ -199,12 +199,12 @@ swf_tag_place_detail_t *swf_tag_place = (swf_tag_place_detail_t *) tag->detail; (void) swf; print_indent(indent_depth); - if (tag->tag == 4) { // PlaceObject + if (tag->code == 4) { // PlaceObject printf("character_id=%d depth=%d\n", swf_tag_place->character_id, swf_tag_place->depth); swf_matrix_print(&(swf_tag_place->matrix), indent_depth); swf_cxform_print(&(swf_tag_place->color_transform), indent_depth); - } else if (tag->tag == 26) { // PlaceObject2 + } else if (tag->code == 26) { // PlaceObject2 printf("(clipact,clipdepth,name,ratio,coltrans,mat,cid,move)=(%d,%d,%d,%d,%d,%d,%d,%d)\n", swf_tag_place->flag_has_clip_action, swf_tag_place->flag_has_clip_depth, @@ -237,7 +237,7 @@ printf("ratio=%d\n", swf_tag_place->clip_depth); } } else { - fprintf(stderr, "Illegal tag no(%d)\n", tag->tag); + fprintf(stderr, "Illegal tag no(%d)\n", tag->code); } return ; } @@ -258,8 +258,8 @@ int swf_tag_place_get_cid_by_instance_name(swf_tag_t *tag, unsigned char *instance_name, int instance_name_len, struct swf_object_ *swf) { swf_tag_place_detail_t *swf_tag_place; - if (! isPlaceTag(tag->tag)) { - fprintf(stderr, "swf_tag_place_get_cid_by_instance_name: ! isPlaceTag(%d)\n", tag->tag); + if (! isPlaceTag(tag->code)) { + fprintf(stderr, "swf_tag_place_get_cid_by_instance_name: ! isPlaceTag(%d)\n", tag->code); return -1; // wrong tag } swf_tag_place = (swf_tag_place_detail_t *) swf_tag_create_input_detail(tag, swf); Modified: trunk/src/swf_tag_shape.c =================================================================== --- trunk/src/swf_tag_shape.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag_shape.c 2011-04-06 07:15:45 UTC (rev 525) @@ -77,9 +77,9 @@ } // DefineMorphShape, DefineMorphShape2 - swf_tag_shape->is_morph = (tag->tag == 46) || (tag->tag == 84); + swf_tag_shape->is_morph = (tag->code == 46) || (tag->code == 84); // DefineShape4, DefineMorphShape2 - swf_tag_shape->has_strokes = (tag->tag == 83) || (tag->tag == 84); + swf_tag_shape->has_strokes = (tag->code == 83) || (tag->code == 84); if (swf_tag_shape->is_morph) { ret = swf_rect_parse(bs, &(swf_tag_shape->rect_morph)); @@ -161,9 +161,9 @@ fprintf(stderr, "swf_tag_shape_bitmap_get_refcid: tag == NULL\n"); return NULL; } - if (! isShapeTag(tag->tag)) { + if (! isShapeTag(tag->code)) { fprintf(stderr, "swf_tag_shape_bitmap_get_refcid: ! isShapeTag(%d)\n", - tag->tag); + tag->code); return NULL; } if (tag->detail == NULL) { @@ -246,9 +246,9 @@ fprintf(stderr, "swf_tag_shape_bitmap_replace_refcid: tag == NULL\n"); return 1; } - if (! isShapeTag(tag->tag)) { + if (! isShapeTag(tag->code)) { fprintf(stderr, "swf_tag_shape_bitmap_replace_refcid: ! isShapeTag(%d)\n", - tag->tag); + tag->code); return 1; } if (tag->detail == NULL) { @@ -334,9 +334,9 @@ swf_rect_build(bs, &(swf_tag_shape->rect)); // DefineMorphShape, DefineMorphShape2 - swf_tag_shape->is_morph = (tag->tag == 46) || (tag->tag == 84); + swf_tag_shape->is_morph = (tag->code == 46) || (tag->code == 84); // DefineShape4, DefineMorphShape2 - swf_tag_shape->has_strokes = (tag->tag == 83) || (tag->tag == 84); + swf_tag_shape->has_strokes = (tag->code == 83) || (tag->code == 84); if (swf_tag_shape->is_morph) { ret = swf_rect_build(bs, &(swf_tag_shape->rect_morph)); Modified: trunk/src/swf_tag_sprite.c =================================================================== --- trunk/src/swf_tag_sprite.c 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/swf_tag_sprite.c 2011-04-06 07:15:45 UTC (rev 525) @@ -139,7 +139,7 @@ print_indent(indent_depth); printf(" [%d] ", i); swf_tag_print(_tag, swf, indent_depth + 1); - if (_tag->tag == 0) { // END Tag + if (_tag->code == 0) { // END Tag break; } _tag = _tag->next; Modified: trunk/src/tests/isbitmaptag001.phpt =================================================================== --- trunk/src/tests/isbitmaptag001.phpt 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/tests/isbitmaptag001.phpt 2011-04-06 07:15:45 UTC (rev 525) @@ -19,7 +19,7 @@ --EXPECTF-- seqno=3 array ( - 'tag' => 6, + 'code' => 6, 'tagName' => 'DefineBitsJPEG', 'length' => 2133, 'detail' => true, Modified: trunk/src/tests/isshapetag001.phpt =================================================================== --- trunk/src/tests/isshapetag001.phpt 2011-04-06 07:08:39 UTC (rev 524) +++ trunk/src/tests/isshapetag001.phpt 2011-04-06 07:15:45 UTC (rev 525) @@ -19,7 +19,7 @@ --EXPECTF-- seqno=4 array ( - 'tag' => 2, + 'code' => 2, 'tagName' => 'DefineShape', 'length' => 51, 'detail' => true,