Commit f7daeec1 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Tristan Van Berkom
Browse files

Start using CGFloat

Fixes a bunch of compiler warnings.  Since CGFloat does not exist on
Tiger and earlier, we have added a typedef likewise as was done for
NSInteger.
parent 5d3e4149
......@@ -199,10 +199,10 @@ gdk_colormap_get_screen (GdkColormap *cmap)
void
_gdk_quartz_colormap_get_rgba_from_pixel (GdkColormap *colormap,
guint32 pixel,
float *red,
float *green,
float *blue,
float *alpha)
CGFloat *red,
CGFloat *green,
CGFloat *blue,
CGFloat *alpha)
{
*red = (pixel >> 16 & 0xff) / 255.0;
*green = (pixel >> 8 & 0xff) / 255.0;
......
......@@ -118,10 +118,10 @@ gdk_quartz_gc_set_dashes (GdkGC *gc,
private->dash_count = n;
g_free (private->dash_lengths);
private->dash_lengths = g_new (gfloat, n);
private->dash_lengths = g_new (CGFloat, n);
for (i = 0; i < n; i++)
private->dash_lengths[i] = (gfloat) dash_list[i];
private->dash_phase = (gfloat) dash_offset;
private->dash_lengths[i] = (CGFloat) dash_list[i];
private->dash_phase = (CGFloat) dash_offset;
}
static void
......@@ -269,7 +269,7 @@ _gdk_windowing_gc_copy (GdkGC *dst_gc,
g_free (dst_quartz_gc->dash_lengths);
dst_quartz_gc->dash_lengths = g_memdup (src_quartz_gc->dash_lengths,
sizeof (float) * src_quartz_gc->dash_count);
sizeof (CGFloat) * src_quartz_gc->dash_count);
dst_quartz_gc->dash_count = src_quartz_gc->dash_count;
dst_quartz_gc->dash_phase = src_quartz_gc->dash_phase;
}
......@@ -305,7 +305,7 @@ gdk_quartz_draw_stippled_pattern (void *info,
GdkGC *gc = GDK_GC (info);
CGImageRef pattern_image;
CGRect rect;
gfloat r, g, b, a;
CGFloat r, g, b, a;
pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_stipple (gc))->impl)->image;
rect = CGRectMake (0, 0,
......@@ -327,7 +327,7 @@ gdk_quartz_draw_opaque_stippled_pattern (void *info,
GdkGC *gc = GDK_GC (info);
CGImageRef pattern_image;
CGRect rect;
gfloat r, g, b, a;
CGFloat r, g, b, a;
pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_stipple (gc))->impl)->image;
rect = CGRectMake (0, 0,
......@@ -453,7 +453,7 @@ _gdk_quartz_gc_update_cg_context (GdkGC *gc,
{
CGLineCap line_cap = kCGLineCapButt;
CGLineJoin line_join = kCGLineJoinMiter;
gfloat r, g, b, a;
CGFloat r, g, b, a;
_gdk_quartz_colormap_get_rgba_from_pixel (gc->colormap,
fg_pixel,
......@@ -515,9 +515,9 @@ _gdk_quartz_gc_update_cg_context (GdkGC *gc,
GdkFill fill = _gdk_gc_get_fill (gc);
CGColorSpaceRef baseSpace;
CGColorSpaceRef patternSpace;
gfloat alpha = 1.0;
gfloat colors[4] = { 0.0, 0.0, 0.0, 0.0 };
gfloat r, g, b, a;
CGFloat alpha = 1.0;
CGFloat colors[4] = { 0.0, 0.0, 0.0, 0.0 };
CGFloat r, g, b, a;
if (fill == GDK_SOLID)
{
......
......@@ -66,9 +66,9 @@ struct _GdkGCQuartz
GdkCapStyle cap_style;
GdkJoinStyle join_style;
gfloat *dash_lengths;
CGFloat *dash_lengths;
gint dash_count;
gfloat dash_phase;
CGFloat dash_phase;
CGPatternRef ts_pattern;
......@@ -131,10 +131,10 @@ void _gdk_quartz_gc_update_cg_context (GdkGC *gc,
/* Colormap */
void _gdk_quartz_colormap_get_rgba_from_pixel (GdkColormap *colormap,
guint32 pixel,
gfloat *red,
gfloat *green,
gfloat *blue,
gfloat *alpha);
CGFloat *red,
CGFloat *green,
CGFloat *blue,
CGFloat *alpha);
/* Window */
gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
......
......@@ -255,7 +255,7 @@ gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
if (bg_pixmap == NULL)
{
CGContextRef cg_context;
gfloat r, g, b, a;
CGFloat r, g, b, a;
gint i;
cg_context = gdk_quartz_drawable_get_context (GDK_DRAWABLE (impl), FALSE);
......
......@@ -32,6 +32,8 @@
#ifndef NSINTEGER_DEFINED
typedef int NSInteger;
typedef unsigned int NSUInteger;
typedef float CGFloat;
#endif
G_BEGIN_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment