The R Project SVN R-packages

Rev

Rev 5235 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5235 Rev 5707
Line 40... Line 40...
40
		rows = [colCont count];
40
		rows = [colCont count];
41
		sortMap = (int*) malloc(sizeof(int)*rows);
41
		sortMap = (int*) malloc(sizeof(int)*rows);
42
		invSortMap = (int*) malloc(sizeof(int)*rows);
42
		invSortMap = (int*) malloc(sizeof(int)*rows);
43
		while (i<rows) { sortMap[i]=invSortMap[i]=i; i++; }
43
		while (i<rows) { sortMap[i]=invSortMap[i]=i; i++; }
44
    } else if ([colCont count] != rows) {
44
    } else if ([colCont count] != rows) {
45
		NSLog(@"SortableDataSource: column %@ has %d rows, but the data source has %d rows! Bad things may happen...", name, rows);
45
		NSLog(@"SortableDataSource: column %@ has %d rows, but the data source has %d rows! Bad things may happen...", name, rows, [colCont count]);
46
    }
46
    }
47
}
47
}
48
 
48
 
49
- (void) addColumnOfLength: (int) clen withCStrings: (char**) cstr name: (NSString*) name
49
- (void) addColumnOfLength: (int) clen withCStrings: (char**) cstr name: (NSString*) name
50
{
50
{
51
	NSString **ca = (NSString**) malloc(sizeof(NSString*)*clen);
51
	NSString **ca = (NSString**) malloc(sizeof(NSString*)*clen);
52
	int i=0;
52
	int i=0;
53
	while (i<clen) {
53
	while (i<clen) {
54
		ca[i] = [NSString stringWithCString: cstr[i]];
54
		ca[i] = [NSString stringWithUTF8String: cstr[i]];
55
		i++;
55
		i++;
56
	}
56
	}
57
	[self addColumn: [NSArray arrayWithObjects:ca count:clen] withName:name];
57
	[self addColumn: [NSArray arrayWithObjects:ca count:clen] withName:name];
58
	free(ca);
58
	free(ca);
59
}
59
}