mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 19:30:38 +00:00
removed some C99-isms
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25130 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
150f58a492
commit
b2d3176408
2 changed files with 31 additions and 16 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2007-05-08 Riccardo Mottola <rmottola@users.sf.net>
|
||||||
|
|
||||||
|
* Source/NSAnimation.m: removed some C99-isms
|
||||||
|
|
||||||
2007-04-29 Fred Kiefer <FredKiefer@gmx.de>
|
2007-04-29 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSButtonCell.m
|
* Source/NSButtonCell.m
|
||||||
|
|
|
@ -115,9 +115,10 @@ _GSRationalBezierEval (_GSRationalBezierDesc *rb, float t)
|
||||||
static inline float
|
static inline float
|
||||||
_GSRationalBezierDerivEval (_GSRationalBezierDesc *rb, float t)
|
_GSRationalBezierDerivEval (_GSRationalBezierDesc *rb, float t)
|
||||||
{
|
{
|
||||||
|
float h;
|
||||||
if (!rb->areBezierDescComputed)
|
if (!rb->areBezierDescComputed)
|
||||||
_GSRationalBezierComputeBezierDesc (rb);
|
_GSRationalBezierComputeBezierDesc (rb);
|
||||||
float h = _GSBezierEval (&(rb->d),t);
|
h = _GSBezierEval (&(rb->d),t);
|
||||||
return ( _GSBezierDerivEval(&(rb->n),t) * h
|
return ( _GSBezierDerivEval(&(rb->n),t) * h
|
||||||
- _GSBezierEval (&(rb->n),t) * _GSBezierDerivEval(&(rb->d),t) )
|
- _GSBezierEval (&(rb->n),t) * _GSBezierDerivEval(&(rb->d),t) )
|
||||||
/ (h*h);
|
/ (h*h);
|
||||||
|
@ -212,10 +213,11 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
|
|
||||||
- (void) addProgressMark: (NSAnimationProgress)progress
|
- (void) addProgressMark: (NSAnimationProgress)progress
|
||||||
{
|
{
|
||||||
|
_NSANIMATION_LOCK;
|
||||||
|
|
||||||
if (progress < 0.0) progress = 0.0;
|
if (progress < 0.0) progress = 0.0;
|
||||||
if (progress > 1.0) progress = 1.0;
|
if (progress > 1.0) progress = 1.0;
|
||||||
|
|
||||||
_NSANIMATION_LOCK;
|
|
||||||
|
|
||||||
if (GSIArrayCount(_progressMarks) == 0)
|
if (GSIArrayCount(_progressMarks) == 0)
|
||||||
{ // First mark
|
{ // First mark
|
||||||
|
@ -456,10 +458,11 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
- (NSArray*) progressMarks
|
- (NSArray*) progressMarks
|
||||||
{
|
{
|
||||||
NSNumber **cpmn;
|
NSNumber **cpmn;
|
||||||
|
unsigned count;
|
||||||
|
|
||||||
_NSANIMATION_LOCK;
|
_NSANIMATION_LOCK;
|
||||||
|
|
||||||
unsigned count = GSIArrayCount (_progressMarks);
|
count = GSIArrayCount (_progressMarks);
|
||||||
|
|
||||||
if (!_isCachedProgressMarkNumbersValid)
|
if (!_isCachedProgressMarkNumbersValid)
|
||||||
{
|
{
|
||||||
|
@ -494,9 +497,10 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
|
|
||||||
- (void) removeProgressMark: (NSAnimationProgress)progress
|
- (void) removeProgressMark: (NSAnimationProgress)progress
|
||||||
{
|
{
|
||||||
|
unsigned index;
|
||||||
_NSANIMATION_LOCK;
|
_NSANIMATION_LOCK;
|
||||||
|
|
||||||
unsigned index = GSIArraySearch (_progressMarks,progress,nsanimation_progressMarkSorter);
|
index = GSIArraySearch (_progressMarks,progress,nsanimation_progressMarkSorter);
|
||||||
if ( index < GSIArrayCount(_progressMarks)
|
if ( index < GSIArrayCount(_progressMarks)
|
||||||
&& progress == GSIArrayItemAtIndex (_progressMarks,index) )
|
&& progress == GSIArrayItemAtIndex (_progressMarks,index) )
|
||||||
{
|
{
|
||||||
|
@ -590,11 +594,11 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
BOOL needSearchNextMark = NO;
|
BOOL needSearchNextMark = NO;
|
||||||
NSAnimationProgress markedProgress;
|
NSAnimationProgress markedProgress;
|
||||||
|
|
||||||
|
_NSANIMATION_LOCK;
|
||||||
|
|
||||||
if (progress < 0.0) progress = 0.0;
|
if (progress < 0.0) progress = 0.0;
|
||||||
if (progress > 1.0) progress = 1.0;
|
if (progress > 1.0) progress = 1.0;
|
||||||
|
|
||||||
_NSANIMATION_LOCK;
|
|
||||||
|
|
||||||
// NOTE: In the case of a forward jump the marks between the
|
// NOTE: In the case of a forward jump the marks between the
|
||||||
// previous progress value and the new (excluded) progress
|
// previous progress value and the new (excluded) progress
|
||||||
// value are never reached.
|
// value are never reached.
|
||||||
|
@ -868,9 +872,10 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
|
|
||||||
- (void) animatorDidStart
|
- (void) animatorDidStart
|
||||||
{
|
{
|
||||||
|
_NSANIMATION_LOCK;
|
||||||
|
|
||||||
NSDebugFLLog (@"NSAnimationAnimator",@"%@",self);
|
NSDebugFLLog (@"NSAnimationAnimator",@"%@",self);
|
||||||
|
|
||||||
_NSANIMATION_LOCK;
|
|
||||||
|
|
||||||
id delegate;
|
id delegate;
|
||||||
delegate = GS_GC_UNHIDE (_currentDelegate);
|
delegate = GS_GC_UNHIDE (_currentDelegate);
|
||||||
|
@ -945,14 +950,16 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
|
|
||||||
- (void) _gs_startAnimationReachesProgressMark: (NSNotification*)notification
|
- (void) _gs_startAnimationReachesProgressMark: (NSNotification*)notification
|
||||||
{
|
{
|
||||||
NSAnimation *animation = [notification object];
|
NSAnimation *animation;
|
||||||
NSAnimationProgress mark
|
NSAnimationProgress mark;
|
||||||
= [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue];
|
|
||||||
|
_NSANIMATION_LOCK;
|
||||||
|
animation = [notification object];
|
||||||
|
mark = [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue];
|
||||||
|
|
||||||
NSDebugFLLog (@"NSAnimationMark",
|
NSDebugFLLog (@"NSAnimationMark",
|
||||||
@"%@ Start Animation %@ reaches %f",self,animation,mark);
|
@"%@ Start Animation %@ reaches %f",self,animation,mark);
|
||||||
|
|
||||||
_NSANIMATION_LOCK;
|
|
||||||
|
|
||||||
if ( animation == _startAnimation && mark == _startMark)
|
if ( animation == _startAnimation && mark == _startMark)
|
||||||
{
|
{
|
||||||
// [self clearStartAnimation];
|
// [self clearStartAnimation];
|
||||||
|
@ -962,15 +969,19 @@ nsanimation_progressMarkSorter ( NSAnimationProgress first,NSAnimationProgress s
|
||||||
_NSANIMATION_UNLOCK;
|
_NSANIMATION_UNLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void) _gs_stopAnimationReachesProgressMark: (NSNotification*)notification
|
- (void) _gs_stopAnimationReachesProgressMark: (NSNotification*)notification
|
||||||
{
|
{
|
||||||
NSAnimation *animation = [notification object];
|
NSAnimation *animation;
|
||||||
NSAnimationProgress mark
|
NSAnimationProgress mark;
|
||||||
= [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue];
|
|
||||||
|
_NSANIMATION_LOCK;
|
||||||
|
animation = [notification object];
|
||||||
|
mark = [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue];
|
||||||
|
|
||||||
NSDebugFLLog (@"NSAnimationMark",
|
NSDebugFLLog (@"NSAnimationMark",
|
||||||
@"%@ Stop Animation %@ reaches %f",self,animation,mark);
|
@"%@ Stop Animation %@ reaches %f",self,animation,mark);
|
||||||
|
|
||||||
_NSANIMATION_LOCK;
|
|
||||||
|
|
||||||
if ( animation == _stopAnimation && mark == _stopMark)
|
if ( animation == _stopAnimation && mark == _stopMark)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue