Skip to content

Add Bitwise Functions#1724

Merged
PabstMirror merged 12 commits intoCBATeam:masterfrom
Anderanged:bitwise
Feb 23, 2025
Merged

Add Bitwise Functions#1724
PabstMirror merged 12 commits intoCBATeam:masterfrom
Anderanged:bitwise

Conversation

@Anderanged
Copy link
Copy Markdown
Contributor

When merged this pull request will:

  • Add functions for NOT, AND, OR, XOR, LEFT-SHIFT, RIGHT-SHIFT, LEFT-ROTATE-NO-CARRY, and RIGHT-ROTATE-NO-CARRY bitwise operations.
  • Add Check, CheckBool, Flip, Set, and Unset bitflag functions utilizing the above.
  • Add a binary logarithm function logBase2.
  • Respect the Submitting Content Guidelines

Provides greater functionality and better performance than the functions from Killzone_Kid.

The four basic bitwise functions (NOT, AND, OR, XOR) may need readability or clarification improvements (despite my efforts). I would be pleased to make any suggested changes in that regard. The same sentiment towards my commenting.

@Anderanged Anderanged changed the title Bitwise Bitwise Functions Dec 22, 2024
@rekterakathom
Copy link
Copy Markdown

This does not build on HEMTT 1.14.2.

error[L-S23]: Reassigning reserved variable `_this`
   ┌─ addons/bitwise/fnc_bitwiseOR.sqf:33:1
   │
33 │ _this = _this apply {floor abs _x};
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `_this` is reserved


error[L-S23]: Reassigning reserved variable `_this`
   ┌─ addons/bitwise/fnc_bitwiseXOR.sqf:34:1
   │
34 │ _this = _this apply {floor abs _x};
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `_this` is reserved


error[L-S23]: Reassigning reserved variable `_this`
   ┌─ addons/bitwise/fnc_bitwiseAND.sqf:33:1
   │
33 │ _this = _this apply {floor abs _x};
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `_this` is reserved

@Anderanged
Copy link
Copy Markdown
Contributor Author

Huh. Built fine on my end. Will fix in 2 hrs, thanks!!!

@Anderanged
Copy link
Copy Markdown
Contributor Author

This does not build on HEMTT 1.14.2.

error[L-S23]: Reassigning reserved variable `_this`
   ┌─ addons/bitwise/fnc_bitwiseOR.sqf:33:1
   │
33 │ _this = _this apply {floor abs _x};
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `_this` is reserved


error[L-S23]: Reassigning reserved variable `_this`
   ┌─ addons/bitwise/fnc_bitwiseXOR.sqf:34:1
   │
34 │ _this = _this apply {floor abs _x};
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `_this` is reserved


error[L-S23]: Reassigning reserved variable `_this`
   ┌─ addons/bitwise/fnc_bitwiseAND.sqf:33:1
   │
33 │ _this = _this apply {floor abs _x};
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `_this` is reserved

These should all be fixed. Checked with HEMTT v1.14.2. Thanks for the heads up!

@Anderanged Anderanged changed the title Bitwise Functions Add Bitwise Functions Jan 23, 2025
@PabstMirror PabstMirror added this to the 3.18.2 milestone Feb 14, 2025
@PabstMirror PabstMirror merged commit 491fff9 into CBATeam:master Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants