diff options
author | Willem Jan Palenstijn | 2013-10-01 23:20:24 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-10-01 23:20:43 +0200 |
commit | a97907241051b493875950285f858c6e215238e3 (patch) | |
tree | 1c0223a2843cd141f4cfacf6c2ee9612a083cc18 /engines/wintermute/ad/ad_inventory_box.cpp | |
parent | e0dd19a21cb07ab4704991800e23bf4ac2dfb0ef (diff) | |
download | scummvm-rg350-a97907241051b493875950285f858c6e215238e3.tar.gz scummvm-rg350-a97907241051b493875950285f858c6e215238e3.tar.bz2 scummvm-rg350-a97907241051b493875950285f858c6e215238e3.zip |
WINTERMUTE: Clean up byte/char casts in loading/parsing
Diffstat (limited to 'engines/wintermute/ad/ad_inventory_box.cpp')
-rw-r--r-- | engines/wintermute/ad/ad_inventory_box.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/wintermute/ad/ad_inventory_box.cpp b/engines/wintermute/ad/ad_inventory_box.cpp index 313da99a28..4c904e78eb 100644 --- a/engines/wintermute/ad/ad_inventory_box.cpp +++ b/engines/wintermute/ad/ad_inventory_box.cpp @@ -165,7 +165,7 @@ bool AdInventoryBox::display() { ////////////////////////////////////////////////////////////////////////// bool AdInventoryBox::loadFile(const char *filename) { - byte *buffer = BaseFileManager::getEngineInstance()->readWholeFile(filename); + char *buffer = (char *)BaseFileManager::getEngineInstance()->readWholeFile(filename); if (buffer == nullptr) { _gameRef->LOG(0, "AdInventoryBox::LoadFile failed for file '%s'", filename); return STATUS_FAILED; @@ -203,7 +203,7 @@ TOKEN_DEF(HIDE_SELECTED) TOKEN_DEF(EDITOR_PROPERTY) TOKEN_DEF_END ////////////////////////////////////////////////////////////////////////// -bool AdInventoryBox::loadBuffer(byte *buffer, bool complete) { +bool AdInventoryBox::loadBuffer(char *buffer, bool complete) { TOKEN_TABLE_START(commands) TOKEN_TABLE(INVENTORY_BOX) TOKEN_TABLE(TEMPLATE) @@ -221,34 +221,34 @@ bool AdInventoryBox::loadBuffer(byte *buffer, bool complete) { TOKEN_TABLE(EDITOR_PROPERTY) TOKEN_TABLE_END - byte *params; + char *params; int cmd = 2; BaseParser parser; bool alwaysVisible = false; _exclusive = false; if (complete) { - if (parser.getCommand((char **)&buffer, commands, (char **)¶ms) != TOKEN_INVENTORY_BOX) { + if (parser.getCommand(&buffer, commands, ¶ms) != TOKEN_INVENTORY_BOX) { _gameRef->LOG(0, "'INVENTORY_BOX' keyword expected."); return STATUS_FAILED; } buffer = params; } - while (cmd > 0 && (cmd = parser.getCommand((char **)&buffer, commands, (char **)¶ms)) > 0) { + while (cmd > 0 && (cmd = parser.getCommand(&buffer, commands, ¶ms)) > 0) { switch (cmd) { case TOKEN_TEMPLATE: - if (DID_FAIL(loadFile((char *)params))) { + if (DID_FAIL(loadFile(params))) { cmd = PARSERR_GENERIC; } break; case TOKEN_NAME: - setName((char *)params); + setName(params); break; case TOKEN_CAPTION: - setCaption((char *)params); + setCaption(params); break; case TOKEN_WINDOW: @@ -264,35 +264,35 @@ bool AdInventoryBox::loadBuffer(byte *buffer, bool complete) { break; case TOKEN_AREA: - parser.scanStr((char *)params, "%d,%d,%d,%d", &_itemsArea.left, &_itemsArea.top, &_itemsArea.right, &_itemsArea.bottom); + parser.scanStr(params, "%d,%d,%d,%d", &_itemsArea.left, &_itemsArea.top, &_itemsArea.right, &_itemsArea.bottom); break; case TOKEN_EXCLUSIVE: - parser.scanStr((char *)params, "%b", &_exclusive); + parser.scanStr(params, "%b", &_exclusive); break; case TOKEN_HIDE_SELECTED: - parser.scanStr((char *)params, "%b", &_hideSelected); + parser.scanStr(params, "%b", &_hideSelected); break; case TOKEN_ALWAYS_VISIBLE: - parser.scanStr((char *)params, "%b", &alwaysVisible); + parser.scanStr(params, "%b", &alwaysVisible); break; case TOKEN_SPACING: - parser.scanStr((char *)params, "%d", &_spacing); + parser.scanStr(params, "%d", &_spacing); break; case TOKEN_ITEM_WIDTH: - parser.scanStr((char *)params, "%d", &_itemWidth); + parser.scanStr(params, "%d", &_itemWidth); break; case TOKEN_ITEM_HEIGHT: - parser.scanStr((char *)params, "%d", &_itemHeight); + parser.scanStr(params, "%d", &_itemHeight); break; case TOKEN_SCROLL_BY: - parser.scanStr((char *)params, "%d", &_scrollBy); + parser.scanStr(params, "%d", &_scrollBy); break; case TOKEN_EDITOR_PROPERTY: |