Skip to content

ofxAccelerometer: memset instead of bzero - #8595

Open
danoli3 wants to merge 1 commit into
openframeworks:masterfrom
danoli3:ofxAccelerometer-memset
Open

danoli3 wants to merge 1 commit into
openframeworks:masterfrom
danoli3:ofxAccelerometer-memset

Conversation

@danoli3

@danoli3 danoli3 commented Oct 21, 2026

Copy link
Copy Markdown
Member

ofxAccelerometer.h clears its rotation matrix with bzero, which is POSIX-only and doesn't exist with MSVC. This switches it to memset(matrix, 0, sizeof(matrix)) and includes <cstring>. The behaviour is the same on every platform.

The change is @HerrNamenlos123's, from the CMake PR #7524 (still open, so it's split out here on its own). The commit is authored by them.

Checked: ofxAccelerometer.h compiles (clang++ -std=c++20 -fsyntax-only) with a small file that calls ofxAccelerometer.setup().

bzero is POSIX-only and isn't available with MSVC. memset (from <cstring>)
clears the matrix the same way on every platform.

From openframeworks#7524.

Co-authored-by: Dan Rosser <danoli3@gmail.com>
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