From b63faa83fa15544e211f08b768148f1634e76ae6 Mon Sep 17 00:00:00 2001
From: carlocamilloni <carlo.camilloni@gmail.com>
Date: Thu, 30 Nov 2017 09:55:48 +0100
Subject: [PATCH] fixed warnings

---
 src/tools/Grid.cpp  | 6 +++---
 src/tools/OFile.cpp | 2 +-
 src/tools/OFile.h   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/tools/Grid.cpp b/src/tools/Grid.cpp
index 0a8ac164c..0d38efa52 100644
--- a/src/tools/Grid.cpp
+++ b/src/tools/Grid.cpp
@@ -280,10 +280,10 @@ vector<Grid::index_t> Grid::getNeighbors
     for(unsigned i=0; i<dimension_; ++i) {
       int i0=small_indices[i]-nneigh[i]+indices[i];
       if(!pbc_[i] && i0<0)         continue;
-      if(!pbc_[i] && i0>=nbin_[i]) continue;
+      if(!pbc_[i] && i0>=static_cast<int>(nbin_[i])) continue;
       if( pbc_[i] && i0<0)         i0=nbin_[i]-(-i0)%nbin_[i];
-      if( pbc_[i] && i0>=nbin_[i]) i0%=nbin_[i];
-      tmp_indices[ll]=((unsigned)i0);
+      if( pbc_[i] && i0>=static_cast<int>(nbin_[i])) i0%=nbin_[i];
+      tmp_indices[ll]=static_cast<unsigned>(i0);
       ll++;
     }
     tmp_indices.resize(ll);
diff --git a/src/tools/OFile.cpp b/src/tools/OFile.cpp
index 2bb7a025b..b5e327f2a 100644
--- a/src/tools/OFile.cpp
+++ b/src/tools/OFile.cpp
@@ -80,7 +80,7 @@ OFile::OFile():
   actual_buffer_length=0;
   buffer=new char[buflen];
 // these are set to zero to avoid valgrind errors
-  for(unsigned i=0; i<buflen; ++i) buffer[i]=0;
+  for(int i=0; i<buflen; ++i) buffer[i]=0;
   buffer_string=new char [1000];
 // these are set to zero to avoid valgrind errors
   for(unsigned i=0; i<1000; ++i) buffer_string[i]=0;
diff --git a/src/tools/OFile.h b/src/tools/OFile.h
index 710ed976c..41580d0fb 100644
--- a/src/tools/OFile.h
+++ b/src/tools/OFile.h
@@ -156,7 +156,7 @@ class OFile:
 /// Internal buffer length
   int buflen;
 /// This variables stores the actual buffer length
-  unsigned actual_buffer_length;
+  int actual_buffer_length;
 /// Class identifying a single field for fielded output
   class Field:
     public FieldBase {
-- 
GitLab