Changeset 35662 in osm for applications/editors/josm/plugins/jna/src/org
- Timestamp:
- 2020-12-06T02:51:47+01:00 (4 years ago)
- Location:
- applications/editors/josm/plugins/jna/src/org/openstreetmap/josm/plugins/jna/mac
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/jna/src/org/openstreetmap/josm/plugins/jna/mac/Foundation.java
r35660 r35662 5 5 6 6 import com.sun.jna.Native; // NOSONAR 7 import com.sun.jna.NativeLong; 7 8 8 9 /** … … 41 42 */ 42 43 public static void nsLog(String format, Object args) { 43 IDformatAsCFString = cfString(format);44 NativeLong formatAsCFString = cfString(format); 44 45 try { 45 46 foundationLibrary.NSLog(formatAsCFString, args); … … 54 55 * Note that the returned string must be freed with {@link #cfRelease(ID)}. 55 56 */ 56 static IDcfString(String s) {57 static NativeLong cfString(String s) { 57 58 // Use a byte[] rather than letting jna do the String -> char* marshalling itself. 58 59 // Turns out about 10% quicker for long strings. … … 65 66 * Release the NSObject with id 66 67 */ 67 static void cfRelease( IDid) {68 static void cfRelease(NativeLong id) { 68 69 foundationLibrary.CFRelease(id); 69 70 } -
applications/editors/josm/plugins/jna/src/org/openstreetmap/josm/plugins/jna/mac/FoundationLibrary.java
r35659 r35662 3 3 4 4 import com.sun.jna.Library; // NOSONAR 5 import com.sun.jna.NativeLong; 5 6 6 7 /** … … 11 12 interface FoundationLibrary extends Library { 12 13 13 void NSLog( IDpString, Object thing);14 void NSLog(NativeLong pString, Object thing); 14 15 15 ID CFStringCreateWithBytes(ID allocator, byte[] bytes, int byteCount, int encoding, byte isExternalRepresentation); 16 NativeLong CFStringCreateWithBytes(NativeLong allocator, byte[] bytes, int byteCount, int encoding, 17 byte isExternalRepresentation); 16 18 17 void CFRelease( IDcfTypeRef);19 void CFRelease(NativeLong cfTypeRef); 18 20 }
Note:
See TracChangeset
for help on using the changeset viewer.