{ S64 a = ((S64)a1*(S64)b1+(S64)a2*(S64)b2)>>16;
SFIXED result = (SFIXED)(a);
if(a!=result)
- fprintf(stderr, "Warning: overflow in matrix multiplication");
+ fprintf(stderr, "Warning: overflow in matrix multiplication\n");
return result;
}
SFIXED RFXSWF_QFIX(int zaehler,int nenner) // bildet Quotient von zwei INTs in SFIXED
}
} break;
+ case ST_DOABC:
+ case ST_RAWABC:
+ break;
+
case ST_FREECHARACTER: /* unusual tags, which all start with an ID */
case ST_NAMECHARACTER:
case ST_DEFINEBINARY:
enumerateUsedIDs(t, 0, callbackFillin, &ptr);
}
-void swf_Relocate (SWF*swf, char*bitmap)
+char swf_Relocate (SWF*swf, char*bitmap)
{
TAG*tag;
int slaveids[65536];
memset(slaveids, -1, sizeof(slaveids));
tag = swf->firstTag;
+ char ok = 1;
while(tag)
{
int num;
if(!bitmap[id]) { //free
newid = id;
- }
- else {
+ } else {
newid = 0;
for (t=1;t<65536;t++)
{
break;
}
}
+ if(t==65536) {
+ fprintf(stderr, "swf_Relocate: Couldn't relocate: Out of IDs\n");
+ return 0;
+ }
}
bitmap[newid] = 1;
slaveids[id] = newid;
if(slaveids[id]<0) {
fprintf(stderr, "swf_Relocate: Mapping id (%d) never encountered before in %s\n", id,
swf_TagGetName(tag));
+ ok = 0;
} else {
id = slaveids[id];
PUT16(&tag->data[ptr[t]], id);
}
}
+ free(ptr);
}
tag=tag->next;
}
+ return ok;
}
/* untested */
PUT16(&tag->data[ptr[t]], id);
}
}
+ free(ptr);
}
}
}