]> granicus.if.org Git - graphviz/commitdiff
Quartz plugin quartz_format: squash -Wsign-conversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 6 Apr 2022 14:46:08 +0000 (07:46 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 15:31:25 +0000 (08:31 -0700)
We know `device.id` is always a valid `format_type` because its only possible
values are defined within this plugin.

plugin/quartz/gvdevice_quartz.c
plugin/quartz/gvrender_quartz.c

index a4e4bad8c89f6deafc4b2176dc12e6e21e9b0648..ce0ad961251976a86d51f562e2f9254a9551b967 100644 (file)
@@ -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 */
index 8d91c171e23708f4022e8ee7a7f57bbe65fee80b..1081a8b0cfdb5d2a8e97d3319987a58b0a1d444e 100644 (file)
@@ -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);