Merge pull request #4171 from acemod/cleanup-hash

deprecate ACE hash functions in favor of CBA versions
This commit is contained in:
commy2 2016-08-09 18:25:01 +02:00 committed by GitHub
commit 36e78e0722
14 changed files with 12 additions and 160 deletions

View File

@ -273,8 +273,3 @@ PREP(hashSet);
PREP(hashGet);
PREP(hashHasKey);
PREP(hashRem);
PREP(hashListCreateList);
PREP(hashListCreateHash);
PREP(hashListSelect);
PREP(hashListSet);
PREP(hashListPush);

View File

@ -30,7 +30,7 @@ if !([_unit] call EFUNC(common,isPlayer)) then {
} else {
//Sanity check to make sure we don't enable unconsious AI
if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith {
ERROR("Enabling AI for unconsious unit");
ACE_LOGERROR("Enabling AI for unconsious unit");
};
_unit enableAI "MOVE";

View File

@ -19,7 +19,7 @@
params ["_inputString", ["_getCenterOfGrid", true]];
if (count GVAR(mapGridData) == 0) exitWith {
ERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
ACE_LOGERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
(_this call BIS_fnc_gridToPos) select 0
};

View File

@ -12,4 +12,6 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashCreate),"3.8.0","CBA_fnc_hashCreate");
[[],[]]

View File

@ -13,6 +13,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashGet),"3.8.0","CBA_fnc_hashGet");
params ["_hash", "_key"];
ERRORDATA(2);

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashHasKey),"3.8.0","CBA_fnc_hashHasKey");
// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this];
params ["_hash", "_key"];

View File

@ -1,28 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList"];
ERRORDATA(1);
private _hashKeys = [];
try {
if(VALIDHASH(_hashList)) then {
_hashKeys = (_hashList select 0);
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
[_hashKeys, []];

View File

@ -1,17 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_keys"];
[_keys,[]];

View File

@ -1,26 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_value"];
ERRORDATA(2);
try {
if(VALIDHASH(_hashList)) then {
[_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet);
} else {
ERROR("Input hashlist in push not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -1,38 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_index"];
ERRORDATA(2);
private _hash = nil;
try {
if(VALIDHASH(_hashList)) then {
_hashList params ["_keys", "_hashes"];
if(_index < (count _hashes)) then {
private _values = _hashes select _index;
_hash = [_keys, _values, 1];
} else {
ERROR("Index of hashlist is out of range");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
if (isNil "_hash") exitWith { nil };
_hash;

View File

@ -1,32 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_index", "_value"];
ERRORDATA(3);
try {
if(VALIDHASH(_hashList)) then {
if(VALIDHASH(_value)) then {
_value params ["", "_vals"];
(_hashList select 1) set[_index, _vals];
} else {
ERROR("Set hash in hashlist is not valid");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashRem),"3.8.0","CBA_fnc_hashRem");
params ["_hash", "_key"];
ERRORDATA(2);

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashSet),"3.8.0","CBA_fnc_hashSet");
// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this];
params ["_hash", "_key", "_val"];

View File

@ -93,18 +93,6 @@
#define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QPATHTOF(folder\__PREP__.sqf)
#define HASH_CREATE ([] call EFUNC(common,hashCreate))
#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet))
#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet))
#define HASH_REM(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashRem))
#define HASH_HASKEY(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashHasKey))
#define HASHLIST_CREATELIST(keys) ([keys] call EFUNC(common,hashListCreateList))
#define HASHLIST_CREATEHASH(hashList) ([hashList] call EFUNC(common,hashListCreateHash))
#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect))
#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet))
#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush))
#define ACE_isHC (!hasInterface && !isDedicated)
#define IDC_STAMINA_BAR 193