@@ -376,13 +376,13 @@ void CRnnLM::initNet() {
376376 }
377377
378378 syn_d =
379- reinterpret_cast <direct_t *>(calloc (static_cast <int64 >(direct_size),
379+ reinterpret_cast <direct_t *>(calloc (static_cast <long long >(direct_size),
380380 sizeof (direct_t )));
381381
382382 if (syn_d == NULL ) {
383383 printf (" Memory allocation for direct"
384- " connections failed (requested %ld bytes)\n " ,
385- static_cast <int64 >(direct_size) * static_cast <int64 >(sizeof (direct_t )));
384+ " connections failed (requested %lld bytes)\n " ,
385+ static_cast <long long >(direct_size) * static_cast <long long >(sizeof (direct_t )));
386386 exit (1 );
387387 }
388388
@@ -461,7 +461,7 @@ void CRnnLM::initNet() {
461461 }
462462 }
463463
464- int64 aa;
464+ long long aa;
465465 for (aa = 0 ; aa < direct_size; aa++) {
466466 syn_d[aa] = 0 ;
467467 }
@@ -621,7 +621,7 @@ void CRnnLM::restoreNet() { // will read whole network structure
621621 fscanf (fi, " %d" , &layer2_size);
622622 if (ver > 5 ) {
623623 goToDelimiter (' :' , fi);
624- fscanf (fi, " %ld " , &direct_size);
624+ fscanf (fi, " %lld " , &direct_size);
625625 }
626626 if (ver > 6 ) {
627627 goToDelimiter (' :' , fi);
@@ -760,14 +760,14 @@ void CRnnLM::restoreNet() { // will read whole network structure
760760 }
761761 if (filetype == TEXT) {
762762 goToDelimiter (' :' , fi); // direct conenctions
763- int64 aa;
763+ long long aa;
764764 for (aa = 0 ; aa < direct_size; aa++) {
765765 fscanf (fi, " %lf" , &d);
766766 syn_d[aa] = d;
767767 }
768768 }
769769 if (filetype == BINARY) {
770- int64 aa;
770+ long long aa;
771771 for (aa = 0 ; aa < direct_size; aa++) {
772772 fread (&fl, 4 , 1 , fi);
773773 syn_d[aa] = fl;
@@ -982,7 +982,7 @@ void CRnnLM::computeNet(int last_word, int word) {
982982
983983 // apply direct connections to classes
984984 if (direct_size > 0 ) {
985- uint64 hash[MAX_NGRAM_ORDER];
985+ unsigned long long hash[MAX_NGRAM_ORDER];
986986 // this will hold pointers to syn_d that contains hash parameters
987987
988988 for (a = 0 ; a < direct_order; a++) {
@@ -997,7 +997,7 @@ void CRnnLM::computeNet(int last_word, int word) {
997997
998998 for (b = 1 ; b <= a; b++) {
999999 hash[a] += PRIMES[(a * PRIMES[b] + b) % PRIMES_SIZE]
1000- * static_cast <uint64 >(history[b - 1 ] + 1 );
1000+ * static_cast <unsigned long long >(history[b - 1 ] + 1 );
10011001 }
10021002 // update hash value based on words from the history
10031003
@@ -1061,7 +1061,7 @@ void CRnnLM::computeNet(int last_word, int word) {
10611061
10621062 // apply direct connections to words
10631063 if (word != -1 ) if (direct_size > 0 ) {
1064- uint64 hash[MAX_NGRAM_ORDER];
1064+ unsigned long long hash[MAX_NGRAM_ORDER];
10651065
10661066 for (a = 0 ; a < direct_order; a++) {
10671067 hash[a] = 0 ;
@@ -1072,11 +1072,11 @@ void CRnnLM::computeNet(int last_word, int word) {
10721072 if (a > 0 ) if (history[a - 1 ] == -1 ) break ;
10731073 hash[a] =
10741074 PRIMES[0 ] * PRIMES[1 ] *
1075- static_cast <uint64 >(vocab[word].class_index + 1 );
1075+ static_cast <unsigned long long >(vocab[word].class_index + 1 );
10761076
10771077 for (b = 1 ; b <= a; b++) {
10781078 hash[a] += PRIMES[(a * PRIMES[b] + b) % PRIMES_SIZE]
1079- * static_cast <uint64 >(history[b - 1 ] + 1 );
1079+ * static_cast <unsigned long long >(history[b - 1 ] + 1 );
10801080 }
10811081 hash[a] = (hash[a] % (direct_size / 2 )) + (direct_size) / 2 ;
10821082 }
0 commit comments