Skip to content

Commit

Permalink
silence sprintf deprecated warnings and enable imwri in macos build (#11
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yuygfgg authored Oct 9, 2024
1 parent b5578e6 commit 6ecb1a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 6ecb1a2

Please sign in to comment.