grendizerufo / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

Compile errors/warnings in StrLib.h #112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This code produces an un-initialised variable warning for "i"

inline uint strHash(const char * data, uint h = 5381)
{
  uint i;
  while(data[i] != 0) {
    h = (33 * h) ^ uint(data[i]);
    i++;
  }
  return h;
}

I assume that "i" should be set to zero.

Also in the same file, the class "Path" complains that it is already an
exported class, but some members also have the export tag on them.

// statics
NVCORE_API static char separator();
NVCORE_API static const char * fileName(const char *);
NVCORE_API static const char * extension(const char *);

The NVCORE_API tags should probably be removed.

Original issue reported on code.google.com by dtrebi...@gmail.com on 2 Mar 2010 at 1:12

GoogleCodeExporter commented 9 years ago
Wow, thanks for the catch. That code is *old*, I can't believe I've been living 
with
that bug for so long. This function is not used by NVTT, so it should not cause 
any
harm, but thanks for the bug report anyway!

Regarding the duplicate tags, I think that at least in some platforms they were
necessary, because these are static members.

Original comment by cast...@gmail.com on 2 Mar 2010 at 1:29

GoogleCodeExporter commented 9 years ago
Fixed after revision 1040.

Original comment by cast...@gmail.com on 2 Mar 2010 at 1:30