Skip to content

Commit

Permalink
Fix HEMTT warnings (#96)
Browse files Browse the repository at this point in the history
* Remove ASC config

* Fix padding a macro warning

* Optimize if
  • Loading branch information
Timi007 authored Mar 3, 2024
1 parent 3a95b4b commit d481fe4
Show file tree
Hide file tree
Showing 35 changed files with 62 additions and 70 deletions.
8 changes: 0 additions & 8 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ authority = "mts_markers"
path = "addons/markers/script_version.hpp"
git_hash = 0

[asc]
enabled = true
exclude = [
"/initsettings.sqf",
"/initkeybinds.sqf",
"/xeh_prep.sqf",
]

[hemtt.config]
preset = "Hemtt"

Expand Down
2 changes: 1 addition & 1 deletion addons/markers/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ADDON = true;

// Print version to rpt log
private _version = getText (configFile >> "CfgPatches" >> "mts_markers" >> "versionStr");
INFO_1("Metis Marker version: %1.", _version);
INFO_1("Metis Marker version: %1.",_version);

//create namespace
if (isServer || (!isMultiplayer)) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_convertCreateMarkerParams.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ if (_frameshape isEqualType "") then {
_markerParameter set [0, [_frameshape, _dashedFrameshape, false]];
};

TRACE_2("Converted createMarker params", _params, _createMarkerParams);
TRACE_2("Converted createMarker params",_params,_createMarkerParams);

_params
4 changes: 2 additions & 2 deletions addons/markers/functions/fnc_copyMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
*/

params [["_mapCtrl", controlNull, [controlNull]]];
CHECKRET(isNull _mapCtrl, false);
CHECKRET(isNull _mapCtrl,false);

private _namePrefix = [_mapCtrl, true] call FUNC(getMouseOverMarkerPrefix);
CHECKRET(_namePrefix isEqualTo "", false);
CHECKRET(_namePrefix isEqualTo "",false);

private _scale = [_namePrefix] call FUNC(getMarkerScale);
private _alpha = [_namePrefix] call FUNC(getMarkerAlpha);
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_createMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ params [
["_alpha", MARKER_ALPHA, [0]]
];

CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)), ERROR("Channel ID not supported"));
CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)),ERROR("Channel ID not supported"));

//get player UID
private _playerUID = getPlayerUID player;
Expand Down
28 changes: 14 additions & 14 deletions addons/markers/functions/fnc_createMarkerLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ _markerParameter params [
_size params [["_grpsize", 0, [0]], ["_reinforced", false, [false]], ["_reduced", false, [false]]];

CHECK(!hasInterface);
CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET((_frameshape select 0) isEqualTo "", ERROR("No frameshape or wrong format. Expected format: [STRING, BOOLEAN, BOOLEAN]"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));
CHECKRET((_frameshape select 0) isEqualTo "",ERROR("No frameshape or wrong format. Expected format: [STRING, BOOLEAN, BOOLEAN]"));

_frameshape params [["_identity", "", [""]], ["_dashedFrameshape", false, [false]], ["_isHq", false, [false]]];
_identity = toLower _identity;
Expand All @@ -85,14 +85,14 @@ if (_alpha < 0 || _alpha > 1) then {
};

if !(_identity in ["blu", "red", "neu", "unk"]) exitWith {
ERROR_1("Unknown Identity %1", _identity);
ERROR_1("Unknown Identity %1",_identity);
};

CHECKRET(_operationalCondition < 0 || _operationalCondition > 2, ERROR("Operational condition must be a number between 0 and 2."));
CHECKRET(_operationalCondition < 0 || _operationalCondition > 2,ERROR("Operational condition must be a number between 0 and 2."));

_direction = toUpper _direction;
if (_direction isNotEqualTo "" && {!(_direction in GVAR(directions))}) exitWith {
ERROR_2("Unknown direction of movement %1. Allowed values: %2", _direction, GVAR(directions) joinString ", ");
ERROR_2("Unknown direction of movement %1. Allowed values: %2",_direction,GVAR(directions) joinString ", ");
};

//create frameshape marker
Expand Down Expand Up @@ -121,7 +121,7 @@ private _frameshapeColor = if (GVAR(useVanillaColors)) then {
} else {
format ["mts_%1_color", _identity]
};
CHECKRET(_frameshapeColor isEqualTo "", ERROR_1("Could not get corresponding vanilla color for identity %1.", _identity));
CHECKRET(_frameshapeColor isEqualTo "",ERROR_1("Could not get corresponding vanilla color for identity %1.",_identity));

_markerFrame setMarkerColorLocal _frameshapeColor;

Expand All @@ -139,7 +139,7 @@ if (_direction isEqualTo "" && _isHq) then {

// Direction of Movement Arrow
if (_direction isNotEqualTo "") then {
private _mod = if (_isHq) then { "dir_hq" } else { "dir" };
private _mod = ["dir", "dir_hq"] select _isHq;
private _markerName = format ["%1_%2_%3", _namePrefix, _mod, _direction];
private _markerType = format ["mts_%1_%2_%3", _identity, _mod, _direction];

Expand Down Expand Up @@ -204,14 +204,14 @@ if (_additionalInfo isNotEqualTo "") then {

// create text marker (bottom left of marker)
if ((count _uniqueDesignation) > 0) then {
TRACE_1("uniqueDesignation input", _uniqueDesignation);
TRACE_1("uniqueDesignation input",_uniqueDesignation);
scopeName "textLeftCreation";

//only take the first three characters of the left text
if ((count _uniqueDesignation) > UNIQUE_DESIGNATION_MAX_CHARS) then {
_uniqueDesignation resize UNIQUE_DESIGNATION_MAX_CHARS;
};


//check if all characters are valid & make all characters uppercase
{
_x = toUpper _x;
Expand All @@ -231,7 +231,7 @@ if ((count _uniqueDesignation) > 0) then {
private _letter = _uniqueDesignation select _numIndex;

([_namePrefix, "uniqueDesignation", _letterPos, _letter] call FUNC(getCharMarkerType)) params ["_letterType", "_markerName"];
TRACE_3("uniqueDesignation", _letter, _letterType, _markerName);
TRACE_3("uniqueDesignation",_letter,_letterType,_markerName);

private _markerUniqueDesignation = createMarkerLocal [_markerName, _pos];
_markerUniqueDesignation setMarkerTypeLocal _letterType;
Expand All @@ -246,9 +246,9 @@ if ((count _uniqueDesignation) > 0) then {

// create text marker (bottom right of marker)
if ((count _higherFormation) > 0) then {
TRACE_1("higherFormation input", _higherFormation);

TRACE_1("higherFormation input",_higherFormation);
scopeName "textRightCreation";

//only take the first n characters of the left text
if ((count _higherFormation) > HIGHER_FORMATION_MAX_CHARS) then {
_higherFormation resize HIGHER_FORMATION_MAX_CHARS;
Expand All @@ -270,7 +270,7 @@ if ((count _higherFormation) > 0) then {
private _letter = _x;

([_namePrefix, "higherFormation", _forEachIndex, _letter] call FUNC(getCharMarkerType)) params ["_letterType", "_markerName"];
TRACE_3("higherFormation", _letter, _letterType, _markerName);
TRACE_3("higherFormation",_letter,_letterType,_markerName);

private _markerHigherFormation = createMarkerLocal [_markerName, _pos];
_markerHigherFormation setMarkerTypeLocal _letterType;
Expand Down Expand Up @@ -304,7 +304,7 @@ if ((count _dateTimeGroup) > 0) then {
// Returns array in format [D, D, H, H, M, M, Z, mmm, Y, Y].
private _dtgCharacters = _dateTimeGroup call FUNC(toDTGCharaters);

CHECKRET(_dtgCharacters isEqualTo [], WARNING_1("Date-Time Group is invalid. Will not create DTG markers. DTG: %1", _dateTimeGroup));
CHECKRET(_dtgCharacters isEqualTo [],WARNING_1("Date-Time Group is invalid. Will not create DTG markers. DTG: %1",_dateTimeGroup));

// Iterate reversed because char pos starts closest to frameshape, meaning with the year.
// DDHHMMZmmmYY ┌───────┐
Expand Down
4 changes: 2 additions & 2 deletions addons/markers/functions/fnc_deleteMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

params [["_namePrefix", "", [""]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"); false);
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"); false);

//get channel ID from marker prefix
private _broadcastChannel = [_namePrefix] call FUNC(getBroadcastChannel);

CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)), ERROR("Invalid marker prefix. No MTS marker"); false);
CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)),ERROR("Invalid marker prefix. No MTS marker"); false);

//broadcast marker depending on channel ID
[_namePrefix] remoteExecCall [QFUNC(deleteMarkerLocal), ([_broadcastChannel] call FUNC(getBroadcastTargets)), true];
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_deleteMarkerLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

params [["_namePrefix", "", [""]]];
CHECK(!hasInterface);
CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

//get marker set
private _markerFamily = [_namePrefix] call FUNC(getMarkerFamily);
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_generateUniquePrefix.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
params [["_editable", true, [true]], ["_broadcastChannel", -1, [0]], ["_playerUID", "0", [""]]];
private ["_namePrefix"];

CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)), ERROR("Channel ID not supported"));
CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)),ERROR("Channel ID not supported"));

//generate unique marker name & return
private _uniqueName = false;
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getBroadcastChannel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

params [["_namePrefix", "", [""]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

switch ([_namePrefix] call FUNC(isMtsMarker)) do {
case 1: {
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getMarkerAlpha.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

params [["_namePrefix", "", [""]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

(markerAlpha format ["%1_frame", _namePrefix])
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getMarkerConfig.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@

params [["_namePrefix", "", [""]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

(GVAR(namespace) getVariable [_namePrefix, []]) param [1, []]
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getMarkerFamily.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

params [["_namePrefix", "", [""]]];
CHECKRET(_namePrefix isEqualTo "", []);
CHECKRET(_namePrefix isEqualTo "",[]);

private _markerInformation = GVAR(namespace) getVariable [_namePrefix, [[]]];

Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getMarkerPos.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@

params [["_namePrefix", "", [""]], ["_preserveElevation", false, [false]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

getMarkerPos [format["%1_frame", _namePrefix], _preserveElevation]
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getMarkerScale.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

params [["_namePrefix", "", [""]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

(getMarkerSize format ["%1_frame", _namePrefix]) select 0
6 changes: 3 additions & 3 deletions addons/markers/functions/fnc_getMouseOverMarkerPrefix.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*/

params [["_mapCtrl", controlNull, [controlNull]], ["_includeNoEditMarker", false, [false]]];
CHECKRET(isNull _mapCtrl, "");
CHECKRET(isNull _mapCtrl,"");

private _mouseOverMarker = ctrlMapMouseOver _mapCtrl;
private _type = _mouseOverMarker param [0, ""];
CHECKRET(_type isNotEqualTo "marker", "");
CHECKRET(_type isNotEqualTo "marker","");
private _markerName = _mouseOverMarker select 1;

private _isMtsMarker = [_markerName] call FUNC(isMtsMarker);
CHECKRET(_isMtsMarker isEqualTo 0, "");
CHECKRET(_isMtsMarker isEqualTo 0,"");

if (_isMtsMarker isEqualTo 1 || _includeNoEditMarker) exitWith {
(_markerName splitString "_") select 0
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getPlayerUID.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

params [["_namePrefix", "", [""]]];

CHECKRET([_namePrefix] call FUNC(isMtsMarker) isNotEqualTo 1, QUOTE(-1));
CHECKRET([_namePrefix] call FUNC(isMtsMarker) isNotEqualTo 1,"-1");

(_namePrefix splitString "/") param [1, "-1"]

2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getTimeZone.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

params [["_time", [], [[]], [2, 7]], ["_timeUtc", [], [[]], [2, 7]]];

CHECKRET((_time isEqualTo []) || (_timeUtc isEqualTo []), []);
CHECKRET((_time isEqualTo []) || (_timeUtc isEqualTo []),[]);

// time is passed from systemTime command
if ((count _time) isEqualTo 7) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getTimeZoneIdentifier.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
params [["_time", [], [[]]], ["_timeUtc", [], [[]]]];

private _timeZone = [_time, _timeUtc] call FUNC(getTimeZone); // _timeDiffH hour is in range -12..+12
CHECKRET(_timeZone isEqualTo [], "");
CHECKRET(_timeZone isEqualTo [],"");

// Simplify time zones according to ATP 6-02.70 Appendix E
// Do not consider the minutes
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_getUIData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private _mainDisplay = findDisplay MAIN_DISPLAY;

//get identity
private _identity = (_mainDisplay displayCtrl FRIENDLY_BTN_FRAME) getVariable [QGVAR(currentIdentitySelected), ""];
CHECKRET(_identity isEqualTo "", ERROR("No identity"));
CHECKRET(_identity isEqualTo "",ERROR("No identity"));

// Check if frameshape is dashed or HQ
private _dashedFrameshape = cbChecked (_mainDisplay displayCtrl SUSPECT_CHECKBOX);
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_initializeDTGUI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ params [["_parentDisplay", displayNull, [displayNull]]];

// Open Date-Time Group configuration
private _dtgDisplay = _parentDisplay createDisplay QGVAR(DTGDialog);
CHECKRET(isNull _dtgDisplay, ERROR("Failed to create DTG dialog"));
CHECKRET(isNull _dtgDisplay,ERROR("Failed to create DTG dialog"));

private _dateYearCtrl = _dtgDisplay displayCtrl DTG_YEAR_DROPDOWN;
private _dateMonthCtrl = _dtgDisplay displayCtrl DTG_MONTH_DROPDOWN;
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_initializeUI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params [["_curMapDisplay", displayNull, [displayNull]], ["_mousePos", [0,0], [[]

//Open interface
private _displayCheck = _curMapDisplay createDisplay QGVAR(Dialog);
CHECKRET(isNull _displayCheck, ERROR("Failed to create dialog"));
CHECKRET(isNull _displayCheck,ERROR("Failed to create dialog"));

private _mainDisplay = findDisplay MAIN_DISPLAY;
private _mapCtrl = _curMapDisplay displayCtrl MAP_CTRL;
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_isMtsMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

params [["_markerName", "", [""]]];
CHECKRET(_markerName isEqualTo "", 0);
CHECKRET(_markerName isEqualTo "",0);

private _markerNamePrefix = toLower (_markerName select [0, 9]);

Expand Down
6 changes: 3 additions & 3 deletions addons/markers/functions/fnc_moveMarkerMouseDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*/

params [["_mapCtrl", controlNull, [controlNull]], ["_includeNoEditMarker", false, [false]]];
CHECKRET(isNull _mapCtrl, false);
CHECKRET(isNull _mapCtrl,false);

//get marker prefix
private _namePrefix = [_mapCtrl, _includeNoEditMarker] call FUNC(getMouseOverMarkerPrefix);
CHECKRET(_namePrefix isEqualTo "", false);
CHECKRET(_namePrefix isEqualTo "",false);

//get marker set
private _markerFamily = [_namePrefix] call FUNC(getMarkerFamily);
CHECKRET(_markerFamily isEqualTo [], false);
CHECKRET(_markerFamily isEqualTo [],false);

private _originAlpha = markerAlpha (_markerFamily select 0);

Expand Down
4 changes: 2 additions & 2 deletions addons/markers/functions/fnc_pasteMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

private _params = params [["_mapCtrl", controlNull, [controlNull]], ["_mousepos", [0,0], [[]], [2]]];

CHECKRET((GVAR(clipboard) isEqualTo "" || !_params), false);
CHECKRET((GVAR(clipboard) isEqualTo "" || !_params),false);

GVAR(clipboard) params ["_namePrefix", "_scale", "_alpha"];

private _markerInformation = GVAR(namespace) getVariable [_namePrefix, []];
CHECKRET(_markerInformation isEqualTo [], false);
CHECKRET(_markerInformation isEqualTo [],false);

_markerInformation params ["", "_markerParameter"];

Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_savePreset.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private _mainDisplay = findDisplay MAIN_DISPLAY;

//get the name of the Preset
private _presetName = ctrlText (_mainDisplay displayCtrl NAME_PRESETS_EDIT);
CHECKRET(_presetName isEqualTo "", hint LLSTRING(ui_hint_marker_name_empty));
CHECKRET(_presetName isEqualTo "",hint LLSTRING(ui_hint_marker_name_empty));

//get all marker data for the Preset
private _UIData = call FUNC(getUIData);
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_setDTGUIData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

params [["_date", [], [[]], [5, 6, 7]], ["_timeZone", "J", [""]], ["_displayShort", nil, [false]]];
TRACE_1("params", _this);
TRACE_1("params",_this);

CHECK(_date isEqualTo []);

Expand Down
4 changes: 2 additions & 2 deletions addons/markers/functions/fnc_setMarkerAlpha.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

params [["_namePrefix", "", [""]], ["_alpha", MARKER_ALPHA, [0]]];

CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

// Get channel ID from marker prefix
private _broadcastChannel = [_namePrefix] call FUNC(getBroadcastChannel);

CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)), ERROR("Invalid marker prefix. No MTS marker"));
CHECKRET(((_broadcastChannel > 5) || (_broadcastChannel < -1)),ERROR("Invalid marker prefix. No MTS marker"));

// Broadcast marker depending on channel ID
[_namePrefix, _alpha] remoteExecCall [QFUNC(setMarkerAlphaLocal), ([_broadcastChannel] call FUNC(getBroadcastTargets)), true];
Expand Down
2 changes: 1 addition & 1 deletion addons/markers/functions/fnc_setMarkerAlphaLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
params [["_namePrefix", "", [""]], ["_alpha", MARKER_ALPHA, [0]]];

CHECK(!hasInterface);
CHECKRET(_namePrefix isEqualTo "", ERROR("No marker prefix"));
CHECKRET(_namePrefix isEqualTo "",ERROR("No marker prefix"));

// Get marker set
private _markerFamily = [_namePrefix] call FUNC(getMarkerFamily);
Expand Down
Loading

0 comments on commit d481fe4

Please sign in to comment.