From: Matthew Fernandez Date: Wed, 6 Apr 2022 14:46:08 +0000 (-0700) Subject: Quartz plugin quartz_format: squash -Wsign-conversion warning X-Git-Tag: 4.0.0~120^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bcb756607536b724f21bbeee4842e3552b36f3d;p=graphviz Quartz plugin quartz_format: squash -Wsign-conversion warning We know `device.id` is always a valid `format_type` because its only possible values are defined within this plugin. --- diff --git a/plugin/quartz/gvdevice_quartz.c b/plugin/quartz/gvdevice_quartz.c index a4e4bad8c..ce0ad9612 100644 --- a/plugin/quartz/gvdevice_quartz.c +++ b/plugin/quartz/gvdevice_quartz.c @@ -34,7 +34,9 @@ static void quartz_format(GVJ_t *job) /* image destination -> data consumer -> job's gvdevice */ /* data provider <- job's imagedata */ CGDataConsumerRef data_consumer = CGDataConsumerCreate(job, &device_data_consumer_callbacks); - CGImageDestinationRef image_destination = CGImageDestinationCreateWithDataConsumer(data_consumer, format_to_uti(job->device.id), 1, NULL); + CGImageDestinationRef image_destination = + CGImageDestinationCreateWithDataConsumer(data_consumer, + format_to_uti((format_type)job->device.id), 1, NULL); CGDataProviderRef data_provider = CGDataProviderCreateDirect(job->imagedata, BYTES_PER_PIXEL * job->width * job->height, &memory_data_provider_callbacks); /* add the bitmap image to the destination and save it */ diff --git a/plugin/quartz/gvrender_quartz.c b/plugin/quartz/gvrender_quartz.c index 8d91c171e..1081a8b0c 100644 --- a/plugin/quartz/gvrender_quartz.c +++ b/plugin/quartz/gvrender_quartz.c @@ -86,9 +86,7 @@ static void quartzgen_end_job(GVJ_t * job) &device_data_consumer_callbacks); CGImageDestinationRef image_destination = CGImageDestinationCreateWithDataConsumer(data_consumer, - format_to_uti(job->device.id), - 1, - NULL); + format_to_uti((format_type)job->device.id), 1, NULL); /* add the bitmap image to the destination and save it */ CGImageRef image = CGBitmapContextCreateImage(context);