Mon 16 Apr 2007 07:34:16 AM UTC, comment #1:
Thanks... I the millisecond value was replacing the second value and wasn't set itself. Fixed in SVN.
I'm still a but surprised that the compiler doesn't optimize:
if (localuint > 2)
{ /don't alter localuint / }
if (localuint > 5)
{ /don't alter localuint / }
if (localuint > 9)
{ /don't alter localuint / }
to:
if (localuint > 2)
{ /don't alter localuint /
if (localuint > 5)
{ /don't alter localuint /
if (localuint > 9)
{ /don't alter localuint / }
}
}
by itself but I'm not finding the time to investigate so changed it as you suggested (but didn't update the indetation yet as I may still look into this later.
|
Tue 03 Apr 2007 07:24:12 PM UTC, original submission:
In PostgreSQLAdaptor/PostgreSQLChannel.m:
newValueForDateTypeLengthAttribute (const void *bytes,
int length,
EOAttribute *attribute,
NSStringEncoding encoding)
There's 2 timeslength >18 case and milliseconds are not handled
....
if (length > 18)
{
char tmpString[3];
getDigits(&str[17],tmpString,2,&error);
second = atoi(tmpString);
}
if (length > 18)
{
char tmpString[3];
getDigits(&str[17],tmpString,2,&error);
second = atoi(tmpString);
}
...
BTW, won't it be better to have:
if (length > 3)
{
char tmpString[5];
getDigits(&str[0],tmpString,4,&error);
year = atoi(tmpString);
if (length > 6)
{
char tmpString[3];
getDigits(&str[5],tmpString,2,&error);
month = atoi(tmpString);
if (...)
|