FreeBSD Bugzilla – Attachment 183948 Details for
Bug 220389
devel/sdl2pp: Fix warnings with clang 5.0.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix clang 5.0.0 warnings in devel/sdl2pp
devel__sdl2pp-fix-warnings-1.diff (text/plain), 1.53 KB, created by
Dimitry Andric
on 2017-06-30 17:33:38 UTC
(
hide
)
Description:
Fix clang 5.0.0 warnings in devel/sdl2pp
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2017-06-30 17:33:38 UTC
Size:
1.53 KB
patch
obsolete
>Index: devel/sdl2pp/files/patch-examples_audio__sine.cc >=================================================================== >--- devel/sdl2pp/files/patch-examples_audio__sine.cc (nonexistent) >+++ devel/sdl2pp/files/patch-examples_audio__sine.cc (working copy) >@@ -0,0 +1,21 @@ >+--- examples/audio_sine.cc.orig 2017-06-28 19:39:10 UTC >++++ examples/audio_sine.cc >+@@ -33,15 +33,15 @@ using namespace SDL2pp; >+ int main(int, char*[]) try { >+ SDL sdl(SDL_INIT_AUDIO); >+ >+- const int samplerate = 48000; >+- float frequency = 2093.00f; // C7 tone >++ constexpr int samplerate = 48000; >++ constexpr float frequency = 2093.00f; // C7 tone >+ int64_t nsample = 0; >+ >+ // Setup audio device, and provide callback which plays sine wave with specified frequency >+ AudioSpec spec(samplerate, AUDIO_S16SYS, 1, 4096); >+ >+ // Open audio device >+- AudioDevice dev(NullOpt, 0, spec, [&nsample, frequency, samplerate](Uint8* stream, int len) { >++ AudioDevice dev(NullOpt, 0, spec, [&nsample](Uint8* stream, int len) { >+ // fill provided buffer with sine wave >+ for (Uint8* ptr = stream; ptr < stream + len; ptr += 2) >+ *(Uint16*)ptr = (Uint16)(32766.0f * sin(nsample++ / (float)samplerate * frequency)); > >Property changes on: devel/sdl2pp/files/patch-examples_audio__sine.cc >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 220389
: 183948