summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-01-01 20:05:42 +0100
committerGitHub <noreply@github.com>2023-01-01 20:05:42 +0100
commita63ad76603accc70747a2073c78139299064c43b (patch)
treeb64302ca02847a73d9c8445c11023cfc34314dff /src/drivers/Quartz
parent23e8d831a868774c014993d52eead0cbe105f218 (diff)
FLUID refactor and macOS warnings removed (#623)
P renamed to g_project class Project renamed to class Fluid_Project fixes macOS type cast warnings
Diffstat (limited to 'src/drivers/Quartz')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx4
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx4
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx4
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx8
4 files changed, 10 insertions, 10 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
index 552da03f9..d3f3d343a 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
@@ -92,8 +92,8 @@ void Fl_Quartz_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Of
// draw portion srcx,srcy,w,h of osrc to position x,y (top-left) of the graphics driver's surface
CGContextRef src = (CGContextRef)osrc;
void *data = CGBitmapContextGetData(src);
- int sw = CGBitmapContextGetWidth(src);
- int sh = CGBitmapContextGetHeight(src);
+ int sw = (int)CGBitmapContextGetWidth(src);
+ int sh = (int)CGBitmapContextGetHeight(src);
CGImageRef img;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (fl_mac_os_version >= 100400) img = CGBitmapContextCreateImage(src); // requires 10.4
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
index b97cfbba7..87d4d4f32 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx
@@ -252,8 +252,8 @@ void Fl_Quartz_Graphics_Driver::cache(Fl_Pixmap *img) {
Fl_Surface_Device::pop_current();
CGContextRef src = (CGContextRef)Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surf);
void *cgdata = CGBitmapContextGetData(src);
- int sw = CGBitmapContextGetWidth(src);
- int sh = CGBitmapContextGetHeight(src);
+ int sw = (int)CGBitmapContextGetWidth(src);
+ int sh = (int)CGBitmapContextGetHeight(src);
CGImageAlphaInfo alpha = CGBitmapContextGetAlphaInfo(src);
CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
CGDataProviderRef src_bytes = CGDataProviderCreateWithData(src, cgdata, sw*sh*4, pmProviderRelease);
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx
index 8e17f87c5..6a63ae483 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx
@@ -54,7 +54,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) {
CGFloat *pDst = pattern;
while (*d) { *pDst++ = (float)*d++; }
quartz_line_pattern = pattern;
- quartz_line_pattern_size = d-dashes;
+ quartz_line_pattern_size = (int)(d-dashes);
} else if (style & 0xff) {
char dash, dot, gap;
// adjust lengths to account for cap:
@@ -73,7 +73,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) {
case FL_DASHDOT: *pDst++ = dash; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; break;
case FL_DASHDOTDOT: *pDst++ = dash; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; break;
}
- quartz_line_pattern_size = pDst-pattern;
+ quartz_line_pattern_size = (int)(pDst-pattern);
quartz_line_pattern = pattern;
} else {
quartz_line_pattern = 0;
diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
index 2f1acc5d9..451078484 100644
--- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
@@ -79,10 +79,10 @@ void Fl_Quartz_Image_Surface_Driver::untranslate() {
Fl_RGB_Image* Fl_Quartz_Image_Surface_Driver::image()
{
CGContextFlush((CGContextRef)offscreen);
- int W = CGBitmapContextGetWidth((CGContextRef)offscreen);
- int H = CGBitmapContextGetHeight((CGContextRef)offscreen);
- int bpr = CGBitmapContextGetBytesPerRow((CGContextRef)offscreen);
- int bpp = CGBitmapContextGetBitsPerPixel((CGContextRef)offscreen)/8;
+ int W = (int)CGBitmapContextGetWidth((CGContextRef)offscreen);
+ int H = (int)CGBitmapContextGetHeight((CGContextRef)offscreen);
+ int bpr = (int)CGBitmapContextGetBytesPerRow((CGContextRef)offscreen);
+ int bpp = (int)CGBitmapContextGetBitsPerPixel((CGContextRef)offscreen)/8;
uchar *base = (uchar*)CGBitmapContextGetData((CGContextRef)offscreen);
int idx, idy;
uchar *pdst, *psrc;