mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
* Utilize documentation rules in Makefile Package.
* doc/GNUmakefile: Rewrite to use Makefile Package. * doc/Makefile.postamble: Remove old obsolete rules. * Documentation which covers GNUstep as a whole versus just gstep-base has been moved to the top level Documentation dir. * GNUstep-HOWTO: Delete. * doc/gnustep-base.tmpl.texi: GNUstep-HOWTO and FAQ removed. Add variable so that included files know they are within the main document. * doc/gnustep-howto.tmpl.texi: Delete. * doc/faq.tmpl.texi: Delete. * doc/announce.tmpl.texi: Don't include version.texi needlessly. * doc/news.tmpl.texi: Don't include version.texi needlessly. * doc/todo.tmpl.texi: Don't include version.texi needlessly. * src/GNUmakefile: Don't compile Random class as the name too often conflicts with user apps. * src/GetDefEncoding.m: Reformat. * src/NSArray.m (-replaceObjectsInRange:withObjectsFromArray:): Fix range check. Use enumerator instead of count. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2783 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e5b499f079
commit
d48fdafcbb
13 changed files with 141 additions and 2202 deletions
|
@ -102,7 +102,6 @@ OrderedCollection.m \
|
|||
Port.m \
|
||||
Proxy.m \
|
||||
Queue.m \
|
||||
Random.m \
|
||||
RawCStream.m \
|
||||
RBTree.m \
|
||||
RBTreeNode.m \
|
||||
|
@ -147,6 +146,8 @@ stringsfile.tab.m \
|
|||
mframe.m \
|
||||
objc-gnu2next.m
|
||||
|
||||
#Random.m \
|
||||
|
||||
GNU_CFILES = \
|
||||
md5.c \
|
||||
numbers.c \
|
||||
|
@ -224,7 +225,6 @@ RBTree.h \
|
|||
RBTreeNode.h \
|
||||
RNGAdditiveCongruential.h \
|
||||
RNGBerkeley.h \
|
||||
Random.h \
|
||||
RandomGenerating.h \
|
||||
RawCStream.h \
|
||||
Retaining.h \
|
||||
|
@ -266,6 +266,8 @@ all.h \
|
|||
README \
|
||||
preface.h
|
||||
|
||||
#Random.h \
|
||||
|
||||
# NEXTSTEP source files
|
||||
|
||||
NEXTSTEP_MFILES = \
|
||||
|
|
|
@ -62,61 +62,61 @@ NSStringEncoding GetDefEncoding()
|
|||
availableEncodings = [NSString availableStringEncodings];
|
||||
|
||||
encoding = getenv("GNUSTEP_STRING_ENCODING");
|
||||
if(encoding)
|
||||
{
|
||||
count=0;
|
||||
while((count<str_encoding_table_size)&
|
||||
strcmp(str_encoding_table[count].ename,encoding))
|
||||
if (encoding)
|
||||
{
|
||||
count++;
|
||||
count = 0;
|
||||
while ((count < str_encoding_table_size) &
|
||||
strcmp(str_encoding_table[count].ename,encoding))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if( !(count == str_encoding_table_size) )
|
||||
{
|
||||
ret = str_encoding_table[count].enc;
|
||||
if ((ret == NSUnicodeStringEncoding) ||
|
||||
(ret == NSSymbolStringEncoding))
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported as default c string encoding.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
}
|
||||
else /*encoding should be supported but is it implemented?*/
|
||||
{
|
||||
count = 0;
|
||||
tmp = 0;
|
||||
while ( !(availableEncodings[count] == 0) )
|
||||
{
|
||||
if ( !(ret == availableEncodings[count]) )
|
||||
tmp = 0;
|
||||
else
|
||||
{
|
||||
tmp = ret;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
};
|
||||
if (!tmp)
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not yet implemented.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
};
|
||||
};
|
||||
}
|
||||
else /* encoding not found */
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
}
|
||||
}
|
||||
if(!(count==str_encoding_table_size))
|
||||
{
|
||||
ret= str_encoding_table[count].enc;
|
||||
if((ret==NSUnicodeStringEncoding) ||
|
||||
(ret==NSSymbolStringEncoding))
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported as default c string encoding.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
}
|
||||
else /*encoding should be supported but is it implemented?*/
|
||||
{
|
||||
count=0;
|
||||
tmp=0;
|
||||
while(!(availableEncodings[count]==0))
|
||||
{
|
||||
if(!(ret==availableEncodings[count]))
|
||||
tmp=0;
|
||||
else
|
||||
{
|
||||
tmp=ret;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
};
|
||||
if(!tmp)
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not yet implemented.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
};
|
||||
};
|
||||
}
|
||||
else /* encoding not found */
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
}
|
||||
}
|
||||
else /* envirinment var not found */
|
||||
{
|
||||
/* This shouldn't be required. It really should be in UserDefaults - asf */
|
||||
//fprintf(stderr,"WARNING: GNUSTEP_STRING_ENCODING environment variable not found\n");
|
||||
//fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
}
|
||||
{
|
||||
/* This shouldn't be required. It really should be in UserDefaults - asf */
|
||||
//fprintf(stderr,"WARNING: GNUSTEP_STRING_ENCODING environment variable not found\n");
|
||||
//fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
@ -124,14 +124,15 @@ NSString*
|
|||
GetEncodingName(NSStringEncoding encoding)
|
||||
{
|
||||
char* ret;
|
||||
unsigned int count=0;
|
||||
while((count<str_encoding_table_size)&
|
||||
unsigned int count=0;
|
||||
while ((count < str_encoding_table_size) &
|
||||
!(str_encoding_table[count].enc == encoding))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if(!(count==str_encoding_table_size))
|
||||
ret= str_encoding_table[count].ename;
|
||||
else ret="Unknown encoding";
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if ( !(count == str_encoding_table_size) )
|
||||
ret = str_encoding_table[count].ename;
|
||||
else
|
||||
ret = "Unknown encoding";
|
||||
return [NSString stringWithCString:ret];
|
||||
};
|
||||
|
|
|
@ -695,15 +695,15 @@ static Class NSMutableArray_concrete_class;
|
|||
- (void) replaceObjectsInRange: (NSRange)aRange
|
||||
withObjectsFromArray: (NSArray*)anArray
|
||||
{
|
||||
unsigned i;
|
||||
id e, o;
|
||||
|
||||
if ([self count] <= aRange.location)
|
||||
if ([self count] < (aRange.location + aRange.length))
|
||||
[NSException raise: NSRangeException
|
||||
format: @"Replacing objects beyond end of array."];
|
||||
[self removeObjectsInRange: aRange];
|
||||
i = [anArray count];
|
||||
while (i-- > 0)
|
||||
[self insertObject: [anArray objectAtIndex: i] atIndex: aRange.location];
|
||||
e = [anArray reverseObjectEnumerator];
|
||||
while ((o = [e nextObject]))
|
||||
[self insertObject: o atIndex: aRange.location];
|
||||
}
|
||||
|
||||
- (void) replaceObjectsInRange: (NSRange)aRange
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue