Fix final simgear GCC warnings.
This commit is contained in:
parent
fddac2443d
commit
49a23fdc2e
@ -1006,9 +1006,13 @@ bool SGBinObject::write_ascii( const string& base, const string& name,
|
||||
fclose(fp);
|
||||
|
||||
string command = "gzip --force --best " + file.str();
|
||||
system(command.c_str());
|
||||
int err = system(command.c_str());
|
||||
if (err)
|
||||
{
|
||||
cout << "ERROR: gzip " << file.str() << " failed!" << endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
return (err == 0);
|
||||
}
|
||||
|
||||
void SGBinObject::read_properties(gzFile fp, int nproperties)
|
||||
|
@ -65,10 +65,16 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
|
||||
for (k = 0; k < RGB3; k++)
|
||||
ibuffer[q++] = (unsigned char)
|
||||
*(buffer + (pixelSize*((win_height-1-i)*win_width+j)+k));
|
||||
fwrite(ibuffer, sizeof(unsigned char), RGB3*win_width*win_height, fp);
|
||||
int written = fwrite(ibuffer, sizeof(unsigned char), RGB3*win_width*win_height, fp);
|
||||
fclose(fp);
|
||||
free(ibuffer);
|
||||
|
||||
if ( written != RGB3*win_width*win_height )
|
||||
{
|
||||
printf("Warning: failed to write %s. File truncated.\n", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
printf("wrote file '%s' (%d x %d pixels, %d bytes)\n",
|
||||
filename, win_width, win_height, RGB3*win_width*win_height);
|
||||
return true;
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
virtual ~SGSoundSample ();
|
||||
|
||||
/**
|
||||
* Detect wheter this audio sample holds the information of a sound file.
|
||||
* Detect whether this audio sample holds the information of a sound file.
|
||||
* @return Return true if this audio sample is to be constructed from a file.
|
||||
*/
|
||||
inline bool is_file() const { return _is_file; }
|
||||
@ -103,7 +103,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if static dataa of audio sample configuration has changed.
|
||||
* Test if static data of audio sample configuration has changed.
|
||||
* Calling this function will reset the flag so calling it a second
|
||||
* time in a row will return false.
|
||||
* @return Return true is the static data has changed in the mean time.
|
||||
|
@ -143,7 +143,7 @@ SGTimeZoneContainer::SGTimeZoneContainer(const char *filename)
|
||||
errno = 0;
|
||||
|
||||
while (1) {
|
||||
fgets(buffer, 256, infile);
|
||||
(void) fgets(buffer, 256, infile);
|
||||
if (feof(infile)) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user