Commit e7b90afd authored by Adrian Robert's avatar Adrian Robert
Browse files

* nsterm.m (ns_color_to_lisp): Use CGFloat where appropriate. Fix

	printf format.
	(ns_query_color): Use CGFloat where appropriate.
	(EmacsView<NSTextInput>, EmacsScroller): Fix method signatures.
	(EmacsScroller-mouseDown:) Use long format in printf, and cast
	argument.
parent e28db5bc
......@@ -1449,7 +1449,7 @@ Free a pool and temporary objects it refers to (callable from C)
Convert a color to a lisp string with the RGB equivalent
-------------------------------------------------------------------------- */
{
float red, green, blue, alpha, gray;
CGFloat red, green, blue, alpha, gray;
char buf[1024];
const char *str;
NSTRACE (ns_color_to_lisp);
......@@ -1469,13 +1469,13 @@ Free a pool and temporary objects it refers to (callable from C)
{
[[col colorUsingColorSpaceName: NSCalibratedWhiteColorSpace]
getWhite: &gray alpha: &alpha];
snprintf (buf, sizeof (buf), "#%02.2lx%02.2lx%02.2lx",
snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx",
lrint (gray * 0xff), lrint (gray * 0xff), lrint (gray * 0xff));
UNBLOCK_INPUT;
return build_string (buf);
}
snprintf (buf, sizeof (buf), "#%02.2lx%02.2lx%02.2lx",
snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx",
lrint (red*0xff), lrint (green*0xff), lrint (blue*0xff));
UNBLOCK_INPUT;
......@@ -1491,7 +1491,7 @@ Free a pool and temporary objects it refers to (callable from C)
and set color_def pixel to the resulting index.
-------------------------------------------------------------------------- */
{
float r, g, b, a;
CGFloat r, g, b, a;
[((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a];
color_def->red = r * 65535;
......@@ -4705,7 +4705,7 @@ - (NSRange)selectedRange
return NSMakeRange (NSNotFound, 0);
}
- (unsigned int)characterIndexForPoint: (NSPoint)thePoint
- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint
{
if (NS_KEYLOG)
NSLog (@"characterIndexForPoint request");
......@@ -5395,7 +5395,7 @@ - (void)drawRect: (NSRect)rect
/* NSDraggingDestination protocol methods. Actually this is not really a
protocol, but a category of Object. O well... */
-(unsigned int) draggingEntered: (id <NSDraggingInfo>) sender
-(NSUInteger) draggingEntered: (id <NSDraggingInfo>) sender
{
NSTRACE (draggingEntered);
return NSDragOperationGeneric;
......@@ -5680,7 +5680,7 @@ @implementation EmacsScroller
#define SCROLL_BAR_FIRST_DELAY 0.5
#define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15)
+ (float) scrollerWidth
+ (CGFloat) scrollerWidth
{
/* TODO: if we want to allow variable widths, this is the place to do it,
however neither GNUstep nor Cocoa support it very well */
......@@ -5925,7 +5925,8 @@ - (void)mouseDown: (NSEvent *)e
case NSScrollerKnobSlot: /* GNUstep-only */
last_hit_part = scroll_bar_move_ratio; break;
default: /* NSScrollerNoPart? */
fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %d\n", part);
fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %ld\n",
(long)part);
return;
}
......
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