ValveSoftware/vogl — pull request #62 by IanAtLunarG (2014-05-13 16:24:11+00:00)
Title: Eliminate Visual Studio 2013 compiler warnings in "pxfmt.cpp".

Some of the templatized functions will only be called for certain format-type
combinations (e.g. from_int_d24_unorm_s8_uint() will only be used with certain
data types). The parser will create errors for cases that will never happen
(e.g. trying to copy a "double" into a "uint32"). Because of this, certain
type-casts are used in places where you might think that no cast should be
needed (i.e. where a function is only intended to be called in certain cases).
However, casts are used to avoid compiler warnings.

There's also one place where the compiler warned about a "potential divide by
0", but where (as used) this can't occur. In this case, a compile-time "if"
statement is used to prevent the compiler from generating a warning. The
optimizer should eliminate the "if" statement, since it will be static for that
instantiation of the templatized function.