diff --git a/daemon/core/MainLoop.cpp b/daemon/core/MainLoop.cpp
index 3c650a8..a895da4 100644
--- a/daemon/core/MainLoop.cpp
+++ b/daemon/core/MainLoop.cpp
@@ -112,7 +112,7 @@ void MainLoop::run(const SocketList& sockets, sigset_t* sigMask)
 	    continue;
 	  std::string data;
 	  bool toClose=0;
-	  size_t readBytes = (*clientIt)->socket->read(data);
+	  ssize_t readBytes = (*clientIt)->socket->read(data);
 	  if (readBytes > 0)
 	    logMsg(LOG_DEBUG, "Read %u bytes from client (fd=%d)", data.length(), fd);
 	  if (readBytes <= 0)//if connection closed or there was reading problem;
diff --git a/executors/default.c b/executors/default.c
index 96edd52..4bc19d3 100644
--- a/executors/default.c
+++ b/executors/default.c
@@ -502,7 +502,9 @@ char processInputCommand(int fd)
       maxQueueSize = header.param1;
       return 1;
     } /*COMMAND_SET_QUEUE_LIMIT*/
-  fprintf(stderr, "%s unknown command %X(%lu,%lu,%lu)\n", ERROR_PREFIX, header.code, header.param1, header.param2, header.param3);
+  fprintf(stderr, "%s unknown command %X(%lu,%lu,%lu)\n", ERROR_PREFIX,
+	  header.code, (unsigned long)header.param1,
+	  (unsigned long)header.param2, (unsigned long)header.param3);
   fflush(stderr);
   return 1;
 }
diff --git a/libvmclient/vmclient.c b/libvmclient/vmclient.c
index 0272e47..926bc0a 100644
--- a/libvmclient/vmclient.c
+++ b/libvmclient/vmclient.c
@@ -270,7 +270,7 @@ vm_result_t vm_tone(vm_connection_t con, size_t freq, size_t lengthms)
   assert(con != VOICEMAN_BAD_CONNECTION);
   if (con == VOICEMAN_BAD_CONNECTION)
     return VOICEMAN_ERROR;
-  sprintf(buf, "B:%lu:%lu\n", freq, lengthms);
+  sprintf(buf, "B:%lu:%lu\n", (unsigned long)freq, (unsigned long)lengthms);
   if (writebuf(con, buf, strlen(buf)) == -1)
     return VOICEMAN_ERROR;
   return VOICEMAN_OK;
