summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/bbackupctl/bbackupctl.cpp3
-rw-r--r--bin/bbackupobjdump/bbackupobjdump.cpp3
-rw-r--r--bin/bbackupquery/bbackupquery.cpp3
-rw-r--r--bin/bbstoreaccounts/bbstoreaccounts.cpp2
-rw-r--r--lib/backupclient/BackupClientFileAttributes.cpp2
-rw-r--r--lib/backupclient/BackupStoreFile.h1
-rw-r--r--lib/backupclient/BackupStoreFileDiff.cpp2
-rw-r--r--lib/backupclient/BackupStoreFileEncodeStream.cpp2
-rw-r--r--lib/common/Configuration.cpp2
-rw-r--r--lib/common/DebugMemLeakFinder.cpp15
-rw-r--r--lib/common/Logging.cpp4
-rw-r--r--lib/common/MemLeakFinder.h2
-rw-r--r--lib/common/StreamableMemBlock.cpp2
-rw-r--r--lib/common/Test.h2
-rw-r--r--lib/common/WaitForEvent.h2
-rw-r--r--lib/raidfile/RaidFileRead.h3
16 files changed, 36 insertions, 14 deletions
diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp
index 2c41f614..8dc8f30e 100644
--- a/bin/bbackupctl/bbackupctl.cpp
+++ b/bin/bbackupctl/bbackupctl.cpp
@@ -9,7 +9,8 @@
#include "Box.h"
-#include <stdio.h>
+#include <cstdio>
+#include <cstdlib>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/bin/bbackupobjdump/bbackupobjdump.cpp b/bin/bbackupobjdump/bbackupobjdump.cpp
index 74fff510..5b6c44f7 100644
--- a/bin/bbackupobjdump/bbackupobjdump.cpp
+++ b/bin/bbackupobjdump/bbackupobjdump.cpp
@@ -9,7 +9,8 @@
#include "Box.h"
-#include <stdio.h>
+#include <cstdio>
+#include <cstring>
#include "MainHelper.h"
#include "FileStream.h"
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp
index 33860dcf..bab697b8 100644
--- a/bin/bbackupquery/bbackupquery.cpp
+++ b/bin/bbackupquery/bbackupquery.cpp
@@ -14,7 +14,8 @@
#endif
#include <errno.h>
-#include <stdio.h>
+#include <cstdio>
+#include <cstdlib>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/bin/bbstoreaccounts/bbstoreaccounts.cpp b/bin/bbstoreaccounts/bbstoreaccounts.cpp
index 71114ef4..e377b661 100644
--- a/bin/bbstoreaccounts/bbstoreaccounts.cpp
+++ b/bin/bbstoreaccounts/bbstoreaccounts.cpp
@@ -36,6 +36,8 @@
#include "MemLeakFindOn.h"
+#include <cstring>
+
// max size of soft limit as percent of hard limit
#define MAX_SOFT_LIMIT_SIZE 97
diff --git a/lib/backupclient/BackupClientFileAttributes.cpp b/lib/backupclient/BackupClientFileAttributes.cpp
index bb17d41f..d896a363 100644
--- a/lib/backupclient/BackupClientFileAttributes.cpp
+++ b/lib/backupclient/BackupClientFileAttributes.cpp
@@ -28,6 +28,8 @@
#include <sys/xattr.h>
#endif
+#include <cstring>
+
#include "BackupClientFileAttributes.h"
#include "CommonException.h"
#include "FileModificationTime.h"
diff --git a/lib/backupclient/BackupStoreFile.h b/lib/backupclient/BackupStoreFile.h
index f38cd821..f4c60919 100644
--- a/lib/backupclient/BackupStoreFile.h
+++ b/lib/backupclient/BackupStoreFile.h
@@ -12,6 +12,7 @@
#include <cstdlib>
#include <memory>
+#include <cstdlib>
#include "BackupClientFileAttributes.h"
#include "BackupStoreFilename.h"
diff --git a/lib/backupclient/BackupStoreFileDiff.cpp b/lib/backupclient/BackupStoreFileDiff.cpp
index e9da1ee7..5705c3aa 100644
--- a/lib/backupclient/BackupStoreFileDiff.cpp
+++ b/lib/backupclient/BackupStoreFileDiff.cpp
@@ -35,6 +35,8 @@
#include "MemLeakFindOn.h"
+#include <cstring>
+
using namespace BackupStoreFileCryptVar;
using namespace BackupStoreFileCreation;
diff --git a/lib/backupclient/BackupStoreFileEncodeStream.cpp b/lib/backupclient/BackupStoreFileEncodeStream.cpp
index b2d44697..54c2463d 100644
--- a/lib/backupclient/BackupStoreFileEncodeStream.cpp
+++ b/lib/backupclient/BackupStoreFileEncodeStream.cpp
@@ -26,6 +26,8 @@
#include "MemLeakFindOn.h"
+#include <cstring>
+
using namespace BackupStoreFileCryptVar;
diff --git a/lib/common/Configuration.cpp b/lib/common/Configuration.cpp
index 7d2e0bac..2eb5fbca 100644
--- a/lib/common/Configuration.cpp
+++ b/lib/common/Configuration.cpp
@@ -22,6 +22,8 @@
#include "MemLeakFindOn.h"
+#include <cstring>
+
// utility whitespace function
inline bool iw(int c)
{
diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp
index 230d7163..72891cd1 100644
--- a/lib/common/DebugMemLeakFinder.cpp
+++ b/lib/common/DebugMemLeakFinder.cpp
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
#include <set>
+#include <cstdlib> // for std::atexit
#include "MemLeakFinder.h"
@@ -130,7 +131,7 @@ void *memleakfinder_malloc(size_t size, const char *file, int line)
{
InternalAllocGuard guard;
- void *b = ::malloc(size);
+ void *b = std::malloc(size);
if(!memleakfinder_global_enable) return b;
if(!memleakfinder_initialised) return b;
@@ -146,7 +147,7 @@ void *memleakfinder_realloc(void *ptr, size_t size)
if(!memleakfinder_global_enable || !memleakfinder_initialised)
{
- return ::realloc(ptr, size);
+ return std::realloc(ptr, size);
}
// Check it's been allocated
@@ -158,7 +159,7 @@ void *memleakfinder_realloc(void *ptr, size_t size)
"objects?");
}
- void *b = ::realloc(ptr, size);
+ void *b = std::realloc(ptr, size);
if(ptr && i!=sMallocBlocks.end())
{
@@ -215,7 +216,7 @@ void memleakfinder_free(void *ptr)
}
//TRACE1("free(), %08x\n", ptr);
- ::free(ptr);
+ std::free(ptr);
}
@@ -426,7 +427,7 @@ void memleakfinder_setup_exit_report(const char *filename, const char *markertex
atexit_markertext[sizeof(atexit_markertext)-1] = 0;
if(!atexit_registered)
{
- atexit(memleakfinder_atexit);
+ std::atexit(memleakfinder_atexit);
atexit_registered = true;
}
}
@@ -490,7 +491,7 @@ static void *internal_new(size_t size, const char *file, int line)
{
InternalAllocGuard guard;
- r = ::malloc(size);
+ r = std::malloc(size);
}
if (sInternalAllocDepth == 0)
@@ -533,7 +534,7 @@ void internal_delete(void *ptr)
{
InternalAllocGuard guard;
- ::free(ptr);
+ std::free(ptr);
remove_object_block(ptr);
//TRACE1("delete[]() called, %08x\n", ptr);
}
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp
index 1f872d93..1666b487 100644
--- a/lib/common/Logging.cpp
+++ b/lib/common/Logging.cpp
@@ -11,6 +11,10 @@
#include <errno.h>
#include <time.h>
+#include <string.h> // for stderror
+
+// c.f. http://bugs.debian.org/512510
+#include <cstdio>
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
diff --git a/lib/common/MemLeakFinder.h b/lib/common/MemLeakFinder.h
index 450d42f8..ca207bd5 100644
--- a/lib/common/MemLeakFinder.h
+++ b/lib/common/MemLeakFinder.h
@@ -12,7 +12,7 @@
#ifdef MEMLEAKFINDER_FULL_MALLOC_MONITORING
// include stdlib now, to avoid problems with having the macros defined already
- #include <stdlib.h>
+ #include <cstdlib>
#endif
// global enable flag
diff --git a/lib/common/StreamableMemBlock.cpp b/lib/common/StreamableMemBlock.cpp
index 7700152d..cf431022 100644
--- a/lib/common/StreamableMemBlock.cpp
+++ b/lib/common/StreamableMemBlock.cpp
@@ -10,7 +10,7 @@
#include "Box.h"
#include <new>
-#include <stdlib.h>
+#include <cstdlib>
#include <string.h>
#include "StreamableMemBlock.h"
diff --git a/lib/common/Test.h b/lib/common/Test.h
index f4766ddc..9cbfb706 100644
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -10,7 +10,7 @@
#ifndef TEST__H
#define TEST__H
-#include <string>
+#include <cstring>
#ifdef WIN32
#define BBACKUPCTL "..\\..\\bin\\bbackupctl\\bbackupctl.exe"
diff --git a/lib/common/WaitForEvent.h b/lib/common/WaitForEvent.h
index 045d6d67..a80761ef 100644
--- a/lib/common/WaitForEvent.h
+++ b/lib/common/WaitForEvent.h
@@ -22,6 +22,8 @@
#endif
#endif
+#include <cstdlib>
+
#include "CommonException.h"
#include "MemLeakFindOn.h"
diff --git a/lib/raidfile/RaidFileRead.h b/lib/raidfile/RaidFileRead.h
index 93bf7388..8a04409d 100644
--- a/lib/raidfile/RaidFileRead.h
+++ b/lib/raidfile/RaidFileRead.h
@@ -10,7 +10,8 @@
#ifndef RAIDFILEREAD__H
#define RAIDFILEREAD__H
-#include <string>
+#include <cstring>
+#include <cstdlib>
#include <memory>
#include <vector>