From 4cf037d5d3b0d6d5eaa92807aabbe4d3c0f0c0ba Mon Sep 17 00:00:00 2001 From: doomchild Date: Thu, 3 Mar 2011 14:15:27 -0600 Subject: [PATCH] changed a couple of argument types to be more explicit --- library/include/dfhack-c/modules/WindowIO_C.h | 4 ++-- library/modules/WindowIO_C.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/library/include/dfhack-c/modules/WindowIO_C.h b/library/include/dfhack-c/modules/WindowIO_C.h index 072a4f352..2051dee6a 100644 --- a/library/include/dfhack-c/modules/WindowIO_C.h +++ b/library/include/dfhack-c/modules/WindowIO_C.h @@ -32,9 +32,9 @@ distribution. extern "C" { #endif -DFHACK_EXPORT int WindowIO_TypeStr(DFHackObject* window, const char* input, int delay, bool useShift); +DFHACK_EXPORT int WindowIO_TypeStr(DFHackObject* window, const char* input, uint32_t delay, int8_t useShift); -DFHACK_EXPORT int WindowIO_TypeSpecial(DFHackObject* window, t_special command, int count, int delay); +DFHACK_EXPORT int WindowIO_TypeSpecial(DFHackObject* window, t_special command, uint32_t count, uint32_t delay); #ifdef __cplusplus } diff --git a/library/modules/WindowIO_C.cpp b/library/modules/WindowIO_C.cpp index 31c6e4739..73217a7d2 100644 --- a/library/modules/WindowIO_C.cpp +++ b/library/modules/WindowIO_C.cpp @@ -40,18 +40,23 @@ using namespace DFHack; extern "C" { #endif -int WindowIO_TypeStr(DFHackObject* window, const char* input, int delay, bool useShift) +int WindowIO_TypeStr(DFHackObject* window, const char* input, uint32_t delay, int8_t useShift) { if(window != NULL) { - ((DFHack::WindowIO*)window)->TypeStr(input, delay, useShift); + bool shifting = false; + + if(useShift > 0) + shifting = true; + + ((DFHack::WindowIO*)window)->TypeStr(input, delay, shifting); return 1; } return -1; } -int WindowIO_TypeSpecial(DFHackObject* window, t_special command, int count, int delay) +int WindowIO_TypeSpecial(DFHackObject* window, t_special command, uint32_t count, uint32_t delay) { if(window != NULL) {