mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-25 13:50:54 +00:00
* EOAdaptors/Postgres95/Postgres95Values.m: Remove dependency
on EOAccess/EOAttributePriv.h and EOControl/EONSAddOns.h. (attrRespondsToValueClass, attrRespondsToValueTypeChar): New static locals. (+initialize, +newValueForNumberType:length:attribute:): Remove dependency and used static locals instead. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20751 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7c80ffaf65
commit
3bd48d095d
2 changed files with 24 additions and 4 deletions
|
@ -38,6 +38,13 @@
|
|||
EOControl/EOPriv.m/h but on own private files. Improve
|
||||
optimizations.
|
||||
|
||||
* EOAdaptors/Postgres95/Postgres95Values.m: Remove dependency
|
||||
on EOAccess/EOAttributePriv.h and EOControl/EONSAddOns.h.
|
||||
(attrRespondsToValueClass, attrRespondsToValueTypeChar): New
|
||||
static locals.
|
||||
(+initialize, +newValueForNumberType:length:attribute:): Remove
|
||||
dependency and used static locals instead.
|
||||
|
||||
2005-02-18 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* EOAccess/EOModel.m (-addEntity:, -setName:): Call -willChange:
|
||||
|
|
|
@ -54,8 +54,6 @@ RCS_ID("$Id$")
|
|||
|
||||
|
||||
#include <EOAccess/EOAttribute.h>
|
||||
#include <EOAccess/EOAttributePriv.h>
|
||||
#include <EOControl/EONSAddOns.h>
|
||||
|
||||
#include "Postgres95EOAdaptor/Postgres95Adaptor.h"
|
||||
#include "Postgres95EOAdaptor/Postgres95Channel.h"
|
||||
|
@ -70,8 +68,15 @@ void __postgres95_values_linking_function (void)
|
|||
{
|
||||
}
|
||||
|
||||
static BOOL attrRespondsToValueClass = NO;
|
||||
static BOOL attrRespondsToValueTypeChar = NO;
|
||||
static NSStringEncoding LPSQLA_StringDefaultCStringEncoding;
|
||||
|
||||
@interface EOAttribute (private)
|
||||
- (Class)_valueClass;
|
||||
- (char)_valueTypeChar;
|
||||
@end
|
||||
|
||||
@implementation Postgres95Values
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -81,6 +86,10 @@ static NSStringEncoding LPSQLA_StringDefaultCStringEncoding;
|
|||
{
|
||||
PSQLA_PrivInit();
|
||||
|
||||
attrRespondsToValueClass
|
||||
= [EOAttribute instancesRespondToSelector: @selector(_valueClass)];
|
||||
attrRespondsToValueTypeChar
|
||||
= [EOAttribute instancesRespondToSelector: @selector(_valueTypeChar)];
|
||||
LPSQLA_StringDefaultCStringEncoding = [NSString defaultCStringEncoding];
|
||||
}
|
||||
};
|
||||
|
@ -142,7 +151,9 @@ to strlen(bytes)
|
|||
}
|
||||
else
|
||||
{
|
||||
Class valueClass=[attribute _valueClass];
|
||||
Class valueClass = attrRespondsToValueClass
|
||||
? [attribute _valueClass]
|
||||
: NSClassFromString ([attribute valueClassName]);
|
||||
|
||||
if (valueClass==PSQLA_NSDecimalNumberClass)
|
||||
{
|
||||
|
@ -156,7 +167,9 @@ to strlen(bytes)
|
|||
}
|
||||
else
|
||||
{
|
||||
char valueTypeChar=[attribute _valueTypeChar];
|
||||
char valueTypeChar = attrRespondsToValueTypeChar
|
||||
? [attribute _valueTypeChar]
|
||||
: [[attribute valueType] cString][0];
|
||||
switch(valueTypeChar)
|
||||
{
|
||||
case 'i':
|
||||
|
|
Loading…
Reference in a new issue