improve compatibility with c++ compilers, prepare for CMake

This commit is contained in:
Stefano Sinigardi
2019-02-14 17:28:23 +01:00
parent 3d9c8530a0
commit b3579380dc
128 changed files with 1871 additions and 2258 deletions

View File

@ -7,7 +7,7 @@
layer make_shortcut_layer(int batch, int index, int w, int h, int c, int w2, int h2, int c2)
{
fprintf(stderr,"Shortcut Layer: %d\n", index);
layer l = {0};
layer l = { (LAYER_TYPE)0 };
l.type = SHORTCUT;
l.batch = batch;
l.w = w2;
@ -21,8 +21,8 @@ layer make_shortcut_layer(int batch, int index, int w, int h, int c, int w2, int
l.index = index;
l.delta = calloc(l.outputs*batch, sizeof(float));
l.output = calloc(l.outputs*batch, sizeof(float));;
l.delta = (float*)calloc(l.outputs * batch, sizeof(float));
l.output = (float*)calloc(l.outputs * batch, sizeof(float));
l.forward = forward_shortcut_layer;
l.backward = backward_shortcut_layer;
@ -44,8 +44,8 @@ void resize_shortcut_layer(layer *l, int w, int h)
l->h = l->out_h = h;
l->outputs = w*h*l->out_c;
l->inputs = l->outputs;
l->delta = realloc(l->delta, l->outputs*l->batch * sizeof(float));
l->output = realloc(l->output, l->outputs*l->batch * sizeof(float));
l->delta = (float*)realloc(l->delta, l->outputs * l->batch * sizeof(float));
l->output = (float*)realloc(l->output, l->outputs * l->batch * sizeof(float));
#ifdef GPU
cuda_free(l->output_gpu);