From 268b533a85e2fc421b4baef1f2f6e11ca208efb1 Mon Sep 17 00:00:00 2001
From: Pietro Incardona <i-bird@localhost.localdomain>
Date: Wed, 23 Dec 2015 20:38:24 -0500
Subject: [PATCH] Last status of devices

---
 .gitignore                |  1 +
 src/Memleak_check.cpp     |  2 +-
 src/Memleak_check.hpp     | 10 +++++-----
 src/memory/HeapMemory.cpp |  1 -
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index fb459c3..f729f19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
 *.exe
 *.o
 *.so
+*.a
 
 # Packages #
 ############
diff --git a/src/Memleak_check.cpp b/src/Memleak_check.cpp
index 756aaad..0fbe86c 100644
--- a/src/Memleak_check.cpp
+++ b/src/Memleak_check.cpp
@@ -3,7 +3,7 @@
 #include "ptr_info.hpp"
 
 // counter for allocation of new memory
-size_t new_data;
+long int new_data;
 
 // counter to delete memory
 size_t delete_data;
diff --git a/src/Memleak_check.hpp b/src/Memleak_check.hpp
index a6fcda4..45b25bf 100644
--- a/src/Memleak_check.hpp
+++ b/src/Memleak_check.hpp
@@ -34,7 +34,7 @@ typedef unsigned char * byte_ptr;
 extern long int msg_on_alloc;
 extern long int thr_on_alloc;
 extern std::string col_stop;
-extern size_t new_data;
+extern long int new_data;
 extern size_t delete_data;
 
 extern std::map<byte_ptr,ptr_info> active_ptr;
@@ -307,7 +307,7 @@ static bool check_valid(const void * ptr, size_t size_access)
 {
 	if (active_ptr.size() == 0)
 	{
-		std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  " << ptr << "\n";
+		std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  " << ptr << "\n";
 		ACTION_ON_ERROR(MEM_ERROR);
 		return false;
 	}
@@ -321,7 +321,7 @@ static bool check_valid(const void * ptr, size_t size_access)
 	{
 		if (process_to_print < 0 || process_to_print == process_v_cl)
 		{
-			std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  " << ptr << "   base allocation id=" << l_b->second.id << "\n";
+			std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  " << ptr << "   base allocation id=" << l_b->second.id << "\n";
 			ACTION_ON_ERROR(MEM_ERROR);
 		}
 		return false;
@@ -335,7 +335,7 @@ static bool check_valid(const void * ptr, size_t size_access)
 	{
 		if (process_to_print < 0 || process_to_print == process_v_cl)
 		{
-			std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  " << ptr << "   base allocation id=" << l_b->second.id  << "\n";
+			std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  " << ptr << "   base allocation id=" << l_b->second.id  << "\n";
 			ACTION_ON_ERROR(MEM_ERROR);
 		}
 		return false;
@@ -349,7 +349,7 @@ static bool check_valid(const void * ptr, size_t size_access)
 	{
 		if (process_to_print < 0 || process_to_print == process_v_cl)
 		{
-			std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  "  << ptr << "   base allocation id=" << l_b->second.id << "\n";
+			std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << "  "  << ptr << "   base allocation id=" << l_b->second.id << "\n";
 			ACTION_ON_ERROR(MEM_ERROR);
 		}
 		return false;
diff --git a/src/memory/HeapMemory.cpp b/src/memory/HeapMemory.cpp
index 1ed812a..82d44f6 100644
--- a/src/memory/HeapMemory.cpp
+++ b/src/memory/HeapMemory.cpp
@@ -169,7 +169,6 @@ bool HeapMemory::resize(size_t sz)
 	byte * tdmOrig;
 	tdmOrig = new byte[sz+alignement];
 #ifdef SE_CLASS2
-	std::cout << "DIOCANE\n";
 	check_new(tdmOrig,sz+alignement,HEAPMEMORY_EVENT,0);
 #endif
 	tdm = tdmOrig;
-- 
GitLab