Also move UINT32_MAX/INT32_MAX to internal header so they are defined (the same) in every jbig2 source code file.
Unified · Split
| @@ -32,13 +32,6 @@ · 31 unmodified lines | |||
| 32 | #include "jbig2_arith.h" | 32 | #include "jbig2_arith.h" |
| 33 | #include "jbig2_arith_int.h" | 33 | #include "jbig2_arith_int.h" |
| 34 | 34 | ||
| 35 | #if !defined (INT32_MIN) | ||
| 36 | #define INT32_MIN (-0x7fffffff - 1) | ||
| 37 | #endif | ||
| 38 | #if !defined (INT32_MAX) | ||
| 39 | #define INT32_MAX 0x7fffffff | ||
| 40 | #endif | ||
| 41 | |||
| 42 | struct _Jbig2ArithIntCtx { | 35 | struct _Jbig2ArithIntCtx { |
| 43 | Jbig2ArithCx IAx[512]; | 36 | Jbig2ArithCx IAx[512]; |
| 44 | }; | 37 | }; |
| @@ -42,10 +42,6 @@ · 41 unmodified lines | |||
| 42 | #include "jbig2_page.h" | 42 | #include "jbig2_page.h" |
| 43 | #include "jbig2_segment.h" | 43 | #include "jbig2_segment.h" |
| 44 | 44 | ||
| 45 | #if !defined (UINT32_MAX) | ||
| 46 | #define UINT32_MAX 0xffffffff | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /* | 45 | /* |
| 50 | This is an explanation of the unoptimized and optimized generic | 46 | This is an explanation of the unoptimized and optimized generic |
| 51 | region decoder implementations below, wherein we try to explain | 47 | region decoder implementations below, wherein we try to explain |
| @@ -30,13 +30,6 @@ · 29 unmodified lines | |||
| 30 | #include "jbig2_priv.h" | 30 | #include "jbig2_priv.h" |
| 31 | #include "jbig2_image.h" | 31 | #include "jbig2_image.h" |
| 32 | 32 | ||
| 33 | #if !defined (INT32_MAX) | ||
| 34 | #define INT32_MAX 0x7fffffff | ||
| 35 | #endif | ||
| 36 | #if !defined (UINT32_MAX) | ||
| 37 | #define UINT32_MAX 0xffffffffu | ||
| 38 | #endif | ||
| 39 | |||
| 40 | /* allocate a Jbig2Image structure and its associated bitmap */ | 33 | /* allocate a Jbig2Image structure and its associated bitmap */ |
| 41 | Jbig2Image * | 34 | Jbig2Image * |
| 42 | jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height) | 35 | jbig2_image_new(Jbig2Ctx *ctx, uint32_t width, uint32_t height) |
| @@ -40,10 +40,6 @@ · 39 unmodified lines | |||
| 40 | #include "jbig2_mmr.h" | 40 | #include "jbig2_mmr.h" |
| 41 | #include "jbig2_segment.h" | 41 | #include "jbig2_segment.h" |
| 42 | 42 | ||
| 43 | #if !defined (UINT32_MAX) | ||
| 44 | #define UINT32_MAX 0xffffffff | ||
| 45 | #endif | ||
| 46 | |||
| 47 | typedef struct { | 43 | typedef struct { |
| 48 | uint32_t width; | 44 | uint32_t width; |
| 49 | uint32_t height; | 45 | uint32_t height; |
| @@ -34,13 +34,6 @@ · 33 unmodified lines | |||
| 34 | #include "jbig2_page.h" | 34 | #include "jbig2_page.h" |
| 35 | #include "jbig2_segment.h" | 35 | #include "jbig2_segment.h" |
| 36 | 36 | ||
| 37 | #if !defined (INT32_MAX) | ||
| 38 | #define INT32_MAX 0x7fffffff | ||
| 39 | #endif | ||
| 40 | #if !defined (UINT32_MAX) | ||
| 41 | #define UINT32_MAX 0xffffffff | ||
| 42 | #endif | ||
| 43 | |||
| 44 | /* dump the page struct info */ | 37 | /* dump the page struct info */ |
| 45 | static void | 38 | static void |
| 46 | dump_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, Jbig2Page *page) | 39 | dump_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, Jbig2Page *page) |
| @@ -55,6 +55,16 @@ typedef uint8_t byte; · 54 unmodified lines | |||
| 55 | #define NULL ((void*)0) | 55 | #define NULL ((void*)0) |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | #if !defined (INT32_MIN) | ||
| 59 | #define INT32_MIN (-0x7fffffff - 1) | ||
| 60 | #endif | ||
| 61 | #if !defined (INT32_MAX) | ||
| 62 | #define INT32_MAX 0x7fffffff | ||
| 63 | #endif | ||
| 64 | #if !defined (UINT32_MAX) | ||
| 65 | #define UINT32_MAX 0xffffffffu | ||
| 66 | #endif | ||
| 67 | |||
| 58 | typedef struct _Jbig2Page Jbig2Page; | 68 | typedef struct _Jbig2Page Jbig2Page; |
| 59 | typedef struct _Jbig2Segment Jbig2Segment; | 69 | typedef struct _Jbig2Segment Jbig2Segment; |
| 60 | 70 | ||
| @@ -39,10 +39,6 @@ · 38 unmodified lines | |||
| 39 | #include "jbig2_symbol_dict.h" | 39 | #include "jbig2_symbol_dict.h" |
| 40 | #include "jbig2_text.h" | 40 | #include "jbig2_text.h" |
| 41 | 41 | ||
| 42 | #if !defined (UINT32_MAX) | ||
| 43 | #define UINT32_MAX 0xffffffff | ||
| 44 | #endif | ||
| 45 | |||
| 46 | Jbig2Segment * | 42 | Jbig2Segment * |
| 47 | jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t *p_header_size) | 43 | jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t *p_header_size) |
| 48 | { | 44 | { |