Folco (./29422) :
pea \End(pc) ; Same return address for all the cases
cmpi.w #HORIZONTAL_LAYOUT,Widget.type(a2)
bne.s \NoHorizontalLayout
bra PrepareHorizontalLayout
\NoHorizontalLayout:
cmpi.w #VERTICAL_LAYOUT,Widget.type(a2)
bne.s \NoVerticalLayout
bra PrepareVerticalLayout
\NoVerticalLayout:
cmpi.w #LABEL,Widget.type(a2)
bne.s \NoLabel
bra PrepareLabel
\End:
Un switch en assembleur : mutualisation des "break" avec un seul pea, gain de deux octets (bra.s) par casegcc sait faire ça ?
Personne n'a tiqué ?? Voici la même en mieux

pea \End(pc) ; Same return address for all the cases
cmpi.w #HORIZONTAL_LAYOUT,Widget.type(a2)
beq PrepareHorizontalLayout
cmpi.w #VERTICAL_LAYOUT,Widget.type(a2)
beq.s PrepareVerticalLayout
cmpi.w #LABEL,Widget.type(a2)
beq PrepareLabel
\End:
Zerosquare, toi qui a commenté ce post, tu me déçois autant que moi pour avoir mis une semaine à percuter ça

Mais j'en ai encore une (enfin, deux) autres optim's sous le coude pour faire tenir chaque
case x: func(); break; en 6, et même 4 octets
