From cbd448ad139a048393684df3b2d841c5d1bac03f Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Sat, 26 Aug 2023 05:34:56 +0900 Subject: [PATCH] Fix #105 replace underscore variables to x --- src/puppy/platforms/macos/macdefs.nim | 18 +++++++++--------- src/puppy/platforms/macos/objc.nim | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/puppy/platforms/macos/macdefs.nim b/src/puppy/platforms/macos/macdefs.nim index ee51e00..955dc86 100644 --- a/src/puppy/platforms/macos/macdefs.nim +++ b/src/puppy/platforms/macos/macdefs.nim @@ -27,29 +27,29 @@ const objc: proc code*(self: NSError): int - proc dataWithBytes*(class: typedesc[NSData], _: pointer, length: int): NSData + proc dataWithBytes*(class: typedesc[NSData], x: pointer, length: int): NSData proc bytes*(self: NSData): pointer proc length*(self: NSData): int proc keyEnumerator*(self: NSDictionary): NSEnumerator - proc objectForKey*(self: NSDictionary, _: ID): ID + proc objectForKey*(self: NSDictionary, x: ID): ID proc nextObject*(self: NSEnumerator): ID - proc URLWithString*(class: typedesc[NSURL], _: NSString): NSURL + proc URLWithString*(class: typedesc[NSURL], x: NSString): NSURL proc requestWithURL*( class: typedesc[NSMutableURLRequest], - _: NSURL, + x: NSURL, cachePolicy: NSURLRequestCachePolicy, timeoutInterval: NSTimeInterval ): NSMutableURLRequest - proc setHTTPMethod*(self: NSMutableURLRequest, _: NSString) - proc setValue*(self: NSMutableURLRequest, _: NSString, forHTTPHeaderField: NSString) - proc setHTTPBody*(self: NSMutableURLRequest, _: NSData) + proc setHTTPMethod*(self: NSMutableURLRequest, x: NSString) + proc setValue*(self: NSMutableURLRequest, x: NSString, forHTTPHeaderField: NSString) + proc setHTTPBody*(self: NSMutableURLRequest, x: NSData) proc sendSynchronousRequest*( class: typedesc[NSURLConnection], - _: NSMutableURLRequest, + x: NSMutableURLRequest, returningResponse: ptr NSHTTPURLResponse, error: ptr NSError ): NSData proc statusCode*(self: NSHTTPURLResponse): int proc allHeaderFields*(self: NSHTTPURLResponse): NSDictionary proc URL*(self: NSHTTPURLResponse): NSURL - proc absoluteString*(self: NSURL): NSString + proc absoluteString*(self: NSURL): NSString \ No newline at end of file diff --git a/src/puppy/platforms/macos/objc.nim b/src/puppy/platforms/macos/objc.nim index 3dc9ea4..6ab55b5 100644 --- a/src/puppy/platforms/macos/objc.nim +++ b/src/puppy/platforms/macos/objc.nim @@ -113,8 +113,8 @@ macro objc*(body: untyped) = fixArg.removeSuffix("_mangle") sel.add fixArg else: - if argName != "_": - error("Second arugment needs to be _.", arg) + if argName != "x": + error("Second arugment needs to be x.", arg) sel.add ":" # Add second name and type as is. @@ -224,4 +224,4 @@ proc alloc*(cls: Class): ID = ) proc alloc*[T](class: typedesc[T]): T = - class.getClass().alloc().T + class.getClass().alloc().T \ No newline at end of file