Permalink
Browse files

struct lif

  • Loading branch information...
1 parent 2edd1c0 commit 6fe56ed59c6b2b4be9c094a46daddda0724b4538 @jdgordon committed Nov 7, 2011
@@ -708,7 +708,7 @@ static int parse_logical_if(struct skin_element *element,
if (!lif)
return -1;
token->value.data = PTRTOSKINOFFSET(skin_buffer, lif);
- lif->token = element->params[0].data.code->data;
+ lif->token = PTRTOSKINOFFSET(skin_buffer, element->params[0].data.code->data);
if (!strncmp(op, "=", 1))
lif->op = IF_EQUALS;
@@ -732,9 +732,9 @@ static const char* NOINLINE get_lif_token_value(struct gui_wps *gwps,
{
int a = lif->num_options;
int b;
- const char* out_text = get_token_value(gwps, lif->token, offset,
- buf, buf_size, &a);
- if (a == -1 && lif->token->type != SKIN_TOKEN_VOLUME)
+ struct wps_token *liftoken = SKINOFFSETTOPTR(skin_buffer, lif->token);
+ const char* out_text = get_token_value(gwps, liftoken, offset, buf, buf_size, &a);
+ if (a == -1 && liftoken->type != SKIN_TOKEN_VOLUME)
a = (out_text && *out_text) ? 1 : 0;
switch (lif->operand.type)
{
@@ -756,7 +756,7 @@ static const char* NOINLINE get_lif_token_value(struct gui_wps *gwps,
b = lif->num_options;
outb = get_token_value(gwps, token, offset, temp_buf,
sizeof(temp_buf), &b);
- if (b == -1 && lif->token->type != SKIN_TOKEN_VOLUME)
+ if (b == -1 && liftoken->type != SKIN_TOKEN_VOLUME)
{
if (!out_text || !outb)
return (lif->op == IF_EQUALS) ? NULL : "neq";
@@ -280,7 +280,7 @@ struct conditional {
};
struct logical_if {
- struct wps_token *token;
+ OFFSETTYPE(struct wps_token *) token;
enum {
IF_EQUALS, /* == */
IF_NOTEQUALS, /* != */

0 comments on commit 6fe56ed

Please sign in to comment.