mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Fixes from Jeremy Bettis
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21535 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
299b6fc807
commit
bec8a74a6e
5 changed files with 22 additions and 22 deletions
|
@ -1787,31 +1787,14 @@ NSDictionary *locale)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* This is complicated. We have to transform the wide
|
||||
string into a unicode string. */
|
||||
/* This is simple. Wide string == unicode string. */
|
||||
int prc;
|
||||
unichar *sp;
|
||||
wchar_t *wsp;
|
||||
unichar *wsp;
|
||||
|
||||
len = 0;
|
||||
prc = prec;
|
||||
wsp = (wchar_t *)string;
|
||||
wsp = (unichar *)string;
|
||||
while (prc-- && *wsp++) len++;
|
||||
|
||||
wsp = (wchar_t *)string;
|
||||
|
||||
/* Allocate dynamically an array which definitely is long
|
||||
enough for the wide character version. */
|
||||
if (len < 8192
|
||||
|| ((string = (unichar *) NSZoneMalloc(s->_zone, len * sizeof (unichar)))
|
||||
== NULL))
|
||||
string = (unichar *) alloca (len * sizeof (unichar));
|
||||
else
|
||||
string_malloced = 1;
|
||||
|
||||
prc = len;
|
||||
sp = string;
|
||||
while (prc--) *sp = *wsp;
|
||||
}
|
||||
|
||||
if ((width -= len) <= 0)
|
||||
|
|
|
@ -2558,7 +2558,7 @@ static void Grow(DescriptionInfo *info, unsigned size)
|
|||
eday += 31;
|
||||
}
|
||||
}
|
||||
if (emonth < smonth)
|
||||
if (emonth < smonth || (emonth == smonth && eday < sday))
|
||||
{
|
||||
eyear -= 1;
|
||||
emonth += 12;
|
||||
|
@ -2585,7 +2585,7 @@ static void Grow(DescriptionInfo *info, unsigned size)
|
|||
}
|
||||
else
|
||||
{
|
||||
while (diff--)
|
||||
while (diff-- > 0)
|
||||
{
|
||||
int tmpmonth = emonth - diff - 1;
|
||||
int tmpyear = eyear;
|
||||
|
|
|
@ -954,3 +954,9 @@ const char *_NSPrintForDebugger(id object)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NSString *_NSNewStringFromCString(const char *cstring)
|
||||
{
|
||||
return [NSString stringWithCString: cstring];
|
||||
}
|
||||
|
||||
|
|
|
@ -1299,6 +1299,10 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
struct objc_protocol_list* proto_list;
|
||||
|
||||
if (aProtocol == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
for (proto_list = ((struct objc_class*)self)->protocols;
|
||||
proto_list; proto_list = proto_list->next)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue