Author: rfm Date: Wed Apr 12 08:22:07 2017 New Revision: 40469 URL: http://svn.gna.org/viewcvs/gnustep?rev=40469&view=rev Log: tidied
Modified: libs/sqlclient/trunk/SQLClient.m Modified: libs/sqlclient/trunk/SQLClient.m URL: http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/SQLClient.m?rev=40469&r1=40468&r2=40469&view=diff ============================================================================== --- libs/sqlclient/trunk/SQLClient.m (original) +++ libs/sqlclient/trunk/SQLClient.m Wed Apr 12 08:22:07 2017 @@ -993,6 +993,7 @@ if (Nil == LitStringClass) { Class root = [NSObject class]; + IMP imp; SEL sel; /* Find the literal string class used by the foundation library. @@ -1009,39 +1010,45 @@ * literal string doesn't get retained/released. */ +#define enc \ + method_getTypeEncoding(class_getInstanceMethod(SQLStringClass, sel)) + + sel = @selector(release); + imp = class_getMethodImplementation(root, sel); + class_addMethod(SQLStringClass, sel, imp, enc); + NSAssert(imp == [SQLStringClass instanceMethodForSelector: sel], + NSInternalInconsistencyException); + + sel = @selector(autorelease); + imp = class_getMethodImplementation(root, sel); + class_addMethod(SQLStringClass, sel, imp, enc); + NSAssert(imp == [SQLStringClass instanceMethodForSelector: sel], + NSInternalInconsistencyException); + + sel = @selector(dealloc); + imp = class_getMethodImplementation(root, sel); + class_addMethod(SQLStringClass, sel, imp, enc); + NSAssert(imp == [SQLStringClass instanceMethodForSelector: sel], + NSInternalInconsistencyException); + sel = @selector(retain); - class_addMethod(SQLStringClass, sel, - class_getMethodImplementation(root, sel), - method_getTypeEncoding(class_getInstanceMethod(root, sel))); - - sel = @selector(release); - class_addMethod(SQLStringClass, sel, - class_getMethodImplementation(root, sel), - method_getTypeEncoding(class_getInstanceMethod(root, sel))); - - sel = @selector(autorelease); - class_addMethod(SQLStringClass, sel, - class_getMethodImplementation(root, sel), - method_getTypeEncoding(class_getInstanceMethod(root, sel))); - - sel = @selector(dealloc); - class_addMethod(SQLStringClass, sel, - class_getMethodImplementation(root, sel), - method_getTypeEncoding(class_getInstanceMethod(root, sel))); + imp = class_getMethodImplementation(root, sel); + class_addMethod(SQLStringClass, sel, imp, enc); + NSAssert(imp == [SQLStringClass instanceMethodForSelector: sel], + NSInternalInconsistencyException); /* The -copy and -copyWithZone: methods should simply retain * the receiver. */ sel = @selector(copy); - class_addMethod(SQLStringClass, sel, - class_getMethodImplementation(root, @selector(retain)), - method_getTypeEncoding(class_getInstanceMethod(root, sel))); + class_addMethod(SQLStringClass, sel, imp, enc); + NSAssert(imp == [SQLStringClass instanceMethodForSelector: sel], + NSInternalInconsistencyException); sel = @selector(copyWithZone:); - class_addMethod(SQLStringClass, sel, - class_getMethodImplementation(root, @selector(retain)), - method_getTypeEncoding(class_getInstanceMethod(root, sel))); - + class_addMethod(SQLStringClass, sel, imp, enc); + NSAssert(imp == [SQLStringClass instanceMethodForSelector: sel], + NSInternalInconsistencyException); } if (nil == null) _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs