orc: Fix some warnings on MSVC and enable --werror
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 30 Jun 2020 11:42:54 +0000 (17:12 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Wed, 1 Jul 2020 09:39:05 +0000 (15:09 +0530)
Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/42>

.gitlab-ci.yml
examples/example2.c
orc/orcemulateopcodes.c
testsuite/memcpy_speed.c

index 0517648..1233014 100644 (file)
@@ -48,7 +48,7 @@ debian sid:
     # Environment variables substitutions is done by PowerShell before calling
     # cmd.exe, that's why we use $env:FOO instead of %FOO%
     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
-        meson build $env:MESON_ARGS &&
+        meson --werror build $env:MESON_ARGS &&
         ninja -C build &&
         ninja -C build test"
 
@@ -75,6 +75,6 @@ msys2:
     - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
     - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm"
     - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
-    - C:\msys64\usr\bin\bash -c "meson build $env:MESON_ARGS &&
+    - C:\msys64\usr\bin\bash -c "meson --werror build $env:MESON_ARGS &&
         ninja -C build &&
         ninja -C build test"
index c2d03e4..8382771 100644 (file)
@@ -21,7 +21,7 @@ main (int argc, char *argv[])
   }
 
   /* Call a function that uses Orc */
-  audio_add_mono_to_stereo_scaled_s16 (c, a, b, volume*4096, N);
+  audio_add_mono_to_stereo_scaled_s16 (c, a, b, (int) (volume*4096), N);
 
   /* Print the results */
   for(i=0;i<N;i++){
index a0f1aa8..ff09dd2 100644 (file)
@@ -4896,7 +4896,7 @@ emulate_convlf (OrcOpcodeExecutor *ex, int offset, int n)
     /* 0: loadl */
     var32 = ptr4[i];
     /* 1: convlf */
-    var33.f = var32.i;
+    var33.f = (float) var32.i;
     /* 2: storel */
     ptr0[i] = var33;
   }
@@ -5279,7 +5279,7 @@ emulate_convdl (OrcOpcodeExecutor *ex, int offset, int n)
     /* 1: convdl */
     {
        int tmp;
-       tmp = var32.f;
+       tmp = (int) var32.f;
        if (tmp == 0x80000000 && !(var32.i & ORC_UINT64_C(0x8000000000000000))) tmp = 0x7fffffff;
        var33.i = tmp;
     }
index 4cf1c39..9f4f247 100644 (file)
@@ -95,16 +95,16 @@ main(int argc, char *argv[])
 #endif
   orc_get_data_cache_sizes (&level1, &level2, &level3);
   if (level3 > 0) {
-    max = (log(level3)/M_LN2 - 6.0) * 10 + 20;
+    max = (int) ((log(level3)/M_LN2 - 6.0) * 10 + 20);
   } else if (level2 > 0) {
-    max = (log(level2)/M_LN2 - 6.0) * 10 + 20;
+    max = (int) ((log(level2)/M_LN2 - 6.0) * 10 + 20);
   } else {
     max = 140;
   }
 
   for(i=0;i<max;i+=2){
     double x = i*0.1 + 6.0;
-    int size = pow(2.0, x);
+    int size = (int) pow(2.0, x);
 
     if (size > MAX_SIZE_TO_CHECK) {
       printf ("Stopping test, exceeding maximum size to check (%d, could do above %d)\n",