Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitwise Functions #1724

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Bitwise Functions #1724

wants to merge 12 commits into from

Conversation

Anderanged
Copy link

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

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
Author

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

@Anderanged
Copy link
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants