Skip to content

Commit

Permalink
More logic errors in the switch to use no_swizzle().
Browse files Browse the repository at this point in the history
This is exactly why you shouldn't use "no" in a function name...it causes
 double-negatives!

--HG--
branch : trunk
  • Loading branch information
icculus committed May 9, 2008
1 parent 184f420 commit 44768ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mojoshader.c
Expand Up @@ -1034,7 +1034,7 @@ static const char *make_D3D_srcarg_string_in_buf(Context *ctx,

char swizzle_str[6];
int i = 0;
if (no_swizzle(arg->swizzle))
if (!no_swizzle(arg->swizzle))
{
swizzle_str[i++] = '.';
swizzle_str[i++] = swizzle_channels[arg->swizzle_x];
Expand Down Expand Up @@ -3477,7 +3477,7 @@ static int parse_predicated_token(Context *ctx)
return fail(ctx, "Predicated instruction but not predicate register!");
else if ((arg->src_mod != SRCMOD_NONE) && (arg->src_mod != SRCMOD_NOT))
return fail(ctx, "Predicated instruction register is not NONE or NOT");
else if ( no_swizzle(arg->swizzle) && !replicate_swizzle(arg->swizzle) )
else if ( !no_swizzle(arg->swizzle) && !replicate_swizzle(arg->swizzle) )
return fail(ctx, "Predicated instruction register has wrong swizzle");
else if (arg->relative) // I'm pretty sure this is illegal...?
return fail(ctx, "relative addressing in predicated token");
Expand Down

0 comments on commit 44768ab

Please sign in to comment.