Commit graph

280 commits

Author SHA1 Message Date
rfm
b8d0003b43 Update FSF address as requested by Gregory 2024-11-08 10:33:32 +00:00
Dave Vernon
947f0f8b52 Revert inadvertent change. 2024-02-01 09:25:49 -07:00
DavidHVernon
c9999c8dcb experiment. 2024-01-31 15:44:03 -07:00
rfm
c1c17df624 avoid compiler warning 2023-11-23 16:35:35 +00:00
Richard Frith-Macdonald
bd5f2909e6 Simplify conversion of a string to data (use base class code) and fix to handle the insertion of BOM consistently (as on OSX) for encodings where the byte order matters but is not specified by the encoding. 2021-04-14 09:57:11 +01:00
Richard Frith-Macdonald
747f47d83d Mark function call as requiring void return; hint to tell coverity that we do not want the return value from this function (there's nothing we could do with it and the function should never fail with the input we provide). 2021-01-25 12:25:49 +00:00
Richard Frith-Macdonald
95c10d7fa7 Use superclass implementation of -doubleValue and -floatValue 2020-12-30 11:54:57 +00:00
Richard Frith-Macdonald
6d20773f56 Consistently use __typeof__() rather than typeof() or __typeof() for compatibility (GCC and clang and, perhaps, other future compilers) irrespective of -std= compilation options. 2020-12-15 13:01:00 +00:00
Richard Frith-Macdonald
0dbd863dde Add optimisation for the use of GSImmutableString so that it can make use of the layout of the underlying mutable string that the GSImmutableString is a proxy for. 2020-11-22 09:55:39 -05:00
Richard Frith-Macdonald
7fcd11d6c9 Rewrite -replaceCharactersInRange:withString: to cope with the case where the string argument is the receiver (or some proxy to the receiver etc). 2020-11-22 08:08:34 -05:00
Richard Frith-Macdonald
5ec87d80b4 Fix for text storage objects setting their content to their own immutable proxy 2020-11-21 08:23:53 +00:00
Richard Frith-Macdonald
ae90743153 Avoid building unused functions when new string API is used. 2020-11-11 22:23:13 +00:00
Richard Frith-Macdonald
e8a62e0e5e Check for nil arugment to -isEqualToString: 2020-06-23 07:03:55 +01:00
Gregory John Casamento
753c907938 Fix address for FSF and License name in all headers in base 2019-12-09 18:36:00 -05:00
Richard Frith-Macdonald
dd36855923 Improved memory usage reporting mechanisms 2019-08-08 17:20:25 +01:00
David Chisnall
3847c54f3f Add NSConstantString implementation for v2 ABI.
This is largely the version from the newabi branch, but with a few
cleanups made possible by other bug fixes in the GSString
implementations.
2018-12-27 13:44:45 +00:00
fredkiefer
5a72e1cfa8 * Source/GSString.m: Remove GSString copyWithZone:.
* Source/NSString.m: Raise exception when no is provided for the
string. This brings our implementation closer to the Cocoa one.
* Source/GSString.m: Add similar exceptions.
2018-07-06 23:53:32 +02:00
Richard Frith-Macdonald
1066ec7015 Ensure we are testing the internal 16bit unicode representation class. 2018-07-02 14:20:58 +01:00
fredkiefer
ab60bab84a * Source/GSString.m: Move the method _unicodeString from here...
* Tests/base/NSString/test00.m: ...to here.
2018-07-01 23:50:05 +02:00
fredkiefer
760d6ad990 * Source/GSString.m: Remove code that was identical to super class. 2018-07-01 23:27:09 +02:00
David Chisnall
970c8cbd05 Revert "Fix memory corruption in NSException."
Accidentally included unrelated changes.

This reverts commit 3b1e94ec5d.
2018-04-07 20:03:33 +01:00
David Chisnall
3b1e94ec5d Fix memory corruption in NSException.
If compiling without backtrace or BFD support, we initialise the
location to store return addresses incorrectly, leaving a dangling
pointer which we then right over.

Most consumers never read this, so it seemed to work most of the time by
just overwriting a random bit of memory.

This probably has security implications, because throwing an exception
can clobber random bits of memory, though not with attacker-controlled
data.
2018-04-07 11:02:04 +01:00
David Chisnall
0ebb50f984 Fix logic error in GSPrivateRangeOfString.
We were checking if the receiver was a specific class, then directly
accessing an ivar of target.  We were then checking if target is a
specific class and, if so, accessing the ivar or target.

This mostly worked because most GNUstep strings have the same
underlying implementation and so the check was passing and by
coincidence giving the correct value.  This breaks when GSTinyStrings
are used more often and was picked up by teaching the compiler to
generate GSTinyStrings for small string literals.
2018-04-06 10:43:10 +01:00
Richard Frith-Macdonald
c6e4220409 Add _unicodeString method to return GSUnicodeString subclass instance for tests 2018-02-27 15:00:52 +00:00
Richard Frith-Macdonald
73f3fb78ab raise on character conversion failure 2018-02-07 10:49:02 +00:00
Richard Frith-Macdonald
ad87ff5462 raise exception on character conversion failure 2018-02-07 10:38:57 +00:00
Richard Frith-Macdonald
ab670fd27a improive handling of failed character conversion 2018-02-04 11:10:07 +00:00
fredkiefer
e69450400a * Source/GSFormat.m: Call va_end with the correct parameter.
* Source/NSObject+NSComparisonMethods.m: Add missing return.
* Source/GSString.m (-replaceCharactersInRange:withString:,
-initWithBytesNoCopy:...freeWhenDone:): Remove dead code.
* Source/NSDistantObject.m (-initWithCoder:): Remove dead code.
* Source/NSPredicate.m (_eval_avg:): Don't devide by zero.
Fix issues found by Coverity.
2018-02-01 22:31:15 +01:00
Richard Frith-Macdonald
9d21ee5671 check for null pointer 2018-01-31 14:24:46 +00:00
Richard Frith-Macdonald
c31c6a87b8 fix uninitialised variable 2018-01-30 15:01:01 +00:00
Wolfgang Lux
bc285396da Characters outside the BMP cannot be converted to Latin 1 string encoding 2017-07-10 10:16:27 +02:00
Richard Frith-MacDonald
0fe344d12a Partial fix/update for noncharacter codepoints,
also check for task exit more consistently


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40125 72102866-910b-0410-8b05-ffd578937521
2016-10-05 17:44:00 +00:00
Richard Frith-MacDonald
5d272a49e5 Fixup error in return value when buffer too small
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39920 72102866-910b-0410-8b05-ffd578937521
2016-06-25 18:27:33 +00:00
Richard Frith-MacDonald
c4b05fa213 Optimise fetching ascii or utf8 from literal string
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39915 72102866-910b-0410-8b05-ffd578937521
2016-06-23 18:27:22 +00:00
Richard Frith-MacDonald
71941dd24d cleanup changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39762 72102866-910b-0410-8b05-ffd578937521
2016-05-14 09:34:01 +00:00
Richard Frith-MacDonald
d53b94baba If we are doing a numeric search, use the superclass method (with ICU numeric collation).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39662 72102866-910b-0410-8b05-ffd578937521
2016-04-13 12:45:03 +00:00
Richard Frith-MacDonald
d40d219015 removal of garbage collection
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39608 72102866-910b-0410-8b05-ffd578937521
2016-03-25 11:15:28 +00:00
Richard Frith-MacDonald
a0c97c1ddd deprecate confusing extension in favour of simpler ARC-complient method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39520 72102866-910b-0410-8b05-ffd578937521
2016-03-10 16:50:41 +00:00
Richard Frith-MacDonald
ce29f2223d Further correction to latin1 conversion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39299 72102866-910b-0410-8b05-ffd578937521
2016-01-21 12:42:43 +00:00
Richard Frith-MacDonald
912fbca179 Fix error copnverting utf8 constant string to latin1 data
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39298 72102866-910b-0410-8b05-ffd578937521
2016-01-21 12:27:25 +00:00
Niels Grewe
17d379a59a Optimise appending UTF-16 strings for formatting
If the string being appended to already uses unichar as the underlying 
character type, append the new characters using memcpy() instead of
looping over them individually. Also includes test cases to verify that
nothing breaks.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38969 72102866-910b-0410-8b05-ffd578937521
2015-09-04 09:48:07 +00:00
Richard Frith-MacDonald
78c05bfc01 Avoid compiler warnrings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38888 72102866-910b-0410-8b05-ffd578937521
2015-08-16 10:42:48 +00:00
Richard Frith-MacDonald
3b02814665 more updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38803 72102866-910b-0410-8b05-ffd578937521
2015-07-16 08:44:15 +00:00
Richard Frith-MacDonald
8e93dc85d3 More experimental code changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38801 72102866-910b-0410-8b05-ffd578937521
2015-07-15 15:26:29 +00:00
Richard Frith-MacDonald
841ddf78e0 memory usage interrogation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38799 72102866-910b-0410-8b05-ffd578937521
2015-07-15 14:14:21 +00:00
Richard Frith-MacDonald
9d6729f4a7 remove a little unused code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38556 72102866-910b-0410-8b05-ffd578937521
2015-05-26 12:19:02 +00:00
Richard Frith-MacDonald
a43250585a fix sign extension error
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38549 72102866-910b-0410-8b05-ffd578937521
2015-05-26 09:56:55 +00:00
Richard Frith-MacDonald
5ab0c3a6c7 Implement -mutableCopyWithZone: for tiny strings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38543 72102866-910b-0410-8b05-ffd578937521
2015-05-25 18:13:10 +00:00
Richard Frith-MacDonald
293606cda5 more utf8 optimisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38542 72102866-910b-0410-8b05-ffd578937521
2015-05-25 17:55:51 +00:00
Richard Frith-MacDonald
83dda5160c some optionisation of string equality test ... don't compute hash of string
unless the string is large enough to make it worthwhile.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38541 72102866-910b-0410-8b05-ffd578937521
2015-05-25 14:51:02 +00:00