Fix some compile warnings

This commit is contained in:
rdb 2016-06-22 13:44:16 +02:00
parent 1974b3e692
commit bf26cecb32
7 changed files with 22 additions and 20 deletions

View File

@ -1492,11 +1492,15 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps,
compiler_args[nargs++] = "ATI_draw_buffers";
}
char version_arg[16];
if (!cg_glsl_version.empty() && cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) {
snprintf(version_arg, 16, "version=%s", cg_glsl_version.c_str());
string version_arg;
if (!cg_glsl_version.empty() && active != CG_PROFILE_UNKNOWN &&
cgGetProfileProperty((CGprofile) active, CG_IS_GLSL_PROFILE)) {
version_arg = "version=";
version_arg += cg_glsl_version;
compiler_args[nargs++] = "-po";
compiler_args[nargs++] = version_arg;
compiler_args[nargs++] = version_arg.c_str();
}
compiler_args[nargs] = 0;

View File

@ -514,9 +514,8 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase2)::
add_hash(size_t hash) const {
TAU_PROFILE("size_t LVecBase2::add_hash(size_t)", " ", TAU_USER);
#ifdef FLOATTYPE_IS_INT
int_hash ihasher;
hash = ihasher.add_hash(hash, _v(0));
hash = ihasher.add_hash(hash, _v(1));
hash = int_hash::add_hash(hash, _v(0));
hash = int_hash::add_hash(hash, _v(1));
return hash;
#else
return add_hash(hash, NEARLY_ZERO(FLOATTYPE));

View File

@ -674,10 +674,9 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase3)::
add_hash(size_t hash) const {
TAU_PROFILE("size_t LVecBase3::add_hash(size_t)", " ", TAU_USER);
#ifdef FLOATTYPE_IS_INT
int_hash ihasher;
hash = ihasher.add_hash(hash, _v(0));
hash = ihasher.add_hash(hash, _v(1));
hash = ihasher.add_hash(hash, _v(2));
hash = int_hash::add_hash(hash, _v(0));
hash = int_hash::add_hash(hash, _v(1));
hash = int_hash::add_hash(hash, _v(2));
return hash;
#else
return add_hash(hash, NEARLY_ZERO(FLOATTYPE));

View File

@ -663,11 +663,10 @@ INLINE_LINMATH size_t FLOATNAME(LVecBase4)::
add_hash(size_t hash) const {
TAU_PROFILE("size_t LVecBase4::add_hash(size_t)", " ", TAU_USER);
#ifdef FLOATTYPE_IS_INT
int_hash ihasher;
hash = ihasher.add_hash(hash, _v(0));
hash = ihasher.add_hash(hash, _v(1));
hash = ihasher.add_hash(hash, _v(2));
hash = ihasher.add_hash(hash, _v(3));
hash = int_hash::add_hash(hash, _v(0));
hash = int_hash::add_hash(hash, _v(1));
hash = int_hash::add_hash(hash, _v(2));
hash = int_hash::add_hash(hash, _v(3));
return hash;
#else
return add_hash(hash, NEARLY_ZERO(FLOATTYPE));

View File

@ -227,7 +227,7 @@ BMPreadinfoheader(
* for the required total.
*/
if (classv != C_OS2) {
for (int i = 0; i < cbFix - 16; i += 4) {
for (int i = 0; i < (int)cbFix - 16; i += 4) {
GetLong(fp);
}
}

View File

@ -650,10 +650,10 @@ writePackedRawRow(ostream * const fileP,
const unsigned char * const packed_bits,
int const cols) {
int bytesWritten;
fileP->write((const char *)packed_bits, pbm_packed_bytes(cols));
if (fileP->fail())
if (fileP->fail()) {
pm_error("I/O error writing packed row to raw PBM file.");
}
}
static void

View File

@ -45,7 +45,8 @@ get_context() const {
context->AddReference();
return py_context.ptr();
} catch (const python::error_already_set& e) {
} catch (const python::error_already_set &e) {
(void)e;
// Return NULL, which will trigger the exception in Python
}
return NULL;