Revision: 13876
http://sourceforge.net/p/skim-app/code/13876
Author: hofman
Date: 2023-12-10 23:39:16 +0000 (Sun, 10 Dec 2023)
Log Message:
-----------
typecast input and output for NSMapTable C functions
Modified Paths:
--------------
trunk/NSWindowController_SKExtensions.m
trunk/SKMainDocument.m
trunk/SKMainWindowController_UI.m
trunk/SKNotesDocument.m
trunk/SKPDFSynchronizer.m
Modified: trunk/NSWindowController_SKExtensions.m
===================================================================
--- trunk/NSWindowController_SKExtensions.m 2023-12-10 22:41:28 UTC (rev
13875)
+++ trunk/NSWindowController_SKExtensions.m 2023-12-10 23:39:16 UTC (rev
13876)
@@ -49,7 +49,7 @@
if (nextWindowLocations == nil)
nextWindowLocations = [[NSMapTable alloc]
initWithKeyPointerFunctions:[NSPointerFunctions strongPointerFunctions]
valuePointerFunctions:[NSPointerFunctions pointPointerFunctions] capacity:0];
- NSPointPointer pointPtr = (NSPointPointer)NSMapGet(nextWindowLocations,
name);
+ NSPointPointer pointPtr = (NSPointPointer)NSMapGet(nextWindowLocations,
(void *)name);
NSPoint point;
[[self window] setFrameUsingName:name];
@@ -61,7 +61,7 @@
point = *pointPtr;
}
point = [[self window] cascadeTopLeftFromPoint:point];
- NSMapInsert(nextWindowLocations, name, &point);
+ NSMapInsert(nextWindowLocations, (void *)name, &point);
}
- (BOOL)isNoteWindowController { return NO; }
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2023-12-10 22:41:28 UTC (rev 13875)
+++ trunk/SKMainDocument.m 2023-12-10 23:39:16 UTC (rev 13876)
@@ -419,7 +419,7 @@
NSMutableArray *mutableArray = [NSMutableArray array];
for (NSDictionary *dict in array) {
NSUInteger pageIndex = [[dict
objectForKey:SKNPDFAnnotationPageIndexKey] unsignedIntegerValue];
- NSPointPointer offsetPtr = NSMapGet(pageOffsets, (const void
*)pageIndex);
+ NSPointPointer offsetPtr = (NSPointPointer)NSMapGet(pageOffsets,
(const void *)pageIndex);
if (offsetPtr != NULL) {
NSMutableDictionary *mutableDict = [dict mutableCopy];
NSRect bounds = NSRectFromString([dict
objectForKey:SKNPDFAnnotationBoundsKey]);
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2023-12-10 22:41:28 UTC (rev 13875)
+++ trunk/SKMainWindowController_UI.m 2023-12-10 23:39:16 UTC (rev 13876)
@@ -835,7 +835,7 @@
- (CGFloat)outlineView:(NSOutlineView *)ov heightOfRowByItem:(id)item {
if ([ov isEqual:rightSideController.noteOutlineView]) {
- CGFloat rowHeight = (NSInteger)NSMapGet(rowHeights, item);
+ CGFloat rowHeight = (NSInteger)NSMapGet(rowHeights, (void *)item);
if (rowHeight <= 0.0) {
if (mwcFlags.autoResizeNoteRows) {
NSTableColumn *tableColumn = [ov outlineTableColumn];
@@ -850,7 +850,7 @@
if (width > 0.0)
rowHeight = [cell cellSizeForBounds:NSMakeRect(0.0, 0.0,
width, CGFLOAT_MAX)].height;
rowHeight = round(fmax(rowHeight, [ov rowHeight]) +
EXTRA_ROW_HEIGHT);
- NSMapInsert(rowHeights, item, (NSInteger)rowHeight);
+ NSMapInsert(rowHeights, (void *)item, (void
*)(NSInteger)rowHeight);
} else {
rowHeight = [(PDFAnnotation *)item type] ? [ov rowHeight] +
EXTRA_ROW_HEIGHT : ([[(SKNoteText *)item note] isNote] ?
DEFAULT_TEXT_ROW_HEIGHT : DEFAULT_MARKUP_ROW_HEIGHT);
}
@@ -861,7 +861,7 @@
}
- (void)outlineView:(NSOutlineView *)ov setHeight:(CGFloat)newHeight
ofRowByItem:(id)item {
- NSMapInsert(rowHeights, item, (NSInteger)round(newHeight));
+ NSMapInsert(rowHeights, (void *)item, (void *)(NSInteger)round(newHeight));
}
- (NSArray *)noteItems:(NSArray *)items {
@@ -1133,7 +1133,7 @@
height = [cell cellSizeForBounds:rect].height;
else
height = 0.0;
- NSMapInsert(rowHeights, item, (NSInteger)round(fmax(height, rowHeight)
+ EXTRA_ROW_HEIGHT));
+ NSMapInsert(rowHeights, (void *)item, (void
*)(NSInteger)round(fmax(height, rowHeight) + EXTRA_ROW_HEIGHT));
if (rowIndexes) {
row = [ov rowForItem:item];
if (row != -1)
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2023-12-10 22:41:28 UTC (rev 13875)
+++ trunk/SKNotesDocument.m 2023-12-10 23:39:16 UTC (rev 13876)
@@ -566,7 +566,7 @@
height = [cell cellSizeForBounds:fullRect].height;
else
height = 0.0;
- NSMapInsert(rowHeights, item, (NSInteger)round(fmax(height, rowHeight)
+ EXTRA_ROW_HEIGHT));
+ NSMapInsert(rowHeights, (void *)item, (void
*)(NSInteger)round(fmax(height, rowHeight) + EXTRA_ROW_HEIGHT));
if (rowIndexes) {
row = [outlineView rowForItem:item];
if (row != -1)
@@ -794,7 +794,7 @@
}
- (CGFloat)outlineView:(NSOutlineView *)ov heightOfRowByItem:(id)item {
- CGFloat rowHeight = (NSInteger)NSMapGet(rowHeights, item);
+ CGFloat rowHeight = (NSInteger)NSMapGet(rowHeights, (void *)item);
if (rowHeight <= 0.0) {
if (ndFlags.autoResizeRows) {
NSTableColumn *tableColumn = [ov outlineTableColumn];
@@ -808,7 +808,7 @@
if (width > 0.0)
rowHeight = [cell cellSizeForBounds:NSMakeRect(0.0, 0.0,
width, CGFLOAT_MAX)].height;
rowHeight = round(fmax(rowHeight, [ov rowHeight]) +
EXTRA_ROW_HEIGHT);
- NSMapInsert(rowHeights, item, (NSInteger)rowHeight);
+ NSMapInsert(rowHeights, (void *)item, (void
*)(NSInteger)rowHeight);
} else {
rowHeight = [(PDFAnnotation *)item type] ? [ov rowHeight] +
EXTRA_ROW_HEIGHT : DEFAULT_TEXT_ROW_HEIGHT;
}
@@ -817,7 +817,7 @@
}
- (void)outlineView:(NSOutlineView *)ov setHeight:(CGFloat)newHeight
ofRowByItem:(id)item {
- NSMapInsert(rowHeights, item, (NSInteger)round(newHeight));
+ NSMapInsert(rowHeights, (void *)item, (void *)(NSInteger)round(newHeight));
}
- (NSArray *)outlineViewTypeSelectHelperSelectionStrings:(NSOutlineView *)ov {
Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m 2023-12-10 22:41:28 UTC (rev 13875)
+++ trunk/SKPDFSynchronizer.m 2023-12-10 23:39:16 UTC (rev 13876)
@@ -201,10 +201,10 @@
#pragma mark PDFSync
static inline SKPDFSyncRecord *recordForIndex(NSMapTable *records, NSInteger
recordIndex) {
- SKPDFSyncRecord *record = NSMapGet(records, (const void *)recordIndex);
+ SKPDFSyncRecord *record = (SKPDFSyncRecord *)NSMapGet(records, (const void
*)recordIndex);
if (record == nil) {
record = [[SKPDFSyncRecord alloc] initWithRecordIndex:recordIndex];
- NSMapInsert(records, (const void *)recordIndex, record);
+ NSMapInsert(records, (void *)recordIndex, (void *)record);
[record release];
}
return record;
@@ -474,7 +474,7 @@
synctex_node_p node = synctex_scanner_input(scanner);
do {
if ((fileRep = synctex_scanner_get_name(scanner,
synctex_node_tag(node)))) {
- NSMapInsert(filenames, [self sourceFileForFileName:[NSString
stringWithUTF8String:fileRep] isTeX:YES removeQuotes:NO], fileRep);
+ NSMapInsert(filenames, (void *)[self
sourceFileForFileName:[NSString stringWithUTF8String:fileRep] isTeX:YES
removeQuotes:NO], (void *)fileRep);
}
} while ((node = synctex_node_next(node)));
isPdfsync = NO;
@@ -503,11 +503,11 @@
- (BOOL)synctexFindPage:(NSUInteger *)pageIndexPtr location:(NSPoint
*)pointPtr forLine:(NSInteger)line inFile:(NSString *)file {
BOOL rv = NO;
- char *filename = NSMapGet(filenames, file) ?: NSMapGet(filenames, [[file
stringByResolvingSymlinksInPath] stringByStandardizingPath]);
+ char *filename = (char *)NSMapGet(filenames, (void *)file) ?: (char
*)NSMapGet(filenames, (void *)[[file stringByResolvingSymlinksInPath]
stringByStandardizingPath]);
if (filename == NULL) {
for (NSString *fn in filenames) {
if ([[fn lastPathComponent] caseInsensitiveCompare:[file
lastPathComponent]] == NSOrderedSame) {
- filename = NSMapGet(filenames, file);
+ filename = NSMapGet(filenames, (void *)file);
break;
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit