From 3c7c840a7f0afb9a476ca519171b4094d641d9a0 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 23 Jan 2016 04:40:48 +0100 Subject: [PATCH 1/2] replace PUSH() Macro with pushback from Code --- addons/common/XEH_postInit.sqf | 2 +- addons/common/fnc_createCenter.sqf | 5 +++- addons/common/fnc_getAlive.sqf | 2 +- addons/common/fnc_getFirer.sqf | 4 ++-- addons/common/fnc_getGroupIndex.sqf | 2 +- addons/common/fnc_getTurret.sqf | 2 +- addons/common/fnc_parseYAML.sqf | 24 +++++++++---------- addons/common/init_addons.sqf | 3 +-- addons/diagnostic/fnc_debug.sqf | 18 +++++++------- addons/diagnostic/fnc_log.sqf | 2 +- addons/diagnostic/fnc_perf_loop.sqf | 13 +++++----- addons/events/fnc_addEventHandler.sqf | 2 +- addons/events/fnc_addKeyHandler.sqf | 2 +- addons/events/fnc_addLocalEventHandler.sqf | 2 +- addons/events/fnc_changeKeyHandler.sqf | 2 +- addons/events/fnc_keyHandler.sqf | 12 +++++----- addons/hashes/fnc_hashSet.sqf | 4 ++-- addons/help/XEH_preClientInit.sqf | 2 +- addons/help/fnc_describe.sqf | 16 ++++++------- addons/help/ver_line.sqf | 2 +- addons/keybinding/gui/fnc_onKeyDown.sqf | 2 +- .../keybinding/gui/fnc_onKeyDownNextGen.sqf | 2 +- addons/network/fnc_setMarkerPersistent.sqf | 2 +- addons/versioning/XEH_preInit.sqf | 2 +- 24 files changed, 65 insertions(+), 64 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 90fed3638..df14d6d3c 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -96,7 +96,7 @@ if !(isDedicated) then { [GVAR(actionList), { TRACE_3("Inside the code for the hashPair",(vehicle player),GVAR(actionIndexes), _value); if (!isNil "_value" && typeName(_value) == "ARRAY") then { - PUSH(GVAR(actionIndexes), (vehicle player) addAction _value) + GVAR(actionIndexes) pushBack (vehicle player) addAction _value }; }] call CBA_fnc_hashEachPair; }; diff --git a/addons/common/fnc_createCenter.sqf b/addons/common/fnc_createCenter.sqf index 0e3957554..73a2130e1 100644 --- a/addons/common/fnc_createCenter.sqf +++ b/addons/common/fnc_createCenter.sqf @@ -22,4 +22,7 @@ Author: private ["_center"]; params ["_side"]; // TODO: Add _side if already a unit exists on this side ? by trying to create one or otherwise -if (_side in GVAR(centers)) then { _side } else { _center = createCenter _side; PUSH(GVAR(centers),_center); _center }; +if (_side in GVAR(centers)) then { _side } else { _center = createCenter _side; + GVAR(centers) pushBack _center; + _center +}; diff --git a/addons/common/fnc_getAlive.sqf b/addons/common/fnc_getAlive.sqf index f38dbcb33..1e480bd8e 100644 --- a/addons/common/fnc_getAlive.sqf +++ b/addons/common/fnc_getAlive.sqf @@ -40,7 +40,7 @@ switch (_typename) do { _return = []; { if (alive _x) then { - PUSH(_return,_x); + _return pushBack _x; } } foreach _array; _return diff --git a/addons/common/fnc_getFirer.sqf b/addons/common/fnc_getFirer.sqf index 1dd668f89..1c1dee826 100644 --- a/addons/common/fnc_getFirer.sqf +++ b/addons/common/fnc_getFirer.sqf @@ -42,7 +42,7 @@ for "_mti" from 0 to (_tc-1) do { _cfg = (__cfg select _mti); if (isClass _cfg) then { _entry = [_mtJ]; - PUSH(_tp, _entry); + _tp pushBack _entry; // Check SubTurrets _st = _cfg >> "turrets"; @@ -53,7 +53,7 @@ for "_mti" from 0 to (_tc-1) do { _stp = _st select _sti; if (isClass _stp) then { _entry = [_mtJ, _stJ]; - PUSH(_tp, _entry); + _tp pushBack _entry; INC(_stJ); }; diff --git a/addons/common/fnc_getGroupIndex.sqf b/addons/common/fnc_getGroupIndex.sqf index 78db4b5f6..7f9399ae8 100644 --- a/addons/common/fnc_getGroupIndex.sqf +++ b/addons/common/fnc_getGroupIndex.sqf @@ -42,7 +42,7 @@ _number = []; // Format of player label is ": " for "_i" from (_groupLabelLen + 1) to ((count _labelArray) - 1) do { if ((_labelArray select _i) == ASCII_SPACE) exitWith {}; - PUSH(_number,_labelArray select _i); + _number pushBack _labelArray select _i; }; // Go back to the original varName. diff --git a/addons/common/fnc_getTurret.sqf b/addons/common/fnc_getTurret.sqf index 3c49fe40b..c4a9bf590 100644 --- a/addons/common/fnc_getTurret.sqf +++ b/addons/common/fnc_getTurret.sqf @@ -36,7 +36,7 @@ if (count _tp > 0) then { _turs = []; for "_i" from 0 to (count _turrets) - 1 do { _y = _turrets select _i; - if (isClass(_y)) then { PUSH(_turs,_y) }; + if (isClass(_y)) then { _turs pushBack _y }; }; if ((count _turs)-1 >= _x) then { _path = (_turs select _x); diff --git a/addons/common/fnc_parseYAML.sqf b/addons/common/fnc_parseYAML.sqf index d076a28fd..299a854ef 100644 --- a/addons/common/fnc_parseYAML.sqf +++ b/addons/common/fnc_parseYAML.sqf @@ -48,10 +48,10 @@ _raiseError = _lastChar = _lastLine select ((count _lastLine) - 1); _lastLine resize ((count _lastLine) - 1); - PUSH(_lastLine,ASCII_VERTICAL_BAR); - PUSH(_lastLine,ASCII_HASH); - PUSH(_lastLine,ASCII_VERTICAL_BAR); - PUSH(_lastLine,_lastChar); + _lastLine pushBack ASCII_VERTICAL_BAR; + _lastLine pushBack ASCII_HASH; + _lastLine pushBack ASCII_VERTICAL_BAR; + _lastLine pushBack _lastChar; _pos = _pos + 1; while { _pos < (count _yaml) } do { @@ -59,7 +59,7 @@ _raiseError = if (_char in [ASCII_YAML_COMMENT, ASCII_CR, ASCII_NEWLINE]) exitWith {}; - PUSH(_lastLine,_char); + _lastLine pushBack _char; _pos = _pos + 1; }; @@ -114,9 +114,9 @@ _parse = if (_char in _lineBreaks) then { _currentIndent = 0; - PUSH(_lines,[]); + _lines pushBack []; } else { - PUSH(_lines select ((count _lines) - 1), _char); + _lines select ((count _lines) - 1) pushBack _char; }; switch (_mode) do @@ -142,11 +142,11 @@ _parse = if (not _error) then { //TRACE_1("Added Array element",_value); - PUSH(_data,_value); + _data pushBack _value; _mode = YAML_MODE_STRING; }; } else { - PUSH(_value,_char); + _value pushBack _char; }; }; case YAML_MODE_ASSOC_KEY: @@ -166,7 +166,7 @@ _parse = }; default { - PUSH(_key,_char); + _key pushBack _char; }; }; }; @@ -196,7 +196,7 @@ _parse = _mode = YAML_MODE_STRING; }; } else { - PUSH(_value,_char); + _value pushBack _char; }; }; case YAML_MODE_STRING: @@ -336,7 +336,7 @@ if (count _yaml > 0) then { if (not ((_yaml select ((count _yaml) - 1)) in _lineBreaks)) then { - PUSH(_yaml,ASCII_NEWLINE); + _yaml pushBack ASCII_NEWLINE; }; }; diff --git a/addons/common/init_addons.sqf b/addons/common/init_addons.sqf index a3f2ceaf8..e87197418 100644 --- a/addons/common/init_addons.sqf +++ b/addons/common/init_addons.sqf @@ -15,7 +15,7 @@ _addons = []; for "_i" from 0 to (_c - 1) do { _entry = _cfg select _i; if (isClass _entry) then { - PUSH(_addons,configName _entry); + _addons pushBack configName _entry; }; }; @@ -24,4 +24,3 @@ activateAddons _addons; TRACE_1("Activated",count _addons); CBA_common_addons = _addons; - diff --git a/addons/diagnostic/fnc_debug.sqf b/addons/diagnostic/fnc_debug.sqf index a0ddd3d51..a1b43d579 100644 --- a/addons/diagnostic/fnc_debug.sqf +++ b/addons/diagnostic/fnc_debug.sqf @@ -47,7 +47,7 @@ _ar2msg = { _orig = _this; _str = "["; }; - { PUSH(_ar,toArray _x) } forEach _orig; + { _ar pushBack toArray _x } forEach _orig; _msg = []; _total = 0; _i = 0; { @@ -58,14 +58,14 @@ _ar2msg = { if (_i > 0) then { _str = _str + ", " }; _str = _str + toString(_x); } else { - PUSH(_msg,_str); + _msg pushBack _str; _total = _c; _str = toString(_x); }; _i = _i + 1; } forEach _ar; _str = _str + "]"; - PUSH(_msg,_str); + _msg pushBack _str; _msg }; @@ -77,15 +77,15 @@ _str2msg = { { if (_i < 180) then { - PUSH(_nar,_x); + _nar pushBack _x; _i = _i + 1; } else { - PUSH(_msg,toString(_nar)); + _msg pushBack toString(_nar); _nar = [_x]; _i = 1; }; } forEach _ar; - if (count _nar > 0) then { PUSH(_msg,toString(_nar)) }; + if (count _nar > 0) then { _msg pushBack toString(_nar) }; _msg }; @@ -94,7 +94,7 @@ _format = { _msg = []; switch (typeName _this) do { - case "ARRAY": { { { PUSH(_msg,_x) } forEach (_x call _str2msg) } forEach _this }; + case "ARRAY": { { { _msg pushBack _x } forEach (_x call _str2msg) } forEach _this }; case "STRING": { _msg = _this call _str2msg }; default { _msg = format["%1", _this] call _str2msg }; }; @@ -123,10 +123,10 @@ if (_type select 2) exitWith _msgAr = []; switch (typeName _message) do { - case "ARRAY": { _msgAr = [format["%3 (%2) %1 -", _component, [time, "H:MM:SS.mmm"] call CBA_fnc_formatElapsedTime, [diag_tickTime, "H:MM:SS.mmm"] call CBA_fnc_formatElapsedTime]]; { PUSH(_msgAr,_x) } forEach (_message call _ar2msg) }; + case "ARRAY": { _msgAr = [format["%3 (%2) %1 -", _component, [time, "H:MM:SS.mmm"] call CBA_fnc_formatElapsedTime, [diag_tickTime, "H:MM:SS.mmm"] call CBA_fnc_formatElapsedTime]]; { _msgAr pushBack _x } forEach (_message call _ar2msg) }; default { _msgAr = (format["%4 (%3) %1 - %2", _component, _message, [time, "H:MM:SS.mmm"] call CBA_fnc_formatElapsedTime, [diag_tickTime, "H:MM:SS.mmm"] call CBA_fnc_formatElapsedTime] call _format) }; }; if (_type select 0) then { if (SLX_XEH_MACHINE select 0) then { { ADDON globalChat _x } forEach _msgAr } }; if (_type select 1) then { { if (_x != "") then { diag_log text _x } } forEach _msgAr }; -//PUSH(GVAR(debug),_msgAr); // TODO: Evaluate cleanup system? +//GVAR(debug) pushBack _msgAr; // TODO: Evaluate cleanup system? diff --git a/addons/diagnostic/fnc_log.sqf b/addons/diagnostic/fnc_log.sqf index b63247674..f1a593545 100644 --- a/addons/diagnostic/fnc_log.sqf +++ b/addons/diagnostic/fnc_log.sqf @@ -30,7 +30,7 @@ SCRIPT(log); if (isNil "CBA_LOG_ARRAY") then { CBA_LOG_ARRAY = [] }; private ["_msg"]; _msg = [_this select 0, _this select 1, _this select 2, diag_frameNo, diag_tickTime, time]; // Save it here because we want to know when it was happening, not when it is outputted - PUSH(CBA_LOG_ARRAY,_msg); + CBA_LOG_ARRAY pushBack _msg; if (isNil "CBA_LOG_VAR") then { diff --git a/addons/diagnostic/fnc_perf_loop.sqf b/addons/diagnostic/fnc_perf_loop.sqf index fb312ecd6..44e106581 100644 --- a/addons/diagnostic/fnc_perf_loop.sqf +++ b/addons/diagnostic/fnc_perf_loop.sqf @@ -14,7 +14,6 @@ // For usage outside CBA #define QUOTE(A) #A #define GVAR(A) my_##A - #define PUSH(A,B) A pushBack B */ // temp @@ -64,7 +63,7 @@ FUNC(lag2) = { _objects = []; for "_i" from 0 to 100 do { _logic = "LOGIC" createVehicleLocal [0, 0, 0]; - PUSH(_objects,_logic); + _objects pushBack _logic; }; }; @@ -122,7 +121,7 @@ SLX_XEH_STR spawn { waitUntil {time > _nextTime}; _ar = GVAR(ar); GVAR(ar) = []; _log = ["Current", DEFAULT_VALUES]; - PUSH(GVAR(logs),_log); + GVAR(logs) pushBack _log; { // TODO: Also compare the delta between the previous few entries? _a = _x select 0; _b = _x select 1; @@ -130,9 +129,9 @@ SLX_XEH_STR spawn { _deltaTime = (_b select 1) - (_a select 1); _log = ["Delta", _a, _b, _deltaTick, _deltaTime]; _do = false; - if (_deltaTime > _limit) then { _do = true; if (_deltaTime > _high) then { PUSH(_log,"WARNING: Large deltaTime"); PUSH(_log,_deltaTime) } }; - if (_deltaTick > _limit) then { _do = true; if (_deltaTick > _high) then { PUSH(_log,"WARNING: Large deltaTick"); PUSH(_log,_deltaTick) } }; - if (_do) then { PUSH(GVAR(logs),_log) }; + if (_deltaTime > _limit) then { _do = true; if (_deltaTime > _high) then { _log pushBack "WARNING: Large deltaTime"; _log pushBack _deltaTime } }; + if (_deltaTick > _limit) then { _do = true; if (_deltaTick > _high) then { _log pushBack "WARNING: Large deltaTick"; _log pushBack _deltaTick } }; + if (_do) then { GVAR(logs) pushBack _log }; } forEach _ar; if (GVAR(interactive)) then { // Output at each iteration @@ -154,7 +153,7 @@ while {GVAR(log)} do { sleep DELAY; [] call _create; _entry pushBack [DEFAULT_VALUES]; - PUSH(GVAR(ar),_entry); + GVAR(ar) pushBack _entry; }; GVAR(ar) = []; diff --git a/addons/events/fnc_addEventHandler.sqf b/addons/events/fnc_addEventHandler.sqf index b10c2a06e..0b9904c5c 100644 --- a/addons/events/fnc_addEventHandler.sqf +++ b/addons/events/fnc_addEventHandler.sqf @@ -33,7 +33,7 @@ if (isNil "_handlers") exitwith { 0; }; // Handlers already recorded, so add another one. -_handlerIndex = PUSH(_handlers,_handler); +_handlerIndex = _handlers pushBack _handler; TRACE_2("Added",_eventType,_handlerIndex); _handlerIndex; diff --git a/addons/events/fnc_addKeyHandler.sqf b/addons/events/fnc_addKeyHandler.sqf index 4d0fd74ba..af9315751 100644 --- a/addons/events/fnc_addKeyHandler.sqf +++ b/addons/events/fnc_addKeyHandler.sqf @@ -57,7 +57,7 @@ _handlers = [GVAR(keyhandler_hash), _type] call CBA_fnc_hashGet; if (_key > count _handlers) then {_handlers resize(_key + 1)}; _ar = _handlers select _key; if (isNil"_ar")then{_ar=[]}; -PUSH(_ar,_hashKey); +_ar pushBack _hashKey; _handlers set [_key, _ar]; _hashKey; diff --git a/addons/events/fnc_addLocalEventHandler.sqf b/addons/events/fnc_addLocalEventHandler.sqf index edaadebf2..ca6231377 100644 --- a/addons/events/fnc_addLocalEventHandler.sqf +++ b/addons/events/fnc_addLocalEventHandler.sqf @@ -34,7 +34,7 @@ if (isNil "_handlers") then { } else { // Handlers already recorded, so add another one. _handlerIndex = count _handlers; - PUSH(_handlers,_handler); + _handlers pushBack _handler; }; TRACE_2("Added",_eventType,_handlerIndex); diff --git a/addons/events/fnc_changeKeyHandler.sqf b/addons/events/fnc_changeKeyHandler.sqf index eb53af936..63cb5b80e 100644 --- a/addons/events/fnc_changeKeyHandler.sqf +++ b/addons/events/fnc_changeKeyHandler.sqf @@ -53,7 +53,7 @@ if (_exit) exitWith { false }; if(_key>(count _handlers))then{_handlers resize(_key+1);}; _ar = _handlers select _key; if(isNil"_ar")then{_ar=[]}; -PUSH(_ar,_hashKey); +_ar pushBack _hashKey; _handlers set [_key, _ar]; // Update keydata diff --git a/addons/events/fnc_keyHandler.sqf b/addons/events/fnc_keyHandler.sqf index 1c0826f66..f9cee6b3c 100644 --- a/addons/events/fnc_keyHandler.sqf +++ b/addons/events/fnc_keyHandler.sqf @@ -50,7 +50,7 @@ if(_type == "keydown") then { for "_i" from 0 to 2 do { if (((_settings select _i) && {!(_keyData select (_i + 2))}) || {(!(_settings select _i) && {(_keyData select (_i + 2))})}) exitWith { _valid = false } }; if (_valid) then { #ifdef DEBUG_MODE_FULL - PUSH(_ar,_code); + _ar pushBack _code; #endif _holdKey = _data select 3; @@ -123,10 +123,10 @@ if(_type == "keydown") then { for "_i" from 0 to 2 do { if (((_settings select _i) && {!(_keyData select (_i + 2))}) || {(!(_settings select _i) && {(_keyData select (_i + 2))})}) exitWith { _valid = false } }; if (_valid) then { #ifdef DEBUG_MODE_FULL - PUSH(_ar,_code); + _ar pushBack _code; #endif - PUSH(GVAR(keyUpDownList), _x); + GVAR(keyUpDownList) pushBack _x; }; }; } forEach _myHandlers; @@ -182,13 +182,13 @@ if(_type == "keydown") then { _result = false; }; }; - PUSH(_remHandlers, _x); + _remHandlers pushBack _x; // If any handler says that it has completely _handled_ the keypress, // then don't allow other handlers to be tried at all. - if (_result) then { PUSH(_ignoredUpKeys, _key); }; + if (_result) then { _ignoredUpKeys pushBack _key; }; }; } else { - PUSH(_remHandlers, _x); + _remHandlers pushBack _x; }; }; diff --git a/addons/hashes/fnc_hashSet.sqf b/addons/hashes/fnc_hashSet.sqf index 7dd310428..4f0c42f95 100644 --- a/addons/hashes/fnc_hashSet.sqf +++ b/addons/hashes/fnc_hashSet.sqf @@ -65,8 +65,8 @@ if (_index >= 0) then // Ignore values that are the same as the default. if (not _isDefault) then { - PUSH(_hash select HASH_KEYS,_key); - PUSH(_hash select HASH_VALUES,_value); + _hash select HASH_KEYS pushBack _key; + _hash select HASH_VALUES pushBack _value; }; }; TRACE_1("",_hash); diff --git a/addons/help/XEH_preClientInit.sqf b/addons/help/XEH_preClientInit.sqf index 234484c76..5dbbcadb4 100644 --- a/addons/help/XEH_preClientInit.sqf +++ b/addons/help/XEH_preClientInit.sqf @@ -31,7 +31,7 @@ FUNC(readConfig) = { FUNC(process) = { params ["_h1","_h2","_h3"]; _ar = []; - [_h1, {_entry = format["%1, v%2, (%3)
Author: %4", _key, [_h3, _key] call (uiNamespace getVariable "CBA_fnc_hashGet"), [_h2, _key] call (uiNamespace getVariable "CBA_fnc_hashGet"), _value joinString ", "]; PUSH(_ar,_entry) }] call (uiNamespace getVariable "CBA_fnc_hashEachPair"); + [_h1, {_entry = format["%1, v%2, (%3)
Author: %4", _key, [_h3, _key] call (uiNamespace getVariable "CBA_fnc_hashGet"), [_h2, _key] call (uiNamespace getVariable "CBA_fnc_hashGet"), _value joinString ", "]; _ar pushBack _entry }] call (uiNamespace getVariable "CBA_fnc_hashEachPair"); _ar joinString "

"; }; diff --git a/addons/help/fnc_describe.sqf b/addons/help/fnc_describe.sqf index ee6ff3158..04738ce5a 100644 --- a/addons/help/fnc_describe.sqf +++ b/addons/help/fnc_describe.sqf @@ -9,36 +9,36 @@ _ar = []; _type = typeOf _unit; _entry = ["Unit", format["%1", _type]]; -PUSH(_ar,_entry); +_ar pushBack _entry; if (vehicle _unit != _unit) then { _entry = ["Vehicle", format["%1", typeOf (vehicle _unit)]]; - PUSH(_ar,_entry); + _ar pushBack _entry; if (isArray(__cfgveh >> "author")) then { _entry = ["VehAuthor", format["%1", getArray(__cfgveh >> "author")]]; - PUSH(_ar,_entry); + _ar pushBack _entry; }; if (isText(__cfgveh >> "authorUrl")) then { _entry = ["VehAuthorUrl", format["%1", getText(__cfgveh >> "authorUrl")]]; - PUSH(_ar,_entry); + _ar pushBack _entry; }; }; _entry = ["Weapons", format["%1", weapons _unit]]; -PUSH(_ar,_entry); +_ar pushBack _entry; _entry = ["Magazines", format["%1", magazines _unit]]; -PUSH(_ar,_entry); +_ar pushBack _entry; if (isArray(__cfg >> "author")) then { _entry = ["Author", format["%1", getArray(__cfg >> "author")]]; - PUSH(_ar,_entry); + _ar pushBack _entry; }; if (isText(__cfg >> "authorUrl")) then { _entry = ["AuthorUrl", format["%1", getText(__cfg >> "authorUrl")]]; - PUSH(_ar,_entry); + _ar pushBack _entry; }; _ar; diff --git a/addons/help/ver_line.sqf b/addons/help/ver_line.sqf index 15cd2cc3f..e8ed79eef 100644 --- a/addons/help/ver_line.sqf +++ b/addons/help/ver_line.sqf @@ -38,7 +38,7 @@ if ( isNil {uiNamespace getVariable QGVAR(VerList)} ) then { _ver_line = getText(_entry >> "versionDesc") + " v" + getText(_entry >> "version"); _ver_act = getText(_entry >> "versionAct"); _ver_arr = [_ver_line, _ver_act]; - PUSH(_ver_list,_ver_arr); + _ver_list pushBack _ver_arr; }; }; }; diff --git a/addons/keybinding/gui/fnc_onKeyDown.sqf b/addons/keybinding/gui/fnc_onKeyDown.sqf index fa57e761e..05a15d539 100644 --- a/addons/keybinding/gui/fnc_onKeyDown.sqf +++ b/addons/keybinding/gui/fnc_onKeyDown.sqf @@ -18,7 +18,7 @@ if (GVAR(waitingForInput)) then { TRACE_4("KEY DOWN: 1st Key Before",GVAR(firstKey),GVAR(secondKey),GVAR(thirdKey), GVAR(input)); GVAR(firstKey) = []; if(!(_dikCode in GVAR(firstKey))) then { - PUSH(GVAR(firstKey), _dikCode); + GVAR(firstKey) pushBack _dikCode; }; _shift = false; _ctrl = false; diff --git a/addons/keybinding/gui/fnc_onKeyDownNextGen.sqf b/addons/keybinding/gui/fnc_onKeyDownNextGen.sqf index a8b84cc5b..267c9adfe 100644 --- a/addons/keybinding/gui/fnc_onKeyDownNextGen.sqf +++ b/addons/keybinding/gui/fnc_onKeyDownNextGen.sqf @@ -20,7 +20,7 @@ if (GVAR(waitingForInput)) then { TRACE_4("KEY DOWN: 1st Key Before",GVAR(firstKey),GVAR(secondKey),GVAR(thirdKey), GVAR(input)); GVAR(firstKey) = []; if(!(_dikCode in GVAR(firstKey))) then { - PUSH(GVAR(firstKey), _dikCode); + GVAR(firstKey) pushBack _dikCode; }; _shift = false; _ctrl = false; diff --git a/addons/network/fnc_setMarkerPersistent.sqf b/addons/network/fnc_setMarkerPersistent.sqf index 7242bf251..1a7b1d3cf 100644 --- a/addons/network/fnc_setMarkerPersistent.sqf +++ b/addons/network/fnc_setMarkerPersistent.sqf @@ -47,7 +47,7 @@ _return = if (SLX_XEH_MACHINE select 3) then { WARNING("Marker already persistent: " + str _marker); } else { - PUSH(GVAR(MARKERS),_markerConsistent); + GVAR(MARKERS) pushBack _markerConsistent; }; } else { if (_markerConsistent in GVAR(MARKERS)) then diff --git a/addons/versioning/XEH_preInit.sqf b/addons/versioning/XEH_preInit.sqf index 67202a5f2..8e93c08fc 100644 --- a/addons/versioning/XEH_preInit.sqf +++ b/addons/versioning/XEH_preInit.sqf @@ -34,7 +34,7 @@ for "_i" from 0 to (count (CFGSETTINGS) - 1) do for "_j" from 0 to ((count _deps) - 1) do { _entry = _deps select _j; if (isArray(_entry)) then { - PUSH(_dependencies,[DATA]); + _dependencies pushBack [DATA]; }; }; [GVAR(dependencies), toLower(configName _prefix), _dependencies] call (uiNamespace getVariable "CBA_fnc_hashSet"); From 48c9d3516b91e0fa25a67a33919718af41e62e77 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 12 Feb 2016 00:00:10 +0100 Subject: [PATCH 2/2] fix issue from regex --- addons/common/XEH_postInit.sqf | 2 +- addons/common/fnc_getGroupIndex.sqf | 2 +- addons/common/fnc_getTurret.sqf | 2 +- addons/common/fnc_parseYAML.sqf | 2 +- addons/common/init_addons.sqf | 2 +- addons/diagnostic/fnc_debug.sqf | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index df14d6d3c..06d4bc9c0 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -96,7 +96,7 @@ if !(isDedicated) then { [GVAR(actionList), { TRACE_3("Inside the code for the hashPair",(vehicle player),GVAR(actionIndexes), _value); if (!isNil "_value" && typeName(_value) == "ARRAY") then { - GVAR(actionIndexes) pushBack (vehicle player) addAction _value + GVAR(actionIndexes) pushBack ((vehicle player) addAction _value); }; }] call CBA_fnc_hashEachPair; }; diff --git a/addons/common/fnc_getGroupIndex.sqf b/addons/common/fnc_getGroupIndex.sqf index 7f9399ae8..19d1c2281 100644 --- a/addons/common/fnc_getGroupIndex.sqf +++ b/addons/common/fnc_getGroupIndex.sqf @@ -42,7 +42,7 @@ _number = []; // Format of player label is ": " for "_i" from (_groupLabelLen + 1) to ((count _labelArray) - 1) do { if ((_labelArray select _i) == ASCII_SPACE) exitWith {}; - _number pushBack _labelArray select _i; + _number pushBack (_labelArray select _i); }; // Go back to the original varName. diff --git a/addons/common/fnc_getTurret.sqf b/addons/common/fnc_getTurret.sqf index c4a9bf590..b58ac547e 100644 --- a/addons/common/fnc_getTurret.sqf +++ b/addons/common/fnc_getTurret.sqf @@ -36,7 +36,7 @@ if (count _tp > 0) then { _turs = []; for "_i" from 0 to (count _turrets) - 1 do { _y = _turrets select _i; - if (isClass(_y)) then { _turs pushBack _y }; + if (isClass(_y)) then { _turs pushBack _y; }; }; if ((count _turs)-1 >= _x) then { _path = (_turs select _x); diff --git a/addons/common/fnc_parseYAML.sqf b/addons/common/fnc_parseYAML.sqf index 299a854ef..bd69ee20a 100644 --- a/addons/common/fnc_parseYAML.sqf +++ b/addons/common/fnc_parseYAML.sqf @@ -116,7 +116,7 @@ _parse = _currentIndent = 0; _lines pushBack []; } else { - _lines select ((count _lines) - 1) pushBack _char; + (_lines select ((count _lines) - 1)) pushBack _char; }; switch (_mode) do diff --git a/addons/common/init_addons.sqf b/addons/common/init_addons.sqf index e87197418..260050af0 100644 --- a/addons/common/init_addons.sqf +++ b/addons/common/init_addons.sqf @@ -15,7 +15,7 @@ _addons = []; for "_i" from 0 to (_c - 1) do { _entry = _cfg select _i; if (isClass _entry) then { - _addons pushBack configName _entry; + _addons pushBack (configName _entry); }; }; diff --git a/addons/diagnostic/fnc_debug.sqf b/addons/diagnostic/fnc_debug.sqf index a1b43d579..65719cccb 100644 --- a/addons/diagnostic/fnc_debug.sqf +++ b/addons/diagnostic/fnc_debug.sqf @@ -47,7 +47,7 @@ _ar2msg = { _orig = _this; _str = "["; }; - { _ar pushBack toArray _x } forEach _orig; + { _ar pushBack (toArray _x) } forEach _orig; _msg = []; _total = 0; _i = 0; { @@ -80,12 +80,12 @@ _str2msg = { _nar pushBack _x; _i = _i + 1; } else { - _msg pushBack toString(_nar); + _msg pushBack (toString(_nar)); _nar = [_x]; _i = 1; }; } forEach _ar; - if (count _nar > 0) then { _msg pushBack toString(_nar) }; + if (count _nar > 0) then { _msg pushBack (toString(_nar)) }; _msg };