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

silence sprintf deprecated warnings and enable imwri in macos build #11

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
CXX: clang++

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Print compiler version
run: ${{ env.CC }} --version

- name: Install autotools
run: |
brew update
brew install automake autoconf libtool pkg-config
brew install automake autoconf libtool pkg-config llvm

- name: Install zimg
run: |
Expand All @@ -33,7 +33,7 @@ jobs:
rm -rf zimg

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# Version range or exact version of a Python version to use, using SemVer's version range syntax.
python-version: 3.9
Expand All @@ -48,12 +48,10 @@ jobs:

- name: configure
run: |
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
./autogen.sh
# somehow newer macOS imagemagick requires -fopenmp to build?
./configure --disable-imwri

- name: make
run: make -j3
./configure

- name: make install
run: |
Expand All @@ -62,3 +60,5 @@ jobs:

- name: Run test
run: python -m unittest discover -s test -p "*test.py"


4 changes: 2 additions & 2 deletions src/core/vscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ const vs3::VSVideoFormat *VSCore::queryVideoFormat3(vs3::VSColorFamily colorFami
if (sampleType == stFloat)
strcpy(suffix, (bitsPerSample == 32) ? "S" : "H");
else
sprintf(suffix, "%d", (colorFamily == vs3::cmRGB ? 3:1) * bitsPerSample);
snprintf(suffix, sizeof(suffix), "%d", (colorFamily == vs3::cmRGB ? 3 : 1) * bitsPerSample);

const char *yuvName = nullptr;

Expand Down Expand Up @@ -1853,7 +1853,7 @@ bool VSCore::getVideoFormatName(const VSVideoFormat &format, char *buffer) noexc
if (format.sampleType == stFloat)
strcpy(suffix, (format.bitsPerSample == 32) ? "S" : "H");
else
sprintf(suffix, "%d", (format.colorFamily == cfRGB ? 3:1) * format.bitsPerSample);
snprintf(suffix, sizeof(suffix), "%d", (format.colorFamily == cfRGB ? 3 : 1) * format.bitsPerSample);

const char *yuvName = nullptr;

Expand Down
Loading