Constify a few things

This commit is contained in:
Pavel Krajcevski 2013-08-29 18:32:48 -04:00
parent 40743d612b
commit b3d7cd7877
4 changed files with 4 additions and 4 deletions

View file

@ -57,7 +57,7 @@
namespace PVRTCC { namespace PVRTCC {
Block::Block(uint8 *data) Block::Block(const uint8 *data)
: m_ColorACached(false) : m_ColorACached(false)
, m_ColorBCached(false) { , m_ColorBCached(false) {
assert(data); assert(data);

View file

@ -61,7 +61,7 @@ namespace PVRTCC {
class Block { class Block {
public: public:
explicit Block(uint8 *data); explicit Block(const uint8 *data);
Pixel GetColorA(); Pixel GetColorA();
Pixel GetColorB(); Pixel GetColorB();

View file

@ -130,7 +130,7 @@ namespace PVRTCC {
return 0; return 0;
} }
void Pixel::ChangeBitDepth(uint8 (&depth)[4]) { void Pixel::ChangeBitDepth(const uint8 (&depth)[4]) {
for(uint32 i = 0; i < 4; i++) { for(uint32 i = 0; i < 4; i++) {
m_Component[i] = ChangeBitDepth(m_Component[i], m_BitDepth[i], depth[i]); m_Component[i] = ChangeBitDepth(m_Component[i], m_BitDepth[i], depth[i]);
m_BitDepth[i] = depth[i]; m_BitDepth[i] = depth[i];

View file

@ -80,7 +80,7 @@ class Pixel {
// significant bits when going from larger to smaller bit depth // significant bits when going from larger to smaller bit depth
// or by repeating the most significant bits when going from // or by repeating the most significant bits when going from
// smaller to larger bit depths. // smaller to larger bit depths.
void ChangeBitDepth(uint8 (&newDepth)[4]); void ChangeBitDepth(const uint8 (&newDepth)[4]);
// Changes the bit depth of a single component. See the comment // Changes the bit depth of a single component. See the comment
// above for how we do this. // above for how we do this.