common.h

changeset 63
0557babc8675
parent 59
891b9e6ee139
child 66
4fc1ec88aa41
--- a/common.h	Sat Aug 25 05:22:32 2012 +0300
+++ b/common.h	Sun Aug 26 23:18:59 2012 +0300
@@ -43,7 +43,6 @@
 
 #include <stdio.h>
 #include <stdarg.h>
-#include <typeinfo> 
 #include <stdint.h>
 #include "bots.h"
 #include "str.h"
@@ -100,16 +99,14 @@
 #endif
 
 // Power function
-template<class T> T pow (T a, int b) {
+template<class T> T pow (T a, unsigned int b) {
 	if (!b)
 		return 1;
 	
 	T r = a;
 	while (b > 1) {
 		b--;
-		
-		// r *= a fails here with large numbers
-		r += a * a;
+		r = r * a;
 	}
 	
 	return r;
@@ -121,7 +118,6 @@
 }
 
 // Byte datatype
-// typedef unsigned long int word;
 typedef int32_t word;
 typedef unsigned char byte;
 

mercurial