From 319443d42dbed8d6b07b8a2b7a0e565ff5bd8abf Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 19 Feb 2013 05:56:07 -0500 Subject: scons: Add warning for missing declarations This patch enables warnings for missing declarations. To avoid issues with SWIG-generated code, the warning is only applied to non-SWIG code. --- src/dev/disk_image.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/dev') diff --git a/src/dev/disk_image.hh b/src/dev/disk_image.hh index 905879248..da96082cb 100644 --- a/src/dev/disk_image.hh +++ b/src/dev/disk_image.hh @@ -137,4 +137,20 @@ class CowDiskImage : public DiskImage virtual std::streampos write(const uint8_t *data, std::streampos offset); }; +void SafeRead(std::ifstream &stream, void *data, int count); + +template +void SafeRead(std::ifstream &stream, T &data); + +template +void SafeReadSwap(std::ifstream &stream, T &data); + +void SafeWrite(std::ofstream &stream, const void *data, int count); + +template +void SafeWrite(std::ofstream &stream, const T &data); + +template +void SafeWriteSwap(std::ofstream &stream, const T &data); + #endif // __DISK_IMAGE_HH__ -- cgit v1.2.3