summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.mm
diff options
context:
space:
mode:
authorritsuka <[email protected]>2009-03-01 18:00:26 +0000
committerritsuka <[email protected]>2009-03-01 18:00:26 +0000
commita2763d8dc216bc2670d49128d98dd65600cfe95f (patch)
tree8f0626993b49b3834ad6a89af3145fa4eab00de4 /macosx/Controller.mm
parent1d3a65d04e19f8adf752e44a2905d1b4932efe7e (diff)
MacGui; fixed warnings related to 64bit cocoa.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2183 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.mm')
-rw-r--r--macosx/Controller.mm92
1 files changed, 44 insertions, 48 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 2e73266dc..00bb5e729 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -2069,33 +2069,32 @@ fWorkingCount = 0;
}
/* this is actually called from the queue controller to modify the queue array and return it back to the queue controller */
-- (void)moveObjectsInQueueArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(unsigned)insertIndex
+- (void)moveObjectsInQueueArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex
{
- unsigned index = [indexSet lastIndex];
- unsigned aboveInsertIndexCount = 0;
+ NSUInteger index = [indexSet lastIndex];
+ NSUInteger aboveInsertIndexCount = 0;
- while (index != NSNotFound)
- {
- unsigned removeIndex;
-
- if (index >= insertIndex)
- {
- removeIndex = index + aboveInsertIndexCount;
- aboveInsertIndexCount++;
- }
- else
- {
- removeIndex = index;
- insertIndex--;
- }
-
- id object = [[QueueFileArray objectAtIndex:removeIndex] retain];
- [QueueFileArray removeObjectAtIndex:removeIndex];
- [QueueFileArray insertObject:object atIndex:insertIndex];
- [object release];
+
+ NSUInteger removeIndex;
- index = [indexSet indexLessThanIndex:index];
+ if (index >= insertIndex)
+ {
+ removeIndex = index + aboveInsertIndexCount;
+ aboveInsertIndexCount++;
}
+ else
+ {
+ removeIndex = index;
+ insertIndex--;
+ }
+
+ id object = [[QueueFileArray objectAtIndex:removeIndex] retain];
+ [QueueFileArray removeObjectAtIndex:removeIndex];
+ [QueueFileArray insertObject:object atIndex:insertIndex];
+ [object release];
+
+ index = [indexSet indexLessThanIndex:index];
+
/* We save all of the Queue data here
* and it also gets sent back to the queue controller*/
[self saveQueueFileItem];
@@ -5334,7 +5333,7 @@ the user is using "Custom" settings by determining the sender*/
}
/* We use this to deterimine children of an item */
-- (id)outlineView:(NSOutlineView *)fPresetsOutlineView child:(int)index ofItem:(id)item
+- (id)outlineView:(NSOutlineView *)fPresetsOutlineView child:(NSInteger)index ofItem:(id)item
{
/* we need to return the count of the array in ChildrenArray for this folder */
@@ -5350,7 +5349,7 @@ the user is using "Custom" settings by determining the sender*/
children = [item objectForKey:@"ChildrenArray"];
}
}
- if ((children == nil) || ([children count] <= index))
+ if ((children == nil) || ( [children count] <= (NSUInteger) index))
{
return nil;
}
@@ -5610,33 +5609,30 @@ return YES;
return YES;
}
-- (void)moveObjectsInPresetsArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(unsigned)insertIndex
+- (void)moveObjectsInPresetsArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex
{
- unsigned index = [indexSet lastIndex];
- unsigned aboveInsertIndexCount = 0;
+ NSUInteger index = [indexSet lastIndex];
+ NSUInteger aboveInsertIndexCount = 0;
- while (index != NSNotFound)
+ NSUInteger removeIndex;
+
+ if (index >= insertIndex)
{
- unsigned removeIndex;
-
- if (index >= insertIndex)
- {
- removeIndex = index + aboveInsertIndexCount;
- aboveInsertIndexCount++;
- }
- else
- {
- removeIndex = index;
- insertIndex--;
- }
-
- id object = [[array objectAtIndex:removeIndex] retain];
- [array removeObjectAtIndex:removeIndex];
- [array insertObject:object atIndex:insertIndex];
- [object release];
-
- index = [indexSet indexLessThanIndex:index];
+ removeIndex = index + aboveInsertIndexCount;
+ aboveInsertIndexCount++;
}
+ else
+ {
+ removeIndex = index;
+ insertIndex--;
+ }
+
+ id object = [[array objectAtIndex:removeIndex] retain];
+ [array removeObjectAtIndex:removeIndex];
+ [array insertObject:object atIndex:insertIndex];
+ [object release];
+
+ index = [indexSet indexLessThanIndex:index];
}