Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 8cf0c634 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Fixed various warnings and CppCheck issues.

parent 340fdebf
......@@ -285,9 +285,9 @@ namespace campvis {
const ImageData* id = static_cast<const ImageData*>(_textures[texIndx].getData());
const cgt::Texture* tex = id->getRepresentation<ImageRepresentationGL>()->getTexture();
const ImageRepresentationLocal* localRep = id->getRepresentation<ImageRepresentationLocal>();
cgt::ivec2 imageSize = id->getSize().xy();
cgt::svec2 imageSize = id->getSize().xy();
cgt::vec2 lookupTexelFloat = cgt::vec2((e->coord() % _quadSize) * imageSize) / cgt::vec2(_quadSize);
cgt::vec2 lookupTexelFloat = cgt::vec2((e->coord() % _quadSize) * cgt::ivec2(imageSize)) / cgt::vec2(_quadSize);
// compute transformation matrices
float renderTargetRatio = static_cast<float>(_quadSize.x) / static_cast<float>(_quadSize.y);
......
......@@ -103,7 +103,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
return 0;
}
int bpp = header[4];
size_t bpp = static_cast<size_t>(header[4]);
bpp /= 8; // divide by 8 to get the bytes per pixel
GLint format = GL_RGBA;
......@@ -128,7 +128,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
GLenum dataType = GL_UNSIGNED_BYTE;
int numBytes = bpp * cgt::hmul(dimensions);
size_t numBytes = static_cast<size_t>(bpp * cgt::hmul(dimensions));
GLubyte* buffer = new GLubyte[numBytes];
if (TGAheader[2] == 2) {
......@@ -137,6 +137,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
if (file->read(buffer, numBytes) != numBytes) {
LERROR("Failed to read uncompressed image! file: " << filename);
delete file;
delete [] buffer;
return 0;
}
}
......@@ -147,7 +148,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
//TODO: error handling
unsigned char chunk[4];
unsigned char* at = buffer;
for (int bytesDone=0; bytesDone < numBytes; /* nothing here */) {
for (size_t bytesDone = 0; bytesDone < numBytes; /* nothing here */) {
unsigned char packetHead;
file->read(reinterpret_cast<char*>(&packetHead), 1);
if (packetHead > 128) {
......@@ -175,7 +176,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
// switch r & b
if (bpp >= 3) {
GLubyte* at = buffer;
while (at - buffer < numBytes) {
while (at - buffer < static_cast<ptrdiff_t>(numBytes)) {
std::swap(at[0], at[2]);
at += bpp;
}
......@@ -185,6 +186,7 @@ Texture* TextureReaderTga::loadTexture(const std::string& filename, Texture::Fil
t->uploadTexture(buffer, format, dataType);
t->setName(filename);
delete [] buffer;
return t;
}
......
......@@ -76,7 +76,6 @@ namespace campvis {
ImageRepresentationGL::ScopedRepresentation img(data, p_inputImage.getValue());
if (img != 0) {
cgt::ivec3 inputSize = img->getSize();
cgt::ivec3 outputSize = cgt::abs(p_urb.getValue() - p_llf.getValue());
cgt::TextureUnit inputUnit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment