mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 21:08:10 +02:00
Convert mime data length to use unsigned long
What we want to use is size_t, but we don't want the implied POSIX dependency. However, POSIX does say that size_t is an unsigned integer that is no longer than a long, so it would appear safe to use an unsigned long as a replacement. Safer at least than unsigned int.
This commit is contained in:
parent
eb85ab998b
commit
9b9952ab4f
14 changed files with 37 additions and 37 deletions
|
|
@ -53,11 +53,11 @@ _cairo_image_info_get_jpeg_info (cairo_image_info_t *info,
|
|||
cairo_private cairo_int_status_t
|
||||
_cairo_image_info_get_jpx_info (cairo_image_info_t *info,
|
||||
const unsigned char *data,
|
||||
long length);
|
||||
unsigned long length);
|
||||
|
||||
cairo_private cairo_int_status_t
|
||||
_cairo_image_info_get_png_info (cairo_image_info_t *info,
|
||||
_cairo_image_info_get_png_info (cairo_image_info_t *info,
|
||||
const unsigned char *data,
|
||||
long length);
|
||||
unsigned long length);
|
||||
|
||||
#endif /* CAIRO_IMAGE_INFO_PRIVATE_H */
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ _jpx_extract_info (const unsigned char *p, cairo_image_info_t *info)
|
|||
cairo_int_status_t
|
||||
_cairo_image_info_get_jpx_info (cairo_image_info_t *info,
|
||||
const unsigned char *data,
|
||||
long length)
|
||||
unsigned long length)
|
||||
{
|
||||
const unsigned char *p = data;
|
||||
const unsigned char *end = data + length;
|
||||
|
|
@ -262,7 +262,7 @@ static const unsigned char _png_magic[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
|
|||
cairo_int_status_t
|
||||
_cairo_image_info_get_png_info (cairo_image_info_t *info,
|
||||
const unsigned char *data,
|
||||
long length)
|
||||
unsigned long length)
|
||||
{
|
||||
const unsigned char *p = data;
|
||||
const unsigned char *end = data + length;
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ _cairo_memory_stream_length (cairo_output_stream_t *stream);
|
|||
cairo_private cairo_status_t
|
||||
_cairo_memory_stream_destroy (cairo_output_stream_t *abstract_stream,
|
||||
unsigned char **data_out,
|
||||
unsigned int *length_out);
|
||||
unsigned long *length_out);
|
||||
|
||||
cairo_private cairo_output_stream_t *
|
||||
_cairo_null_stream_create (void);
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ _cairo_memory_stream_create (void)
|
|||
cairo_status_t
|
||||
_cairo_memory_stream_destroy (cairo_output_stream_t *abstract_stream,
|
||||
unsigned char **data_out,
|
||||
unsigned int *length_out)
|
||||
unsigned long *length_out)
|
||||
{
|
||||
memory_stream_t *stream;
|
||||
cairo_status_t status;
|
||||
|
|
|
|||
|
|
@ -1041,10 +1041,10 @@ _cairo_pdf_source_surface_init_key (cairo_pdf_source_surface_entry_t *key)
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_get_jpx_image_info (cairo_surface_t *source,
|
||||
cairo_image_info_t *info,
|
||||
const unsigned char **mime_data,
|
||||
unsigned int *mime_data_length)
|
||||
_get_jpx_image_info (cairo_surface_t *source,
|
||||
cairo_image_info_t *info,
|
||||
const unsigned char **mime_data,
|
||||
unsigned long *mime_data_length)
|
||||
{
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JP2,
|
||||
mime_data, mime_data_length);
|
||||
|
|
@ -1055,10 +1055,10 @@ _get_jpx_image_info (cairo_surface_t *source,
|
|||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_get_jpeg_image_info (cairo_surface_t *source,
|
||||
_get_jpeg_image_info (cairo_surface_t *source,
|
||||
cairo_image_info_t *info,
|
||||
const unsigned char **mime_data,
|
||||
unsigned int *mime_data_length)
|
||||
unsigned long *mime_data_length)
|
||||
{
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
mime_data, mime_data_length);
|
||||
|
|
@ -1077,7 +1077,7 @@ _get_source_surface_size (cairo_surface_t *source,
|
|||
cairo_rectangle_int_t extents;
|
||||
cairo_image_info_t info;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
|
||||
if (source->type == CAIRO_SURFACE_TYPE_RECORDING) {
|
||||
if (source->backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SUBSURFACE) {
|
||||
|
|
@ -2004,7 +2004,7 @@ _cairo_pdf_surface_emit_jpx_image (cairo_pdf_surface_t *surface,
|
|||
{
|
||||
cairo_status_t status;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
cairo_image_info_t info;
|
||||
|
||||
if (surface->pdf_version < CAIRO_PDF_VERSION_1_5)
|
||||
|
|
@ -2045,7 +2045,7 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t *surface,
|
|||
{
|
||||
cairo_status_t status;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
cairo_image_info_t info;
|
||||
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ read_png (struct png_read_closure_t *png_closure)
|
|||
cairo_format_t format;
|
||||
cairo_status_t status;
|
||||
unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
|
||||
png_closure->png_data = _cairo_memory_stream_create ();
|
||||
|
||||
|
|
|
|||
|
|
@ -2327,7 +2327,7 @@ _cairo_ps_surface_emit_jpeg_image (cairo_ps_surface_t *surface,
|
|||
{
|
||||
cairo_status_t status;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
cairo_image_info_t info;
|
||||
|
||||
cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_JPEG,
|
||||
|
|
|
|||
|
|
@ -1155,7 +1155,7 @@ _emit_png_surface (cairo_script_surface_t *surface,
|
|||
cairo_output_stream_t *base85_stream;
|
||||
cairo_status_t status;
|
||||
const uint8_t *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
|
||||
cairo_surface_get_mime_data (&image->base, CAIRO_MIME_TYPE_PNG,
|
||||
&mime_data, &mime_data_length);
|
||||
|
|
@ -1208,7 +1208,7 @@ _emit_image_surface (cairo_script_surface_t *surface,
|
|||
cairo_output_stream_t *zlib_stream;
|
||||
cairo_status_t status, status2;
|
||||
const uint8_t *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
struct def *tag;
|
||||
|
||||
if (_cairo_user_data_array_get_data (&image->base.user_data,
|
||||
|
|
@ -1310,7 +1310,7 @@ _emit_image_surface (cairo_script_surface_t *surface,
|
|||
cairo_list_add (&tag->link, &ctx->defines);
|
||||
status = _cairo_user_data_array_set_data (&image->base.user_data,
|
||||
(cairo_user_data_key_t *) ctx,
|
||||
tag, _undef);
|
||||
tag, _undef);
|
||||
if (unlikely (status)) {
|
||||
free (tag);
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -783,7 +783,7 @@ void
|
|||
cairo_surface_get_mime_data (cairo_surface_t *surface,
|
||||
const char *mime_type,
|
||||
const unsigned char **data,
|
||||
unsigned int *length)
|
||||
unsigned long *length)
|
||||
{
|
||||
cairo_user_data_slot_t *slots;
|
||||
int i, num_slots;
|
||||
|
|
@ -896,7 +896,7 @@ cairo_status_t
|
|||
cairo_surface_set_mime_data (cairo_surface_t *surface,
|
||||
const char *mime_type,
|
||||
const unsigned char *data,
|
||||
unsigned int length,
|
||||
unsigned long length,
|
||||
cairo_destroy_func_t destroy,
|
||||
void *closure)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ _cairo_surface_base64_encode_jpeg (cairo_surface_t *surface,
|
|||
cairo_output_stream_t *output)
|
||||
{
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
cairo_image_info_t image_info;
|
||||
base64_write_closure_t info;
|
||||
cairo_status_t status;
|
||||
|
|
@ -1125,7 +1125,7 @@ _cairo_surface_base64_encode_png (cairo_surface_t *surface,
|
|||
cairo_output_stream_t *output)
|
||||
{
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
base64_write_closure_t info;
|
||||
cairo_status_t status;
|
||||
|
||||
|
|
@ -1266,7 +1266,7 @@ _cairo_svg_surface_emit_surface (cairo_svg_document_t *document,
|
|||
cairo_bool_t is_bounded;
|
||||
cairo_status_t status;
|
||||
const unsigned char *uri;
|
||||
unsigned int uri_len;
|
||||
unsigned long uri_len;
|
||||
|
||||
if (_cairo_user_data_array_get_data (&surface->user_data,
|
||||
(cairo_user_data_key_t *) document))
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ typedef enum _cairo_image_transparency {
|
|||
struct _cairo_mime_data {
|
||||
cairo_reference_count_t ref_count;
|
||||
unsigned char *data;
|
||||
unsigned int length;
|
||||
unsigned long length;
|
||||
cairo_destroy_func_t destroy;
|
||||
void *closure;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -521,11 +521,11 @@ static cairo_int_status_t
|
|||
_cairo_win32_printing_surface_check_jpeg (cairo_win32_surface_t *surface,
|
||||
cairo_surface_t *source,
|
||||
const unsigned char **data,
|
||||
unsigned int *length,
|
||||
unsigned long *length,
|
||||
cairo_image_info_t *info)
|
||||
{
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
cairo_int_status_t status;
|
||||
DWORD result;
|
||||
|
||||
|
|
@ -559,11 +559,11 @@ static cairo_int_status_t
|
|||
_cairo_win32_printing_surface_check_png (cairo_win32_surface_t *surface,
|
||||
cairo_surface_t *source,
|
||||
const unsigned char **data,
|
||||
unsigned int *length,
|
||||
unsigned long *length,
|
||||
cairo_image_info_t *info)
|
||||
{
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_data_length;
|
||||
unsigned long mime_data_length;
|
||||
|
||||
cairo_int_status_t status;
|
||||
DWORD result;
|
||||
|
|
@ -611,7 +611,7 @@ _cairo_win32_printing_surface_paint_image_pattern (cairo_win32_surface_t *surf
|
|||
RECT clip;
|
||||
const cairo_color_t *background_color;
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_size;
|
||||
unsigned long mime_size;
|
||||
cairo_image_info_t mime_info;
|
||||
cairo_bool_t use_mime;
|
||||
DWORD mime_type;
|
||||
|
|
|
|||
|
|
@ -2188,13 +2188,13 @@ cairo_public void
|
|||
cairo_surface_get_mime_data (cairo_surface_t *surface,
|
||||
const char *mime_type,
|
||||
const unsigned char **data,
|
||||
unsigned int *length);
|
||||
unsigned long *length);
|
||||
|
||||
cairo_public cairo_status_t
|
||||
cairo_surface_set_mime_data (cairo_surface_t *surface,
|
||||
const char *mime_type,
|
||||
const unsigned char *data,
|
||||
unsigned int length,
|
||||
unsigned long length,
|
||||
cairo_destroy_func_t destroy,
|
||||
void *closure);
|
||||
|
||||
|
|
|
|||
|
|
@ -1320,7 +1320,7 @@ _expand_four_tuple_to_five (unsigned char four_tuple[4],
|
|||
static void
|
||||
_write_base85_data (struct _data_stream *stream,
|
||||
const unsigned char *data,
|
||||
unsigned int length)
|
||||
unsigned long length)
|
||||
{
|
||||
unsigned char five_tuple[5];
|
||||
int ret;
|
||||
|
|
@ -1555,7 +1555,7 @@ _emit_image (cairo_surface_t *image,
|
|||
|
||||
for (mime_type = mime_types; *mime_type; mime_type++) {
|
||||
const unsigned char *mime_data;
|
||||
unsigned int mime_length;
|
||||
unsigned long mime_length;
|
||||
|
||||
DLCALL (cairo_surface_get_mime_data,
|
||||
image, *mime_type, &mime_data, &mime_length);
|
||||
|
|
@ -3652,7 +3652,7 @@ cairo_status_t
|
|||
cairo_surface_set_mime_data (cairo_surface_t *surface,
|
||||
const char *mime_type,
|
||||
const unsigned char *data,
|
||||
unsigned int length,
|
||||
unsigned long length,
|
||||
cairo_destroy_func_t destroy,
|
||||
void *closure)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue