Value initialize class with () not {}

Fixes problems with GCC 4.6
This commit is contained in:
Martin Pulec
2014-09-17 10:12:42 +02:00
parent b1381c2d5f
commit 06affa3248
13 changed files with 18 additions and 18 deletions

View File

@@ -104,7 +104,7 @@ void release_bmd_api_str(BMD_STR string)
IDeckLinkIterator *create_decklink_iterator(bool verbose)
{
IDeckLinkIterator *deckLinkIterator{};
IDeckLinkIterator *deckLinkIterator = nullptr;
#ifdef WIN32
HRESULT result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);

View File

@@ -80,7 +80,7 @@ static bool load_logo_data_from_file(struct state_capture_filter_logo *s, const
}
getline(file, line);
bool rgb = false;
int depth{};
int depth = 0;
while (!file.eof()) {
if (line.compare(0, strlen("WIDTH"), "WIDTH") == 0) {
s->width = atoi(line.c_str() + strlen("WIDTH "));
@@ -137,7 +137,7 @@ static bool load_logo_data_from_file(struct state_capture_filter_logo *s, const
static int init(struct module *parent, const char *cfg, void **state)
{
UNUSED(parent);
struct state_capture_filter_logo *s = new state_capture_filter_logo{};
struct state_capture_filter_logo *s = new state_capture_filter_logo();
s->x = s->y = -1;

View File

@@ -161,7 +161,7 @@ static void *worker(void *arg)
memset(&last_desc, 0, sizeof(last_desc));
memset(&last_fec_desc, 0, sizeof(last_fec_desc));
struct video_desc video_header{};
struct video_desc video_header = video_desc();
pthread_mutex_unlock(&s->lock);

View File

@@ -632,7 +632,7 @@ struct state_video_decoder *video_decoder_init(struct module *parent,
{
struct state_video_decoder *s;
s = new state_video_decoder{}; // call the constructor
s = new state_video_decoder();
s->parent = parent;

View File

@@ -86,7 +86,7 @@ struct video_frame_pool {
};
public:
video_frame_pool() : m_generation(0), m_desc{}, m_max_data_len(0) {
video_frame_pool() : m_generation(0), m_desc(), m_max_data_len(0) {
pthread_mutex_init(&m_lock, NULL);
}

View File

@@ -578,7 +578,7 @@ vidcap_decklink_probe(bool verbose)
vt->name = "decklink";
vt->description = "Blackmagic DeckLink card";
IDeckLinkIterator* deckLinkIterator{};
IDeckLinkIterator* deckLinkIterator = nullptr;
IDeckLink* deckLink;
int numDevices = 0;
HRESULT result;

View File

@@ -87,7 +87,7 @@ struct module *cuda_dxt_compress_init(struct module *parent,
const struct video_compress_params *params)
{
state_video_compress_cuda_dxt *s =
new state_video_compress_cuda_dxt{};
new state_video_compress_cuda_dxt();
const char *fmt = params->cfg;
s->out_codec = DXT1;

View File

@@ -229,7 +229,7 @@ struct module *dxt_glsl_compress_init(struct module *parent, const struct video_
return &compress_init_noerr;
}
s = new state_video_compress_rtdxt{};
s = new state_video_compress_rtdxt();
if (strcasecmp(opts, "DXT5") == 0) {
s->color_spec = DXT5;

View File

@@ -272,7 +272,7 @@ struct module * jpeg_compress_init(struct module *parent, const struct video_com
struct state_video_compress_jpeg *s;
const char *opts = params->cfg;
s = new state_video_compress_jpeg{};
s = new state_video_compress_jpeg();
if(opts && strcmp(opts, "help") == 0) {
printf("JPEG comperssion usage:\n");

View File

@@ -61,7 +61,7 @@ namespace {
struct thread_data {
thread_data() :
m_in(1), m_out(1),
jpeg_decoder(0), desc{}, out_codec{}, ppb{}, dxt_out_buff(0),
jpeg_decoder(0), desc(), out_codec(), ppb(), dxt_out_buff(0),
cuda_dev_index(-1)
{}
message_queue m_in;

View File

@@ -348,7 +348,7 @@ display_decklink_getf(void *state)
if (s->initialized) {
for (unsigned int i = 0; i < s->vid_desc.tile_count; ++i) {
const int linesize = vc_get_linesize(s->vid_desc.width, s->vid_desc.color_spec);
IDeckLinkMutableVideoFrame *deckLinkFrame{};
IDeckLinkMutableVideoFrame *deckLinkFrame = nullptr;
lock_guard<mutex> lg(s->buffer_pool.second);
while (!s->buffer_pool.first.empty()) {
@@ -386,7 +386,7 @@ display_decklink_getf(void *state)
deckLinkFrame->GetBytes((void **) &out->tiles[i].data);
if (s->stereo) {
IDeckLinkVideoFrame *deckLinkFrameRight{};
IDeckLinkVideoFrame *deckLinkFrameRight = nullptr;
dynamic_cast<DeckLink3DFrame *>(deckLinkFrame)->GetFrameForRightEye(&deckLinkFrameRight);
deckLinkFrameRight->GetBytes((void **) &out->tiles[1].data);
// release immedieatelly (parent still holds the reference)
@@ -745,7 +745,7 @@ void *display_decklink_init(const char *fmt, unsigned int flags)
}
s = new state_decklink{};
s = new state_decklink();
s->magic = DECKLINK_MAGIC;
s->stereo = FALSE;
s->emit_timecode = false;

View File

@@ -110,10 +110,10 @@ struct state_sdl {
#endif
volatile bool should_exit;
state_sdl() : magic(MAGIC_SDL), frames(0), yuv_image(nullptr), sdl_screen(nullptr), dst_rect{},
state_sdl() : magic(MAGIC_SDL), frames(0), yuv_image(nullptr), sdl_screen(nullptr), dst_rect(),
deinterlace(false), fs(false), nodecorate(false),
screen_w(0), screen_h(0), audio_buffer(nullptr), audio_frame{}, play_audio(false),
current_desc{}, current_display_desc{},
screen_w(0), screen_h(0), audio_buffer(nullptr), audio_frame(), play_audio(false),
current_desc(), current_display_desc(),
#ifdef HAVE_MACOSX
autorelease_pool(nullptr),
#endif

View File

@@ -64,7 +64,7 @@ void * deinterlace_init(char *config) {
return NULL;
}
struct state_deinterlace *s = new state_deinterlace{};
struct state_deinterlace *s = new state_deinterlace();
return s;
}