X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fwebcollage-helper-cocoa.m;h=f05aee166f9d6ecf778a9bcddaec5f7077ff76c4;hp=11e3dcf474fe994a56228716c579482301c006d1;hb=f0261d8acab611f3433160e4f07367b870439739;hpb=7b34ef992563d7bcbb64cc5597dc45fa24470b05 diff --git a/hacks/webcollage-helper-cocoa.m b/hacks/webcollage-helper-cocoa.m index 11e3dcf4..f05aee16 100644 --- a/hacks/webcollage-helper-cocoa.m +++ b/hacks/webcollage-helper-cocoa.m @@ -1,5 +1,5 @@ /* webcollage-helper-cocoa --- scales and pastes one image into another - * xscreensaver, Copyright (c) 2002-2008 Jamie Zawinski + * xscreensaver, Copyright (c) 2002-2009 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -20,6 +20,13 @@ #include #include + +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 + typedef int NSInteger; + typedef unsigned int NSUInteger; +#endif + + char *progname; static int verbose_p = 0; @@ -142,7 +149,7 @@ bevel_image (NSImage *img, int bevel_pct, bytesPerRow: 0 bitsPerPixel: 0]; - int xx, yy; + NSInteger xx, yy; double *ramp = (double *) malloc (sizeof(*ramp) * (bevel_size + 1)); if (!ramp) @@ -183,7 +190,7 @@ bevel_image (NSImage *img, int bevel_pct, r = rx * ry; if (r != 1) { - unsigned int p[4]; + NSUInteger p[4]; p[0] = 0xFF * r; p[1] = p[2] = p[3] = 0xFF; [rep setPixel:p atX:xx y:yy]; @@ -296,7 +303,8 @@ write_image (NSImage *img, const char *file) properties:props]; [jpeg_data writeToFile: - [NSString stringWithCString:file] + [NSString stringWithCString:file + encoding:NSISOLatin1StringEncoding] atomically:YES]; if (verbose_p)