Commit graph

8145 commits

Author SHA1 Message Date
Richard Frith-Macdonald
8f0a021adb Fix failure to send large requests, when the write operation succeeds but we have not written all the data we need to, we should write more as long as the stream has space available. 2021-02-06 11:23:09 +00:00
Richard Frith-Macdonald
b8169e26eb Fix null pointer dereference 2021-02-04 11:00:05 +00:00
Richard Frith-Macdonald
be173ab404 Fix resource leaks (failure to close) on error. 2021-02-03 16:23:43 +00:00
Frederik Seiffert
61709e6101 Support building on Windows with Clang MSVC target 2021-02-03 15:02:27 +01:00
Riccardo Mottola
ece6fc97ff Add check for statbuf.st_mtim if available and use statbuf.st_mtim to get nanosecond precision in modification date, also fix conversion of nanoseconds in creation date. 2021-02-02 23:30:18 +01:00
Richard Frith-Macdonald
625e8541a9 Call -cancel at the end of a synchronous load so that we stop our NSURLProtocol instance from retaining us as its client. 2021-01-26 14:38:29 +00: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
4d0dc010ab Was checking incorrect variable to avoid assignment to nul pointer. 2021-01-21 14:27:21 +00:00
Richard Frith-Macdonald
72af51982f fix leak of set 2021-01-18 12:20:46 +00:00
Richard Frith-Macdonald
925023e8c0 Fix leak evaluating a cast 2021-01-18 11:56:44 +00:00
Richard Frith-Macdonald
d63b2e0035 Fix memory leaks 2021-01-18 11:52:37 +00:00
Richard Frith-Macdonald
fe7d9b6435 Use NSZoneMalloc and NSZoneRealloc for memory used by data, so it is in the correct zone for the instance (and to avoid complaints from static analyser). 2021-01-18 11:47:39 +00:00
Richard Frith-Macdonald
dca9b65313 Remove stream from handler upon deallocation, to avlid handler sending messages to deallocated stream. 2021-01-16 06:23:25 +00:00
Richard Frith-Macdonald
fa27dfeed4 Fix failure to re-set flag to say whether a string is unicode 2020-12-30 09:12:37 -05:00
Richard Frith-Macdonald
d664bd89e8 Fix potential problem with new optimisation for direct access to contents of 8bit strings ... when the decimal separator is not an ascii character we may need to convert the 8bit value to unicode. 2020-12-30 12:54:19 +00:00
Richard Frith-Macdonald
3dc437524e Use new private method to scan double values. 2020-12-30 12:25:18 +00:00
Richard Frith-Macdonald
657e49edeb Remove internal GSScanInt and GSScanDouble functions after moving functionality into the -scanDouble: method. Add private class method to support scanning a string for a double without having to create a new scanner each time (use a shared lock-protected, instance with resetting of the string being scanned). 2020-12-30 11:58:19 +00:00
Richard Frith-Macdonald
168dd211e3 remove unused header import 2020-12-30 11:55:44 +00:00
Richard Frith-Macdonald
95c10d7fa7 Use superclass implementation of -doubleValue and -floatValue 2020-12-30 11:54:57 +00:00
Richard Frith-Macdonald
81021528e1 Change -scanDouble: to call GSScanDouble() to perform conversion. Fix GSScanDouble to cope with leading zeros. 2020-12-29 11:54:34 +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
bcbdeb64a8 Fix initialisation of NSUUID from string (permit mixed case hex digits) 2020-12-15 10:40:55 +00:00
Richard Frith-Macdonald
c1d98567a8 fixup incorrect commit 2020-12-11 12:19:52 +00:00
Richard Frith-Macdonald
31fbd3f9c7 Improve diagnostic logging 2020-12-11 12:12:59 +00:00
Richard Frith-Macdonald
afde524e82 Fix unused variable on windows 2020-12-09 16:37:22 +00:00
Richard Frith-Macdonald
c2fea0a825 Add fake interface for NSUserDefaultsWin32 to avoid compiler warning 2020-12-09 15:17:46 +00:00
Richard Frith-Macdonald
02b69ca57e Only declare variables for systems which use them. 2020-12-09 15:12:11 +00:00
Richard Frith-Macdonald
db4c3c1006 Fix typo in comment (incorrect RFC number) 2020-12-07 11:46:09 -05:00
Richard Frith-Macdonald
b8f1fc4129 Avoid compiler warnings when we do not have real blocks 2020-12-07 07:47:15 -05:00
Richard Frith-Macdonald
dfba8adba7 Fixup to import local headers rather than installed versions 2020-12-07 07:34:44 -05:00
Richard Frith-Macdonald
ea9aa71eeb Avoid compiler warnings on system with pseudo-blocks 2020-12-07 07:23:30 -05:00
Richard Frith-Macdonald
10a8e9faf8 fix format string error in -description 2020-12-07 11:21:16 +00:00
Richard Frith-Macdonald
3bf1fc5490 Improve diagnostic output 2020-12-07 11:18:51 +00:00
Richard Frith-Macdonald
d7e5158a09 An error in a socketpair only applies to the other socket if still opening 2020-12-06 09:38:17 -05:00
Richard Frith-Macdonald
71e636cf49 Use uinsigned logn for fast enumeration version counter 2020-12-04 11:16:13 -05:00
Richard Frith-Macdonald
e111315f87 fix typo 2020-12-04 11:09:33 -05:00
Richard Frith-Macdonald
09e527c0fd Fix to make value pointed to by mutationsPtr be unsigned long. 2020-12-04 11:08:16 -05:00
Richard Frith-Macdonald
897e5fc7dd Fix range check for decoded 32bit integer 2020-12-04 06:04:22 -05:00
Richard Frith-Macdonald
60038cbf38 Merge branch 'master' of ssh://github.com/gnustep/libs-base into master 2020-12-04 04:44:02 -05:00
Richard Frith-Macdonald
02d1cbd34d Suppress warnings about use of 'private' functions from libdispatch 2020-12-04 04:43:28 -05:00
Richard Frith-Macdonald
190bafad72 declare external block as const void rather than void for consistency and to avoid compiler warning 2020-12-04 04:36:42 -05:00
Richard Frith-Macdonald
aeca9c8698 Suppress dll import warnings for objc_enumerationMutation() on mingw 2020-12-04 04:25:39 -05:00
Richard Frith-Macdonald
468b62bdde use memcpy rather than strncpy to avoid compiler warnings 2020-12-03 12:54:41 -05:00
Richard Frith-Macdonald
facfbad126 avoid compiler warning 2020-12-03 12:48:22 -05:00
Richard Frith-Macdonald
8141fe03f7 use memcpy rather than strncpy to avoid compiler warning 2020-12-03 12:29:53 -05:00
Richard Frith-Macdonald
679272b50c Use memcpy rather than strncpy/strncat to avoid compiler warnings 2020-12-03 12:07:33 -05:00
Richard Frith-Macdonald
379f5f0040 use memcpy rather than strncpy to avoid compiler warnings 2020-12-03 11:59:37 -05:00
Richard Frith-Macdonald
f18594ff3e tweaks to avoid compiler warnings 2020-12-03 11:56:14 -05:00
Richard Frith-Macdonald
1b7bf26bea Merge changes for NSURLSession from EngageHub (formerly Brainstorm). 2020-11-29 06:57:47 -05: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
3bb72398ee Report YES for GSImmutableString being a proxy 2020-11-22 08:08:00 -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
1170e0c0c1 add casts to avoid compiler warnings 2020-11-20 01:42:33 -05:00
Richard Frith-Macdonald
aa0beb0758 Minor tidyup for clearer indentation 2020-11-19 08:33:20 -05:00
Richard Frith-Macdonald
8178e52806 Correct checks for validity of the second UTF16 value in a surrogate pair 2020-11-19 08:27:06 -05:00
rfm
d27dcfbed6
Merge pull request #164 from triplef/add-nsfilehandle-url-methods
Add NSFileHandle URL initializers.
2020-11-18 09:21:13 +00:00
Richard Frith-Macdonald
e7035cadf3 Be defensive about checking for key beginning with @ 2020-11-18 09:09:48 +00:00
Frederik Seiffert
88a2e0809f Add NSFileHandle URL initializers.
Also use "instancetype" for all initializers.
2020-11-17 19:48:05 +01:00
Richard Frith-Macdonald
d4df4b6d87 Add methods to control size of in-memory queue os emails 2020-11-14 04:25:34 +00:00
Richard Frith-Macdonald
23d431234c Fix bug in offset 2020-11-13 05:41:42 +00:00
Richard Frith-Macdonald
a34beadb8e Merge branch 'gnustep_testplant_mergeback' of https://github.com/TestPlant/libs-base into TestPlant-gnustep_testplant_mergeback
Conflicts:
	ChangeLog
2020-11-13 05:39:15 +00:00
Frederik Seiffert
06fa7792a5 Fix compilation with ICU 68. 2020-11-12 17:18:09 +01:00
Richard Frith-Macdonald
ae90743153 Avoid building unused functions when new string API is used. 2020-11-11 22:23:13 +00:00
rfm
17af685b1a
Merge branch 'master' into nsurl-additions 2020-11-06 09:36:42 +00:00
rfm
8ccd6e2675
Merge pull request #102 from Artoria2e5/pluti
Add plutil utility
2020-11-06 09:12:33 +00:00
Richard Frith-Macdonald
efabfab3d0 Merge branch 'master' of ssh://github.com/gnustep/libs-base 2020-10-29 09:05:51 +00:00
Richard Frith-Macdonald
2b840550f0 Improve logging of an exception when posting a notification so that, if possible, we include the details of the notification being posted. 2020-10-29 09:04:51 +00:00
Gregory John Casamento
2ba26ce34a fix for compilation error 2020-10-27 09:44:21 -04:00
Gregory Casamento
e5a7733f04
Merge pull request #161 from gnustep/nsurlconnection_10_5_methods
Add methods from 10.5
2020-10-27 08:14:22 -04:00
Gregory John Casamento
85f590f88e Add methods for 10.5 2020-10-26 23:53:11 -04:00
Richard Frith-Macdonald
feac65a23f Fix use of potentially invalid value from heap 2020-10-24 17:54:55 +01:00
Adam Fox
0b69d88ee2 Implementation of [NSData rangeOfData:options:range], adapted from [NSString rangeOfString:options:range]. 2020-10-12 12:22:00 -06:00
Richard Frith-Macdonald
ba5b950fa5 fix retain/release error 2020-10-11 11:24:49 +01:00
Richard Frith-Macdonald
57efbdb09e improve comments 2020-10-03 15:18:21 +01:00
Richard Frith-Macdonald
21839365a9 Remove unnecessary retain/release 2020-09-30 10:08:36 +01:00
Richard Frith-Macdonald
98dfa140ec added autorelease pool around each operation to catch any autoreleased
objects produced by the operation being executed. This should prevent
objects living until the end of the thread.
2020-09-30 09:56:24 +01:00
Richard Frith-Macdonald
6ae48bd3d3 Tidied code 2020-09-30 09:55:43 +01:00
Richard Frith-Macdonald
7977bcb19d Tidied some whitespace/indentation and removed obsolete comment 2020-09-21 11:41:39 +01:00
Riccardo Mottola
18dfe7b8f6 Windows linker doesn't really support WEAK symbols, not even with gcc10. binutils 2.3.5 fails to link because not all symbols were exported 2020-09-17 23:46:37 +02:00
Richard Frith-Macdonald
938f280b87 Implement fast enumeration for insensitive dictionary 2020-09-08 15:14:19 +01:00
fredkiefer
7dc4a8f532 Add missing break 2020-09-05 22:34:48 +02:00
Richard Frith-Macdonald
1ddcb25b7e Avcoid coverity warning 2020-08-23 16:01:21 +01:00
Richard Frith-Macdonald
32f306b615 avoid coverity warning 2020-08-23 15:48:47 +01:00
fredkiefer
93d4576871 * Source/NSDateComponentsFormatter.m: Fix use of wrong operator. 2020-08-30 22:27:08 +02:00
Richard Frith-Macdonald
48c270b9ca Improve -contentFile to check the content-type header before content-disposition 2020-08-08 19:30:18 +01:00
Frederik Seiffert
01e7034262 Add NSURL methods:
- URLByAppendingPathComponent:isDirectory:
- isFileReferenceURL (always returns NO)
- fileReferenceURL
- filePathURL
2020-08-03 13:08:15 +02:00
Richard Frith-Macdonald
1f2b03e84d Fix calls to utimensat() which were passing the wrong value for the first argument, which needs to be the file descriptor of the directory containing the file, or AT_FDCWD to use the current directory. 2020-07-31 16:00:36 +01:00
Richard Frith-Macdonald
62c68d3cab Set dates on copy ... it turns our OSX does not behave like Posix 2020-07-31 15:29:02 +01:00
Riccardo Mottola
24261fdc45 explicitely allow disabling unwind, test for header and function too 2020-07-28 01:02:55 +02:00
Frederik Seiffert
b9a9481c56 Update NSURLRequest header to use "instancetype". 2020-07-14 09:21:53 +02:00
Richard Frith-Macdonald
291ad8384e move deallocation of zombie map outside lock protected section so that any exception while deallocating will not cause unbalanced lock/unlock 2020-07-09 09:11:47 +01:00
Richard Frith-Macdonald
684e952b04 When copying objects we should not be attempting to set the creation/modification date of the copy to that of the original. 2020-07-09 09:10:30 +01:00
Richard Frith-Macdonald
0c302348b0 Add casts to prevent compiler warnings, and comment to explain the new change for android where there is no thread ID available from the operating system. 2020-07-09 09:09:19 +01:00
Frederik Seiffert
94d14ca02a Don't log current thread if its identical to private thread ID. 2020-07-08 17:02:41 +02:00
Frederik Seiffert
3752016412 Improve NSLog output on Android. 2020-07-08 16:15:57 +02:00
rfm
69c9e77afb
Merge pull request #146 from gnustep/msys-fix
Fix MSYS2-32
2020-07-08 13:59:07 +01:00
Richard Frith-Macdonald
47b6defc26 We only need to set the ownership of a newly created file on unix-like systems where the effective user ID may be different from the real user ID. 2020-07-07 07:42:40 +01:00
Frederik Seiffert
a7e87824c0 Fix possible deadlock when becoming multi-threaded. 2020-07-06 22:01:01 +02:00
Richard Frith-Macdonald
8e97401783 Replace temporarty hack with a rewrite of whitespace checking to use our own
characterset data (derived from unicode data) on which characters are counted
as whitespace for the purpose of capitalising strings.
counted as white space
2020-06-27 08:33:13 +01:00
Richard Frith-Macdonald
31ea5db30b When overwriting a file with data, do not attempt to set creation date.
When creaqting a new file, try to use the real uid when effective uid is root
2020-06-25 09:19:44 +01:00
Richard Frith-Macdonald
b7882e3194 Simple fix to check for whitespace characters using strchr since the old
mechanism using characterset bitmap representations was broken by the
change to reduce waste in bintmaps (the code assumed the bitmap was
bigger than it really is).
2020-06-24 11:35:29 +01:00
Richard Frith-Macdonald
8acf2a5304 Merge branch 'master' of ssh://github.com/gnustep/libs-base 2020-06-23 07:05:34 +01:00
Richard Frith-Macdonald
e8a62e0e5e Check for nil arugment to -isEqualToString: 2020-06-23 07:03:55 +01:00
Riccardo Mottola
e1c32adb77 define WSAAPI to empty if it is undefined, just for safety 2020-06-19 09:03:06 +02:00
Riccardo Mottola
919f8c16d0 specify WSAAPI as return type too, needed for MSYS2-32bit 2020-06-15 23:52:35 +02:00
Gregory John Casamento
fff7573b88 Correct changelog 2020-06-14 20:21:12 -04:00
Richard Frith-Macdonald
057445b4e7 Merge branch 'master' of ssh://github.com/gnustep/libs-base 2020-06-11 16:30:49 +01:00
Gregory John Casamento
c8ab7a3bc2 Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2 2020-06-11 09:38:20 -04:00
Frederik Seiffert
d6d2fa9a74 Fix recursive creation of value transformers. 2020-06-11 14:22:04 +02:00
Frederik Seiffert
c6f24e6634 Fix Android assets support for bundle directories 2020-06-10 20:31:03 +02:00
Riccardo Mottola
b879e0835b explicitely test for ws2tcpip.h header, fix library detection on windows for inet_ntop with corrent library, guard includes and definitions with configure results, cleanup header inclusion 2020-06-09 13:44:42 +02:00
Richard Frith-Macdonald
41ab84eaba So not attempt to alter creation date of newly created file. 2020-06-09 11:43:56 +01:00
Gregory John Casamento
3b315b9d21 Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2 2020-06-08 04:12:45 -04:00
rfm
daadfe7a6d
Merge branch 'master' into android-assets-directory-improvements 2020-06-06 12:13:43 +01:00
rfm
e2d223b564
Merge pull request #142 from gnustep/msys-fix
Msys fix
2020-06-06 11:11:06 +01:00
Richard Frith-Macdonald
41badcb417 Fix leak of new operation in -blockOperationWithBlock: method. Make -addExecutionBlock: ensure it works with an on-heap copy of its argument. Tidy code to have NSBlockOperation methods with normal formatting and alphabetical order. Tidy code to use standard macros for memory management. 2020-06-05 17:43:46 +01:00
Riccardo Mottola
5bbe378a79 remove unneeded window headers include, since common.h will include GSConfig.h 2020-06-05 13:46:34 +02:00
Frederik Seiffert
71f6cde4bd Fix replacing an existing value in a weak objects map table. 2020-06-05 11:55:33 +02:00
Gregory John Casamento
ea162442ce Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2 2020-06-04 18:40:14 -04:00
Richard Frith-Macdonald
a1d5d020b3 Change -objectForKey: method to get the contents into a buffer (on the stack) and iterate through them rather than creating an autoreleased enumerator. This avoids allocation/autorelease/deallocation of the enumerator (as well as etain/release of the search list by the enumerator) which should give better performance generally and avoid excess object creation when lots of defaults lookups are done in an autorelease pool. 2020-06-03 14:48:22 +01:00
Gregory John Casamento
597f0a917e Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2 2020-05-31 17:41:23 -04:00
rfm
bf4c0719aa
Merge pull request #136 from gnustep/windows-ci
Set up CI for Windows using MinGW and GCC
Looks good, merging.
2020-05-29 16:33:42 +01:00
Richard Frith-Macdonald
6fd8dd7a20 Wrap code for posting of notifications (for becoming multithreaded and for a thread being about to exit) in an autorelease loop. This should avoid possible leakage of objects and warnings during the notification process. 2020-05-29 16:25:52 +01:00
Frederik Seiffert
a0fe037077 Include winsock2.h before windows.h, as required by MSYS2/MinGW-w64. 2020-05-29 10:40:03 +02:00
Gregory John Casamento
96f88dcc95 Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2 2020-05-29 00:53:39 -04:00
Richard Frith-Macdonald
fab98ede73 On thread exit we must post the notification that it *will* exit before
setting the instance variable to say that it has finished.  This is tested
as the order OSX does it, and makes sense to ensure that, when -isFinished
returns YES we can be sure the thread will not do anything else.
2020-05-26 16:30:15 +01:00
rfm
a636994a33
Merge pull request #138 from triplef/fix-nsuserdefaults-setbool
Store NSNumber instead of NSString for NSUserDefaults -setBool:forKey:.
2020-05-26 12:38:41 +01:00
Richard Frith-Macdonald
861f8de610 Remove excess whitespace and copy trick to NSPortCoder 2020-05-26 09:18:49 +01:00
Gregory John Casamento
3a0420bddf Merge branch 'master' into NSSecureCoding_branch2 2020-05-26 01:52:58 -04:00
Riccardo Mottola
e7f89135d3 rewrite lower negative bounds to avoid integer constants underflow of literals 2020-05-25 23:50:36 +02:00
Frederik Seiffert
d2938c7729 Store NSNumber instead of NSString for NSUserDefaults -setBool:forKey:. 2020-05-25 17:34:34 +02:00
Frederik Seiffert
db19fc3308 Android assets improvements to support directories
- Extend NSBundle resources support to handle directories in Android assets.
- Fix NSFileManager -isReadableFileAtPath: to also support directories in Android assets.
2020-05-20 13:39:47 +02:00
Gregory John Casamento
2b38728f6e Merge branch 'master' into NSSecureCoding_branch2 2020-05-15 10:08:56 -04:00
Gregory John Casamento
4230180eab Add set/get for requiresSecureCoding 2020-05-15 10:06:39 -04:00
Frederik Seiffert
9f0d8d7720 Fix building Win32 classes with nonfragile ABI. 2020-05-13 18:08:35 +02:00
Gregory John Casamento
1a6a091fc4 Add set/get method for requiresSecureCoding 2020-05-13 02:29:53 -04:00
Gregory John Casamento
a0f50deb64 Fix fred's suggestions. Put guard and make more general method the one which is called. 2020-05-12 14:02:50 -04:00
Gregory John Casamento
be8980dfb4 Fix fred's suggestions. Put guard and make more general method the one which is called. 2020-05-12 14:01:44 -04:00
Gregory John Casamento
9d252bd5b6 Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch 2020-05-12 12:09:27 -04:00
Richard Frith-Macdonald
95b6f3a18e Casts to fix systems where the UCalendarDateFields enumeration is unsigned 2020-05-12 13:35:18 +01:00
rfm
57e4eba479
Merge branch 'master' into file_creation_date 2020-05-12 13:25:49 +01:00
rfm
50d1358028
Merge pull request #132 from niwatako/fix-exponent-validation-in-jsonserialization
Fix exponent validation in NSJSONSerialization
Buce fix ... thanks.
2020-05-12 13:23:29 +01:00
Gregory John Casamento
e294089032 Merge branch 'master' into NSSecureCoding_branch 2020-05-11 16:55:28 -04:00
Gregory John Casamento
4dc1c566c1 Send error back 2020-05-11 16:54:41 -04:00
rfm
6b008fc19e
Merge branch 'master' into android-nsinputstream-support 2020-05-11 15:02:05 +01:00
niwatako
dccd799256 Fix exponent validation 2020-05-11 21:46:25 +09:00
fredkiefer
e71c2f68fa * Source/NSISO8601DateFormatter.m,
* Source/NSOrthography.m: Clean up some compiler warnings.
2020-05-10 23:07:27 +02:00
fredkiefer
f4c5c519c2 * Source/NSXMLParser.m: Fix small bug in last commit that broke
all gui applications when there was a commented out section in the
user default XML file.
2020-05-08 21:59:28 +02:00
Richard Frith-Macdonald
5aab6f84cf Use RELEASE macro for memory management 2020-05-08 15:26:07 +01:00