Source/AIScannerDebug.m
author Evan Schoenberg
Thu, 14 Nov 2019 18:10:18 -0500
branchadium-1.5.10.5
changeset 6003 6e8c6761ee0d
parent 3679 f4294bb53b0f
permissions -rw-r--r--
Fixed a few more warnings
3679
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     1
/* 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     2
 * Adium is the legal property of its developers, whose names are listed in the copyright file included
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     3
 * with this source distribution.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     4
 * 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     6
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     7
 * or (at your option) any later version.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     8
 * 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
    10
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
    11
 * Public License for more details.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
    12
 * 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
    13
 * You should have received a copy of the GNU General Public License along with this program; if not,
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
    14
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 66
diff changeset
    15
 */
66
991a4040931d 64-bitize and objc2-ize NSScannerDebug. rgov points out that this could be very unintuitive to debug, so we may want to just remove it. Has it been useful in the last year or two?
David Smith
parents: 49
diff changeset
    16
#ifdef DEBUG_BUILD
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    17
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    18
#import "AIScannerDebug.h"
66
991a4040931d 64-bitize and objc2-ize NSScannerDebug. rgov points out that this could be very unintuitive to debug, so we may want to just remove it. Has it been useful in the last year or two?
David Smith
parents: 49
diff changeset
    19
#import <objc/objc-class.h>
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    20
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    21
@implementation AIScannerDebug
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    22
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    23
+ (void)load
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    24
{
66
991a4040931d 64-bitize and objc2-ize NSScannerDebug. rgov points out that this could be very unintuitive to debug, so we may want to just remove it. Has it been useful in the last year or two?
David Smith
parents: 49
diff changeset
    25
	method_exchangeImplementations(class_getClassMethod(self, @selector(scannerWithString:)), class_getClassMethod([NSScanner class], @selector(scannerWithString:)));
991a4040931d 64-bitize and objc2-ize NSScannerDebug. rgov points out that this could be very unintuitive to debug, so we may want to just remove it. Has it been useful in the last year or two?
David Smith
parents: 49
diff changeset
    26
	method_exchangeImplementations(class_getInstanceMethod(self, @selector(initWithString:)), class_getInstanceMethod([NSScanner class], @selector(initWithString:)));
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    27
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    28
66
991a4040931d 64-bitize and objc2-ize NSScannerDebug. rgov points out that this could be very unintuitive to debug, so we may want to just remove it. Has it been useful in the last year or two?
David Smith
parents: 49
diff changeset
    29
//These will be exchanged with the ones in NSScanner, so to get the originals we need to call the AIScannerDebug ones
6003
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    30
+ (instancetype)scannerWithString:(NSString *)aString
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    31
{
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    32
	NSParameterAssert(aString != nil);
6003
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    33
    
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    34
    static id (*_scannerWithString_method_invoke)(id, Method, NSString *) = (id (*)(id, Method, NSString *)) method_invoke;
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    35
	return _scannerWithString_method_invoke(self, class_getClassMethod([AIScannerDebug class], @selector(scannerWithString:)), aString);
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    36
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    37
6003
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    38
- (instancetype)initWithString:(NSString *)aString
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    39
{
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    40
	NSParameterAssert(aString != nil);
6003
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    41
    
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    42
    static id (*_initWithString_method_invoke)(id, Method, NSString *) = (id (*)(id, Method, NSString *)) method_invoke;
6e8c6761ee0d Fixed a few more warnings
Evan Schoenberg
parents: 3679
diff changeset
    43
	return _initWithString_method_invoke(self, class_getInstanceMethod([AIScannerDebug class], @selector(initWithString:)), aString);
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    44
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    45
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    46
@end
49
fe9621c7c9d0 Turn this off in 64 bit for now
David Smith
parents: 0
diff changeset
    47
fe9621c7c9d0 Turn this off in 64 bit for now
David Smith
parents: 0
diff changeset
    48
#endif