'offset' expression
effect:
- ('set-byte' | 'set-uint') expression
+ ('set-byte' | 'set-ushort' | 'set-uint') expression
expression:
atom ([+-] atom)*
enum {
EFFECT_SET_BYTE,
+ EFFECT_SET_USHORT,
EFFECT_SET_UINT,
EFFECT_SET_TRUNC
};
DEBUG_PARSER (printf("\tset-byte effect [%d]\n", value));
SET_VAL (ptr, guint8, value);
break;
+ case EFFECT_SET_USHORT:
+ DEBUG_PARSER (printf("\tset-sint effect [%d]\n", value));
+ SET_VAL (ptr, guint16, value);
+ break;
case EFFECT_SET_UINT:
DEBUG_PARSER (printf("\tset-uint effect [%d]\n", value));
SET_VAL (ptr, guint32, value);
if (!strcmp ("set-byte", name))
type = EFFECT_SET_BYTE;
+ else if (!strcmp ("set-ushort", name))
+ type = EFFECT_SET_USHORT;
else if (!strcmp ("set-uint", name))
type = EFFECT_SET_UINT;
else if (!strcmp ("truncate", name))
type = EFFECT_SET_TRUNC;
else
- FAIL(g_strdup_printf ("Invalid effect kind, expected one of: (set-byte set-uint) but got %s",name), INVALID_ID_TEXT);
+ FAIL(g_strdup_printf ("Invalid effect kind, expected one of: (set-byte set-ushort set-uint) but got %s",name), INVALID_ID_TEXT);
effect = g_new0 (patch_effect_t, 1);
effect->type = type;