20190910-msa-patch.diff 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. diff --git a/3rdparty/libpng/mips/mips_init.c b/3rdparty/libpng/mips/mips_init.c
  2. index 8dd283deef..6a061cccfa 100644
  3. --- a/3rdparty/libpng/mips/mips_init.c
  4. +++ b/3rdparty/libpng/mips/mips_init.c
  5. @@ -73,7 +73,6 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
  6. * this case will fall through to the 'default' below, which just
  7. * returns.
  8. */
  9. -#endif /* PNG_MIPS_MSA_API_SUPPORTED */
  10. #ifdef PNG_MIPS_MSA_CHECK_SUPPORTED
  11. {
  12. static volatile sig_atomic_t no_msa = -1; /* not checked */
  13. @@ -84,12 +83,9 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
  14. if (no_msa)
  15. return;
  16. }
  17. -#ifdef PNG_MIPS_MSA_API_SUPPORTED
  18. - break;
  19. -#endif
  20. #endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
  21. + break;
  22. -#ifdef PNG_MIPS_MSA_API_SUPPORTED
  23. default: /* OFF or INVALID */
  24. return;
  25. @@ -97,8 +93,6 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
  26. /* Option turned on */
  27. break;
  28. }
  29. -#endif
  30. -
  31. /* IMPORTANT: any new external functions used here must be declared using
  32. * PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
  33. * 'prefix' option to configure works:
  34. @@ -118,13 +112,16 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
  35. pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_msa;
  36. pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_msa;
  37. }
  38. -
  39. else if (bpp == 4)
  40. {
  41. pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_msa;
  42. pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
  43. pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
  44. }
  45. +#else
  46. + (void)pp;
  47. + (void)bpp;
  48. +#endif /* PNG_MIPS_MSA_API_SUPPORTED */
  49. }
  50. #endif /* PNG_MIPS_MSA_OPT > 0 */
  51. #endif /* READ */