diff options
author | Filippos Karapetis | 2009-05-12 07:07:17 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-05-12 07:07:17 +0000 |
commit | 36c832d455f19fb1fa588ace2fb1746d00ddbf31 (patch) | |
tree | b4459ad59fcae54ddae7905adbaf1c0e5e8df687 /common | |
parent | 5f3938d615353b731e422f534ccd9f854711c230 (diff) | |
download | scummvm-rg350-36c832d455f19fb1fa588ace2fb1746d00ddbf31.tar.gz scummvm-rg350-36c832d455f19fb1fa588ace2fb1746d00ddbf31.tar.bz2 scummvm-rg350-36c832d455f19fb1fa588ace2fb1746d00ddbf31.zip |
Added a startOffset parameter to hexdump() (used by SCI's own hexdump method)
svn-id: r40470
Diffstat (limited to 'common')
-rw-r--r-- | common/util.cpp | 4 | ||||
-rw-r--r-- | common/util.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/common/util.cpp b/common/util.cpp index 75f7f82efa..787e0736f9 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -91,11 +91,11 @@ String StringTokenizer::nextToken() { // // Print hexdump of the data passed in // -void hexdump(const byte * data, int len, int bytesPerLine) { +void hexdump(const byte * data, int len, int bytesPerLine, int startOffset) { assert(1 <= bytesPerLine && bytesPerLine <= 32); int i; byte c; - int offset = 0; + int offset = startOffset; while (len >= bytesPerLine) { printf("%06x: ", offset); for (i = 0; i < bytesPerLine; i++) { diff --git a/common/util.h b/common/util.h index 3b2a705d6c..a7d6260583 100644 --- a/common/util.h +++ b/common/util.h @@ -96,8 +96,9 @@ private: * @param data the data to be dumped * @param len the lenght of that data * @param bytesPerLine number of bytes to print per line (default: 16) + * @param startOffset shift the shown offsets by the starting offset (default: 0) */ -extern void hexdump(const byte * data, int len, int bytesPerLine = 16); +extern void hexdump(const byte * data, int len, int bytesPerLine = 16, int startOffset = 0); /** |