Avoid various gcc warnings.

This commit is contained in:
Julian Smith 2020-06-15 08:55:46 +01:00 committed by Automatic Release Builder
parent 4faf0ea468
commit a8c1bef0bf
6 changed files with 12 additions and 10 deletions

View File

@ -73,7 +73,7 @@ namespace canvas
int stretch, int stretch,
uint8_t alignment ) uint8_t alignment )
{ {
ItemData item_data = {0}; ItemData item_data = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
item_data.layout_item = item; item_data.layout_item = item;
item_data.stretch = std::max(0, stretch); item_data.stretch = std::max(0, stretch);

View File

@ -36,7 +36,7 @@ void naRuntimeError(naContext c, const char* fmt, ...)
void naRethrowError(naContext subc) void naRethrowError(naContext subc)
{ {
strncpy(subc->callParent->error, subc->error, sizeof(subc->error)); strncpy(subc->callParent->error, subc->error, sizeof(subc->callParent->error));
subc->callParent->dieArg = subc->dieArg; subc->callParent->dieArg = subc->dieArg;
longjmp(subc->callParent->jumpHandle, 1); longjmp(subc->callParent->jumpHandle, 1);
} }

View File

@ -7,7 +7,7 @@
#include "iolib.h" #include "iolib.h"
static void ghostDestroy(void* g); static void ghostDestroy(void* g);
naGhostType naIOGhostType = { ghostDestroy, "iofile" }; naGhostType naIOGhostType = { ghostDestroy, "iofile", NULL, NULL };
static struct naIOGhost* ioghost(naRef r) static struct naIOGhost* ioghost(naRef r)
{ {

View File

@ -9,10 +9,10 @@
#include "code.h" #include "code.h"
static void lockDestroy(void* lock) { naFreeLock(lock); } static void lockDestroy(void* lock) { naFreeLock(lock); }
static naGhostType LockType = { lockDestroy }; static naGhostType LockType = { lockDestroy, NULL, NULL, NULL };
static void semDestroy(void* sem) { naFreeSem(sem); } static void semDestroy(void* sem) { naFreeSem(sem); }
static naGhostType SemType = { semDestroy }; static naGhostType SemType = { semDestroy, NULL, NULL, NULL };
typedef struct { typedef struct {
naContext ctx; naContext ctx;

View File

@ -2197,11 +2197,12 @@ public:
_property->addChangeListener(this,initial); _property->addChangeListener(this,initial);
} }
SGPropertyChangeCallback(const SGPropertyChangeCallback<T>& other) : SGPropertyChangeCallback(const SGPropertyChangeCallback<T>& other)
_obj(other._obj), _callback(other._callback), _property(other._property) : SGPropertyChangeListener(other),
{ _obj(other._obj), _callback(other._callback), _property(other._property)
_property->addChangeListener(this,false); {
} _property->addChangeListener(this,false);
}
virtual ~SGPropertyChangeCallback() virtual ~SGPropertyChangeCallback()
{ {

View File

@ -594,6 +594,7 @@ unsigned int SGSoundMgr::request_buffer(SGSoundSample *sample)
case SG_SAMPLE_STEREO8: case SG_SAMPLE_STEREO8:
SG_LOG(SG_SOUND, SG_POPUP, "Stereo sound detected:\n" << sample->get_sample_name() << "\nUse two separate mono files instead if required."); SG_LOG(SG_SOUND, SG_POPUP, "Stereo sound detected:\n" << sample->get_sample_name() << "\nUse two separate mono files instead if required.");
format = AL_FORMAT_STEREO8; format = AL_FORMAT_STEREO8;
break;
default: default:
SG_LOG(SG_SOUND, SG_ALERT, "unsupported audio format"); SG_LOG(SG_SOUND, SG_ALERT, "unsupported audio format");
return buffer; return buffer;