Skip to content

Strange code fragments #980

@j-mattsson

Description

@j-mattsson
  1. Identical expressions on both side of the && operator:
    return Contains(Sphere(lss.mP0, lss.mRadius)) && Contains(Sphere(lss.mP0, lss.mRadius));
  2. Strange use of comma operator in if-condition:
    if (mBRDFTexture.isValid(), probeShaderConsts->mBRDFTextureMap->getSamplerRegister() != -1)
  3. Same code is executed regardless of condition:
    if (datablock->hasFixedWeight())
    return new afxXM_Scale_weighted(datablock, fx);
    else
    return new afxXM_Scale_weighted(datablock, fx);
  4. Nothing is done inside for-loop:
    for (U32 i = 1; i < argc; i++)
    {
    argv[i];
    }
  5. Enum value zero is used in bitwise AND-operation:
    if (mPrimitives[i].matIndex & TSDrawPrimitive::Triangles)
  6. bufSize (used later in a for-loop) seems to be initialized to 0 but then never changed:

    for (int i = 0; i < bufsize; i++)
  7. Looks strange to use bit mask values with logical OR-operator, perhaps bitwise OR should be used instead?
    if (getTypeMask() & (PlayerObjectType || VehicleObjectType ))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions