diff -u orig/allegro_flare.cpp patched/allegro_flare.cpp
--- orig/allegro_flare.cpp	2014-05-24 20:04:12.000000000 -0400
+++ patched/allegro_flare.cpp	2014-05-27 08:09:41.000000000 -0400
@@ -98,7 +98,7 @@
 Display *af::create_display(Display::resolution_t resolution)
 {
 	int w, h;
-	int screen_flags = NULL;
+	int screen_flags = 0;
 	int display_adapter_to_use = 0;
 
 	switch(resolution)
diff -u orig/bin.h patched/bin.h
--- orig/bin.h	2014-05-24 19:25:02.000000000 -0400
+++ patched/bin.h	2014-05-27 08:08:23.000000000 -0400
@@ -178,7 +178,7 @@
 {
 	Bin<T>::Record *r = get_record(identifier);
 	if (r) return r->data;
-	std::cout << "[" __FUNCTION__ "] could not load \"" << identifier << "\"" << std::endl;
+	std::cout << "[" << __FUNCTION__ << "] could not load \"" << identifier << "\"" << std::endl;
 	return NULL;
 }
 
@@ -192,7 +192,7 @@
 
 	if (load(identifier, identifier)) return get(identifier);
 
-	std::cout << "[" __FUNCTION__ "] could not load \"" << identifier << "\"" << std::endl;
+	std::cout << "[" << __FUNCTION__ << "] could not load \"" << identifier << "\"" << std::endl;
 	return NULL;
 }
 
@@ -279,7 +279,7 @@
 	// hmm... this function doesn't work if you place it in this base class's destructor
 	// the derived class is destructed before this base class.  destroy_data is a pure virtual function
 	// from the derived class.
-	for (std::vector<Bin<T>::Record *>::iterator it=record.begin(); it!=record.end(); it++)
+	for (typename std::vector<Bin<T>::Record *>::iterator it=record.begin(); it!=record.end(); it++)
 	{
 		destroy_data((*it)->data);
 		delete (*it);
diff -u orig/bitmap_object.h patched/bitmap_object.h
--- orig/bitmap_object.h	2014-05-24 19:27:50.000000000 -0400
+++ patched/bitmap_object.h	2014-05-27 08:09:50.000000000 -0400
@@ -80,8 +80,8 @@
 		if (_placement) _placement->start_transform();
 		if (_bitmap)
 		{
-			if (_appearance) al_draw_tinted_bitmap(_bitmap, color::color(_appearance->color, _appearance->opacity), 0, 0, NULL);
-			else al_draw_bitmap(_bitmap, 0, 0, NULL);
+			if (_appearance) al_draw_tinted_bitmap(_bitmap, color::color(_appearance->color, _appearance->opacity), 0, 0, 0);
+			else al_draw_bitmap(_bitmap, 0, 0, 0);
 		}
 		if (_placement) _placement->restore_transform();
 		return *this;
@@ -102,4 +102,4 @@
 
 
 
-#endif
\ No newline at end of file
+#endif
Common subdirectories: orig/bitmaps and patched/bitmaps
diff -u orig/color.cpp patched/color.cpp
--- orig/color.cpp	2014-05-24 19:26:52.000000000 -0400
+++ patched/color.cpp	2014-05-27 08:23:08.000000000 -0400
@@ -3,6 +3,7 @@
 #include "color.h"
 #include <math.h>
 #include <sstream>
+#include <string>
 
 
 
@@ -130,27 +131,33 @@
 
 void change_saturation(ALLEGRO_COLOR &color, float amount, float (*operation)(float op1, float op2))
 {
+	using std::min;
+	using std::max;
 	float h, s, l, a=color.a;
 	al_color_rgb_to_hsl(color.r, color.g, color.b, &h, &s, &l);
-	s = min(max(0, operation(s, amount)), 1.0);
+	s = min(max(0.0f, operation(s, amount)), 1.0f);
 	color = al_color_hsl(h, s, l);
 	color.a = a;
 }
 
 void change_lightness(ALLEGRO_COLOR &color, float amount, float (*operation)(float op1, float op2))
 {
+	using std::min;
+	using std::max;
 	float h, s, l, a=color.a;
 	al_color_rgb_to_hsl(color.r, color.g, color.b, &h, &s, &l);
-	l = min(max(0, operation(l, amount)), 1.0);
+	l = min(max(0.0f, operation(l, amount)), 1.0f);
 	color = al_color_hsl(h, s, l);
 	color.a = a;
 }
 
 void change_value(ALLEGRO_COLOR &color, float amount, float (*operation)(float op1, float op2))
 {
+	using std::min;
+	using std::max;
 	float h, s, v, a=color.a;
 	al_color_rgb_to_hsv(color.r, color.g, color.b, &h, &s, &v);
-	v = min(max(0, operation(v, amount)), 1.0);
+	v = min(max(0.0f, operation(v, amount)), 1.0f);
 	color = al_color_hsl(h, s, v);
 	color.a = a;
 }
@@ -201,7 +208,7 @@
 
 
 
-static void adjust_image(ALLEGRO_BITMAP *bitmap, float amount,
+void adjust_image(ALLEGRO_BITMAP *bitmap, float amount,
 	void (*filter_func)(ALLEGRO_COLOR &, float, float (*)(float, float)),
 	float (*filter_func_op)(float op1, float op2))
 {
@@ -408,4 +415,4 @@
 const ALLEGRO_COLOR yellowgreen = al_color_name("yellowgreen");
 
 
-}
\ No newline at end of file
+}
diff -u orig/dirty_signal_send.h patched/dirty_signal_send.h
--- orig/dirty_signal_send.h	2014-05-26 12:01:58.000000000 -0400
+++ patched/dirty_signal_send.h	2014-05-27 08:24:43.000000000 -0400
@@ -23,4 +23,4 @@
 
 
 
-#endif;
\ No newline at end of file
+#endif
diff -u orig/enemy.cpp patched/enemy.cpp
--- orig/enemy.cpp	2014-05-26 19:43:14.000000000 -0400
+++ patched/enemy.cpp	2014-05-27 08:55:10.000000000 -0400
@@ -47,8 +47,10 @@
 
 AntEnemy::AntEnemy(Map *map, vec3d position, vec3d domain_min, vec3d domain_max)
 	: Enemy(map, position, map->models["ant-03.obj"])
-	, domain(domain)
+	//~ , domain(domain)
 {
+	using std::min;
+	using std::max;
 	textures.set_texture(0, map->bitmaps["an_grey.png"]);
 	colors.set_color(0, color::black);
 	domain.min = vec3d(min(domain_min.x, domain_max.x), position.y, min(domain_min.z, domain_max.z));
diff -u orig/entity2.h patched/entity2.h
--- orig/entity2.h	2014-05-26 17:33:54.000000000 -0400
+++ patched/entity2.h	2014-05-27 08:15:55.000000000 -0400
@@ -63,7 +63,7 @@
 	virtual void update();
 	bool collides(vec3d point);
 
-	bool Entity2::update_player_collision(vec3d player_location);
+	bool update_player_collision(vec3d player_location);
 
 	virtual void on_collide(); //< not used, unfortunately... but was implemented in derived classes... unfortunately not here
 	virtual void on_enter(); //< not used, unfortunately... but was implemented in derived classes... unfortunately not here
@@ -77,4 +77,4 @@
 
 
 
-#endif
\ No newline at end of file
+#endif
diff -u orig/font_bin.cpp patched/font_bin.cpp
--- orig/font_bin.cpp	2014-05-26 08:23:14.000000000 -0400
+++ patched/font_bin.cpp	2014-05-27 08:25:22.000000000 -0400
@@ -41,7 +41,7 @@
 	size_t pos = identifier.find_last_of(' ');
 	if (pos == std::string::npos)
 	{
-		std::cout << "[" __FUNCTION__ "] font size should be included in the identifier string \"" << identifier << "\"." << std::endl;
+		std::cout << "[" << __FUNCTION__ << "] font size should be included in the identifier string \"" << identifier << "\"." << std::endl;
 	}
 	else
 	{
Common subdirectories: orig/fonts and patched/fonts
diff -u orig/main.cpp patched/main.cpp
--- orig/main.cpp	2014-05-25 20:06:10.000000000 -0400
+++ patched/main.cpp	2014-05-27 08:27:36.000000000 -0400
@@ -25,7 +25,7 @@
 
 
 
-int main(int argc, char *argv)
+int main(int argc, char **argv)
 {
 	af::initialize();
 	//Display *display = af::create_display(Display::FULLSCREEN_AUTO);
@@ -34,4 +34,4 @@
 	ProgramMaster *game_program_master = new ProgramMaster(display);
 
 	af::run_loop();
-}
\ No newline at end of file
+}
diff -u orig/model.h patched/model.h
--- orig/model.h	2014-05-25 18:07:36.000000000 -0400
+++ patched/model.h	2014-05-27 08:15:08.000000000 -0400
@@ -25,9 +25,9 @@
 
 	TextureSet();
 	bool set_texture(int model_object_index, ALLEGRO_BITMAP *bmp);
-	bool TextureSet::has_texture(int model_object_index);
+	bool has_texture(int model_object_index);
 
-	ALLEGRO_BITMAP *TextureSet::get_texture(int model_object_index);
+	ALLEGRO_BITMAP *get_texture(int model_object_index);
 };
 
 
@@ -38,9 +38,9 @@
 
 	ColorSet();
 	bool set_color(int model_object_index, ALLEGRO_COLOR col);
-	bool ColorSet::has_color(int model_object_index);
+	bool has_color(int model_object_index);
 
-	ALLEGRO_COLOR ColorSet::get_color(int model_object_index);
+	ALLEGRO_COLOR get_color(int model_object_index);
 };
 
 
@@ -104,7 +104,7 @@
 	void move_to(float x, float y, float z);
 	void scale(float x, float y, float z);
 
-	AABB3D Model::get_bbox();
+	AABB3D get_bbox();
 };
 
 
@@ -113,4 +113,4 @@
 
 
 
-#endif
\ No newline at end of file
+#endif
Common subdirectories: orig/models and patched/models
diff -u orig/object2d.cpp patched/object2d.cpp
--- orig/object2d.cpp	2014-05-24 19:26:06.000000000 -0400
+++ patched/object2d.cpp	2014-05-27 08:26:55.000000000 -0400
@@ -147,6 +147,8 @@
 
 object2d &object2d::scale_to_fit(float w, float h)
 {
+	using std::min;
+	
 	if (!_placement) transform_on();
 	float final_scale = 1.0;
 
@@ -228,7 +230,7 @@
 		std::vector<std::string> lval_rval_pair = php::explode("=", (*it));
 		if (lval_rval_pair.size() != 2)
 		{
-			std::cout << "[" __FUNCTION__ "] lval=rval format not found in token." << std::endl;
+			std::cout << "[" << __FUNCTION__ << "] lval=rval format not found in token." << std::endl;
 			continue;
 		}
 		std::string &lval = lval_rval_pair[0];
@@ -236,7 +238,7 @@
 		float &found_val = get_attr(lval);
 		if ((&found_val)==(&_dummy))
 		{
-			std::cout << "[" __FUNCTION__ "] the attribute \"" << lval << "\" does not exist, cannot set." << std::endl;
+			std::cout << "[" << __FUNCTION__ << "] the attribute \"" << lval << "\" does not exist, cannot set." << std::endl;
 			continue;
 		}
 		else
@@ -247,7 +249,7 @@
 			}
 			catch(...)
 			{
-				std::cout << "[" __FUNCTION__ "] the rval \"" << rval << "\" is not valid for the atof()." << std::endl;
+				std::cout << "[" << __FUNCTION__ << "] the rval \"" << rval << "\" is not valid for the atof()." << std::endl;
 				continue;
 			}
 		}
@@ -328,4 +330,4 @@
 	if (y < *_y) return false;
 	if (y > *_y+*_h) return false;
 	return true;
-}
\ No newline at end of file
+}
diff -u orig/player_character.cpp patched/player_character.cpp
--- orig/player_character.cpp	2014-05-26 18:55:34.000000000 -0400
+++ patched/player_character.cpp	2014-05-27 08:29:00.000000000 -0400
@@ -268,9 +268,10 @@
 
 bool PlayerCharacter::take_damage(float amt)
 {
+	using std::max;
 	if (state.has(NUMB_FROM_DAMAGE)) return false;
 
-	health -= max(0, (amt - hydration));
+	health -= max(0.0f, (amt - hydration));
 	hydration -= amt;
 
 	if (hydration < 0) hydration = 0;
diff -u orig/profile_timer.h patched/profile_timer.h
--- orig/profile_timer.h	2014-03-30 09:34:16.000000000 -0400
+++ patched/profile_timer.h	2014-05-27 07:56:37.000000000 -0400
@@ -49,8 +49,8 @@
 
 
 #include <string>
-#include <allegro5\allegro.h>
-#include <allegro5\allegro_font.h>
+#include <allegro5/allegro.h>
+#include <allegro5/allegro_font.h>
 
 typedef char char64_t[64];
 
diff -u orig/program_master.cpp patched/program_master.cpp
--- orig/program_master.cpp	2014-05-26 19:57:12.000000000 -0400
+++ patched/program_master.cpp	2014-05-27 08:37:09.000000000 -0400
@@ -9,7 +9,7 @@
 #include "dirty_signal_send.h"
 
 
-//Door *home_door = NULL;
+Door *home_door = NULL;
 
 
 ProgramMaster::ProgramMaster(Display *display)
diff -u orig/program_master.h patched/program_master.h
--- orig/program_master.h	2014-05-26 19:56:10.000000000 -0400
+++ patched/program_master.h	2014-05-27 08:37:01.000000000 -0400
@@ -98,4 +98,4 @@
 
 
 
-#endif
\ No newline at end of file
+#endif
diff -u orig/sound_object.cpp patched/sound_object.cpp
--- orig/sound_object.cpp	2014-05-24 19:26:16.000000000 -0400
+++ patched/sound_object.cpp	2014-05-27 08:28:02.000000000 -0400
@@ -42,7 +42,7 @@
 
 Sound &Sound::play()
 {
-	if (!al_play_sample_instance(sample_instance)) std::cout << "[" __FUNCTION__ "] could not al_play_sample_instance" << std::endl;
+	if (!al_play_sample_instance(sample_instance)) std::cout << "[" << __FUNCTION__ << "] could not al_play_sample_instance" << std::endl;
 	else _paused = false;
 	return *this;
 }
@@ -310,4 +310,4 @@
 	return record->data;
 }
 
-*/
\ No newline at end of file
+*/
diff -u orig/text_object.h patched/text_object.h
--- orig/text_object.h	2014-05-24 19:24:50.000000000 -0400
+++ patched/text_object.h	2014-05-27 08:08:52.000000000 -0400
@@ -92,14 +92,14 @@
 		al_store_state(&state, ALLEGRO_STATE_TARGET_BITMAP);
 		al_set_target_bitmap(img);
 		al_clear_to_color(al_map_rgba_f(0,0,0,0));
-		al_draw_text(_font, (_appearance)?color::color(_appearance->color, _appearance->opacity):al_map_rgba_f(1,1,1,1), 0, 0, NULL, str.c_str());
+		al_draw_text(_font, (_appearance)?color::color(_appearance->color, _appearance->opacity):al_map_rgba_f(1,1,1,1), 0, 0, 0, str.c_str());
 		al_restore_state(&state);
 		return img;
 	}
 	inline Text &draw()
 	{
 		if (_placement) _placement->start_transform();
- 		if (_font) al_draw_text(_font, (_appearance)?color::color(_appearance->color, _appearance->opacity):al_map_rgba_f(1,1,1,1), 0, 0, NULL, str.c_str());
+ 		if (_font) al_draw_text(_font, (_appearance)?color::color(_appearance->color, _appearance->opacity):al_map_rgba_f(1,1,1,1), 0, 0, 0, str.c_str());
 		if (_placement) _placement->restore_transform();
 		return *this;
 	}
diff -u orig/useful.h patched/useful.h
--- orig/useful.h	2014-05-24 20:32:56.000000000 -0400
+++ patched/useful.h	2014-05-27 08:03:09.000000000 -0400
@@ -125,17 +125,17 @@
     return ((float) rand()/RAND_MAX)*(max-min) + min;
 }
 
-template<class T>
-A_INLINE T random_element(std::vector<T> &elements)
-{
-	return elements[random_int(0, elements.size()+i)];
-}
-
-template<class T>
-A_INLINE T random_element(T elements[], int size)
-{
-	return elements[random_int(0, size-1)];
-}
+//~ template<class T>
+//~ A_INLINE T random_element(std::vector<T> &elements)
+//~ {
+	//~ return elements[random_int(0, elements.size()+i)];
+//~ }
+
+//~ template<class T>
+//~ A_INLINE T random_element(T elements[], int size)
+//~ {
+	//~ return elements[random_int(0, size-1)];
+//~ }
 
 A_INLINE double random_double(double min, double max)
 {
@@ -353,7 +353,7 @@
 	al_draw_prim(v, NULL, texture, 0, 4, ALLEGRO_PRIM_TRIANGLE_FAN);
 }
 
-A_INLINE void draw_stretched_bitmap(float x, float y, float w, float h, ALLEGRO_BITMAP *bitmap, int flip_flags=NULL, ALLEGRO_COLOR color=color::white)
+A_INLINE void draw_stretched_bitmap(float x, float y, float w, float h, ALLEGRO_BITMAP *bitmap, int flip_flags = 0, ALLEGRO_COLOR color=color::white)
 {
 	al_draw_tinted_scaled_bitmap(bitmap, color, 0, 0, al_get_bitmap_width(bitmap), al_get_bitmap_height(bitmap),
 		x, y, w, h, flip_flags);
@@ -691,7 +691,10 @@
 // trim from both ends
 A_INLINE std::string php::trim(std::string &s)
 {
-	return ltrim(rtrim(s));
+	std::string s1 = s;
+	std::string s2 = rtrim(s1);
+	std::string s3 = ltrim(s2);
+	return s3;
 }
 
 
