Index: courgette/program_detector.h |
diff --git a/courgette/program_detector.h b/courgette/program_detector.h |
index 06f1da3f84762791181742776de0d466ded7dec8..cce0a171ab4cb69d6e5c781ec1ba2d47138b0438 100644 |
--- a/courgette/program_detector.h |
+++ b/courgette/program_detector.h |
@@ -23,11 +23,21 @@ class AssemblyProgram; |
// On failure: |
// Fills in |type| with UNKNOWN, |detected_length| with 0, and returns |
// C_INPUT_NOT_RECOGNIZED. |
-Status DetectExecutableType(const void* buffer, |
+Status DetectExecutableType(const uint8_t* buffer, |
size_t length, |
ExecutableType* type, |
size_t* detected_length); |
+// Same as above, takes void* instead. |
+// TODO(etiennep): Propagate "const uint8_t*" upwards. |
+inline Status DetectExecutableType(const void* buffer, |
+ size_t length, |
+ ExecutableType* type, |
+ size_t* detected_length) { |
+ return DetectExecutableType(reinterpret_cast<const uint8_t*>(buffer), length, |
+ type, detected_length); |
+} |
+ |
// Attempts to detect the type of executable, and parse it with the appropriate |
// tools. |
// On success: |
@@ -35,10 +45,20 @@ Status DetectExecutableType(const void* buffer, |
// C_OK. |
// On failure: |
// Returns an error status and assigns |*output| to null. |
-Status ParseDetectedExecutable(const void* buffer, |
+Status ParseDetectedExecutable(const uint8_t* buffer, |
size_t length, |
std::unique_ptr<AssemblyProgram>* output); |
+// Same as above, takes void* instead. |
+// TODO(etiennep): Propagate "const uint8_t*" upwards. |
+inline Status ParseDetectedExecutable( |
+ const void* buffer, |
+ size_t length, |
+ std::unique_ptr<AssemblyProgram>* output) { |
+ return ParseDetectedExecutable(reinterpret_cast<const uint8_t*>(buffer), |
+ length, output); |
+} |
+ |
} // namespace courgette |
#endif // COURGETTE_PROGRAM_DETECTOR_H_ |