Author: Guus Sliepen <guus@debian.org>
Last-Update: 2016-06-28 00:05:18 +0200
Description: Handle inputs up to 2^63 in length

--- a/code/src/disorder.c
+++ b/code/src/disorder.c
@@ -30,7 +30,7 @@
 #endif
 
 /** Frequecies for each byte */
-static __thread int m_token_freqs[LIBDO_MAX_BYTES]; //frequency of each token in sample
+static __thread long long m_token_freqs[LIBDO_MAX_BYTES]; //frequency of each token in sample
 static __thread float m_token_probs[LIBDO_MAX_BYTES]; //P(each token appearing)
 static __thread int m_num_tokens = 0; //actual number of `seen' tokens, max 256
 static __thread float m_maxent = 0.0;
@@ -85,7 +85,7 @@ static void
 get_token_frequencies(char* buf, 
 		      long long length)
 {
-  int i=0;
+  long long i=0;
   char* itr=NULL;
   unsigned char c=0;
 
@@ -129,7 +129,7 @@ shannon_H(char* buf,
   float bits = 0.0;
   char* itr=NULL; //values of itr should be zero to 255
   unsigned char token;
-  int num_events = 0; //`length' parameter
+  long long num_events = 0; //`length' parameter
   float freq = 0.0; //loop variable for holding freq from m_token_freq[]
   float entropy = 0.0; //running entropy sum
 
