mozilla.diff 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. diff --git jmemmgr.c jmemmgr.c
  2. --- jmemmgr.c
  3. +++ jmemmgr.c
  4. @@ -28,16 +28,17 @@
  5. */
  6. #define JPEG_INTERNALS
  7. #define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */
  8. #include "jinclude.h"
  9. #include "jpeglib.h"
  10. #include "jmemsys.h" /* import the system-dependent declarations */
  11. #include <stdint.h>
  12. +#include <limits.h> /* some NDKs define SIZE_MAX in limits.h */
  13. #ifndef NO_GETENV
  14. #ifndef HAVE_STDLIB_H /* <stdlib.h> should declare getenv() */
  15. extern char *getenv (const char *name);
  16. #endif
  17. #endif
  18. diff --git jmorecfg.h jmorecfg.h
  19. --- jmorecfg.h
  20. +++ jmorecfg.h
  21. @@ -9,16 +9,17 @@
  22. * For conditions of distribution and use, see the accompanying README.ijg
  23. * file.
  24. *
  25. * This file contains additional configuration options that customize the
  26. * JPEG software for special applications or support machine-dependent
  27. * optimizations. Most users will not need to touch this file.
  28. */
  29. +#include <stdint.h>
  30. /*
  31. * Maximum number of components (color channels) allowed in JPEG image.
  32. * To meet the letter of the JPEG spec, set this to 255. However, darn
  33. * few applications need more than 4 channels (maybe 5 for CMYK + alpha
  34. * mask). We recommend 10 as a reasonable compromise; use 4 if you are
  35. * really short on memory. (Each allowed component costs a hundred or so
  36. * bytes of storage, whether actually used in an image or not.)
  37. @@ -118,39 +119,25 @@ typedef char JOCTET;
  38. * They must be at least as wide as specified; but making them too big
  39. * won't cost a huge amount of memory, so we don't provide special
  40. * extraction code like we did for JSAMPLE. (In other words, these
  41. * typedefs live at a different point on the speed/space tradeoff curve.)
  42. */
  43. /* UINT8 must hold at least the values 0..255. */
  44. -#ifdef HAVE_UNSIGNED_CHAR
  45. -typedef unsigned char UINT8;
  46. -#else /* not HAVE_UNSIGNED_CHAR */
  47. -#ifdef __CHAR_UNSIGNED__
  48. -typedef char UINT8;
  49. -#else /* not __CHAR_UNSIGNED__ */
  50. -typedef short UINT8;
  51. -#endif /* __CHAR_UNSIGNED__ */
  52. -#endif /* HAVE_UNSIGNED_CHAR */
  53. +typedef uint8_t UINT8;
  54. /* UINT16 must hold at least the values 0..65535. */
  55. -#ifdef HAVE_UNSIGNED_SHORT
  56. -typedef unsigned short UINT16;
  57. -#else /* not HAVE_UNSIGNED_SHORT */
  58. -typedef unsigned int UINT16;
  59. -#endif /* HAVE_UNSIGNED_SHORT */
  60. +typedef uint16_t UINT16;
  61. /* INT16 must hold at least the values -32768..32767. */
  62. -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
  63. -typedef short INT16;
  64. -#endif
  65. +typedef int16_t INT16;
  66. /* INT32 must hold at least signed 32-bit values.
  67. *
  68. * NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were
  69. * sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to
  70. * long. It also wasn't common (or at least as common) in 1994 for INT32 to be
  71. * defined by platform headers. Since then, however, INT32 is defined in
  72. * several other common places:
  73. @@ -167,25 +154,17 @@ typedef short INT16;
  74. * This is a recipe for conflict, since "long" and "int" aren't always
  75. * compatible types. Since the definition of INT32 has technically been part
  76. * of the libjpeg API for more than 20 years, we can't remove it, but we do not
  77. * use it internally any longer. We instead define a separate type (JLONG)
  78. * for internal use, which ensures that internal behavior will always be the
  79. * same regardless of any external headers that may be included.
  80. */
  81. -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
  82. -#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */
  83. -#ifndef _BASETSD_H /* MinGW is slightly different */
  84. -#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */
  85. -typedef long INT32;
  86. -#endif
  87. -#endif
  88. -#endif
  89. -#endif
  90. +typedef int32_t INT32;
  91. /* Datatype used for image dimensions. The JPEG standard only supports
  92. * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
  93. * "unsigned int" is sufficient on all machines. However, if you need to
  94. * handle larger images and you don't mind deviating from the spec, you
  95. * can change this datatype. (Note that changing this datatype will
  96. * potentially require modifying the SIMD code. The x86-64 SIMD extensions,
  97. * in particular, assume a 32-bit JDIMENSION.)