Fix annoying compiler warnings

This commit is contained in:
rdb 2008-12-25 14:27:20 +00:00
parent f7770ced0d
commit 1770e50147
4 changed files with 9 additions and 6 deletions

View File

@ -1033,11 +1033,11 @@ cg_release_resources() {
// Description: xyz
////////////////////////////////////////////////////////////////////
CGprogram Shader::
cg_compile_entry_point(char *entry, const ShaderCaps &caps, bool fshader)
cg_compile_entry_point(const char *entry, const ShaderCaps &caps, bool fshader)
{
CGprogram prog;
CGerror err;
char *compiler_args[100];
const char *compiler_args[100];
int nargs = 0;
int active = fshader ? caps._active_fprofile : caps._active_vprofile;
int ultimate = fshader ? caps._ultimate_fprofile : caps._ultimate_vprofile;

View File

@ -257,7 +257,7 @@ public:
private:
ShaderArgType cg_parameter_type(CGparameter p);
ShaderArgDir cg_parameter_dir(CGparameter p);
CGprogram cg_compile_entry_point(char *entry, const ShaderCaps &caps, bool fshader);
CGprogram cg_compile_entry_point(const char *entry, const ShaderCaps &caps, bool fshader);
bool cg_analyze_entry_point(CGprogram prog, bool fshader);
bool cg_analyze_shader(const ShaderCaps &caps);
bool cg_compile_shader(const ShaderCaps &caps);

View File

@ -404,7 +404,7 @@ make_resident() {
#endif
z_source.opaque = Z_NULL;
z_source.msg = "no error message";
z_source.msg = (char *) "no error message";
z_source.next_in = (Bytef *)(char *)_page_data;
z_source.avail_in = _size;
@ -497,7 +497,7 @@ make_compressed() {
#endif
z_dest.opaque = Z_NULL;
z_dest.msg = "no error message";
z_dest.msg = (char *) "no error message";
int result = deflateInit(&z_dest, vertex_data_compression_level);
if (result < 0) {

View File

@ -131,7 +131,10 @@ VertexDataSaveFile(const Filename &directory, const string &prefix,
if (result == 0) {
// We've got the file. Truncate it first, for good measure, in
// case there's an old version of the file we picked up.
ftruncate(_fd, 0);
if (ftruncate(_fd, 0) < 0) {
gobj_cat.warning()
<< "Couldn't truncate vertex data save file.\n";
}
// On Unix, it's safe to unlink (delete) the temporary file
// after it's been opened. The file remains open, but