Skip to content

Commit 95c54b5

Browse files
mingw windows friendly files
1 parent e60a780 commit 95c54b5

21 files changed

+119
-105
lines changed

src/batch_norm_layers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void save_bn(bn* b, int n){
269269
FILE* fw;
270270
char* s = (char*)malloc(sizeof(char)*256);
271271
char* t = ".bin";
272-
s = itoa(n,s);
272+
s = itoa_n(n,s);
273273
s = strcat(s,t);
274274

275275
fw = fopen(s,"a+");

src/convolutional_layers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ void save_cl(cl* f, int n){
11001100
FILE* fw;
11011101
char* s = (char*)malloc(sizeof(char)*256);
11021102
char* t = ".bin";
1103-
s = itoa(n,s);
1103+
s = itoa_n(n,s);
11041104
s = strcat(s,t);
11051105

11061106
fw = fopen(s,"a+");

src/dueling_categorical_dqn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void save_dueling_categorical_dqn(dueling_categorical_dqn* dqn, int n){
248248
FILE* fw;
249249
char* s = (char*)malloc(sizeof(char)*256);
250250
char* t = ".bin";
251-
s = itoa(n,s);
251+
s = itoa_n(n,s);
252252
s = strcat(s,t);
253253

254254
fw = fopen(s,"a+");
@@ -383,7 +383,7 @@ void save_dueling_categorical_dqn_given_directory(dueling_categorical_dqn* dqn,
383383
char* ss = (char*)malloc(sizeof(char)*256);
384384
ss[0] = '\0';
385385
char* t = ".bin";
386-
s = itoa(n,s);
386+
s = itoa_n(n,s);
387387
s = strcat(s,t);
388388
ss = strcat(ss,directory);
389389
ss = strcat(ss,s);

src/fully_connected_layers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ void save_fcl(fcl* f, int n){
646646
FILE* fw;
647647
char* s = (char*)malloc(sizeof(char)*256);
648648
char* t = ".bin";
649-
s = itoa(n,s);
649+
s = itoa_n(n,s);
650650
s = strcat(s,t);
651651

652652
fw = fopen(s,"a+");

src/llab.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ SOFTWARE.
2525
#ifndef __LLAB_H__
2626
#define __LLAB_H__
2727

28+
#ifdef _WIN32
29+
typedef unsigned int uint;
30+
#else
31+
//typedef unsigned int uint;
32+
#endif
33+
2834
#include <stdio.h>
2935
#include <stdlib.h>
3036
#include <dirent.h>

src/math_functions.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,26 @@ SOFTWARE.
2424

2525
#include "llab.h"
2626

27-
int min(int x, int y) {
28-
return (x < y) ? x : y;
27+
int min_int(int x, int y) {
28+
if(x < y)
29+
return x;
30+
return y;
2931
}
3032
float min_float(float x, float y) {
31-
return (x < y) ? x : y;
33+
if(x < y)
34+
return x;
35+
return y;
3236
}
3337

34-
int max(int x, int y) {
35-
return (x > y) ? x : y;
38+
int max_int(int x, int y) {
39+
if(x > y)
40+
return x;
41+
return y;
3642
}
3743
float max_float(float x, float y) {
38-
return (x > y) ? x : y;
44+
if(x > y)
45+
return x;
46+
return y;
3947
}
4048

4149
float mean(float* v, int size){

src/math_functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ void sum_models_partial_derivatives(model* sum_m, model** models, int n_models);
9595
void sum_rmodel_partial_derivatives(rmodel* m, rmodel* m2, rmodel* m3);
9696
void sum_rmodels_partial_derivatives(rmodel* m, rmodel** m2, int n_models);
9797
void sum_vae_model_partial_derivatives(vaemodel* vm, vaemodel* vm2, vaemodel* vm3);
98-
int min(int x, int y);
99-
int max(int x, int y);
98+
int min_int(int x, int y);
99+
int max_int(int x, int y);
100100
double sum_over_input(float* inputs, int dimension);
101101
float derivative_sigmoid_given_the_sigmoid(float x);
102102
void derivative_sigmoid_array_given_the_sigmoid(float* input, float* output, int size);

src/model.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ void save_model(model* m, int n){
831831
FILE* fw;
832832
char* s = (char*)malloc(sizeof(char)*256);
833833
char* t = ".bin";
834-
s = itoa(n,s);
834+
s = itoa_n(n,s);
835835
s = strcat(s,t);
836836

837837
fw = fopen(s,"a+");
@@ -908,7 +908,7 @@ void save_model_given_directory(model* m, int n, char* directory){
908908
char* ss = (char*)malloc(sizeof(char)*256);
909909
ss[0] = '\0';
910910
char* t = ".bin";
911-
s = itoa(n,s);
911+
s = itoa_n(n,s);
912912
s = strcat(s,t);
913913
ss = strcat(ss,directory);
914914
ss = strcat(ss,s);

src/neat_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int save_genome(genome* g, int global_inn_numb_connections, int numb){
4242
char *s = ".bin";
4343
FILE *write_ptr;
4444

45-
itoa(numb, string);
45+
itoa_n(numb, string);
4646

4747
strcat(string,s);
4848

@@ -110,7 +110,7 @@ int save_genome_complete(genome* g, int global_inn_numb_connections, int global_
110110
char *s = ".bin";
111111
FILE *write_ptr;
112112

113-
itoa(numb, string);
113+
itoa_n(numb, string);
114114

115115
strcat(string,s);
116116

src/recurrent_layers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ void save_lstm(lstm* rlstm, int n){
649649
FILE* fw;
650650
char* s = (char*)malloc(sizeof(char)*256);
651651
char* t = ".bin";
652-
s = itoa(n,s);
652+
s = itoa_n(n,s);
653653
s = strcat(s,t);
654654

655655
fw = fopen(s,"a+");

0 commit comments

Comments
 (0)