Skip to content

Commit d5a0f55

Browse files
committed
license header and style cleanup
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
1 parent 41245cb commit d5a0f55

File tree

8 files changed

+27
-46
lines changed

8 files changed

+27
-46
lines changed

os/linux_base.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
/*
2-
* @APPLE_APACHE_LICENSE_HEADER_START@
2+
* This source file is part of the Swift.org open source project
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Copyright (c) 2015 Apple Inc. and the Swift project authors
75
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
6+
* Licensed under Apache License v2.0 with Runtime Library Exception
97
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
8+
* See http://swift.org/LICENSE.txt for license information
9+
* See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1510
*
16-
* @APPLE_APACHE_LICENSE_HEADER_END@
1711
*/
1812

1913
#ifndef __OS_LINUX_BASE__

src/io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ static void
20672067
_dispatch_operation_advise(dispatch_operation_t op, size_t chunk_size)
20682068
{
20692069
#ifndef F_RDADVISE
2070-
LINUX_PORT_ERROR();
2070+
LINUX_PORT_ERROR();
20712071
#else
20722072
int err;
20732073
struct radvisory advise;

src/provider.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ provider dispatch {
6666
*
6767
* Timer configuration indicates that dispatch_source_set_timer() was called.
6868
* Timer programming indicates that the dispatch manager is about to sleep
69-
* for 'deadline' (but may wake up earlier if non-timer events occur).
69+
* for 'deadline' ns (but may wake up earlier if non-timer events occur).
7070
* Time parameters are in nanoseconds, a value of -1 means "forever".
7171
*
7272
* dispatch$target:libdispatch*.dylib::timer-configure

src/semaphore.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ _dispatch_thread_semaphore_create(void)
712712
}
713713
return s4;
714714
#elif USE_POSIX_SEM
715-
sem_t* s4 = malloc(sizeof(sem_t));
715+
sem_t *s4 = _dispatch_calloc(1ul, sizeof(sem_t));
716716
int ret = sem_init(s4, 0, 0);
717717
DISPATCH_SEMAPHORE_VERIFY_RET(ret);
718718
return (_dispatch_thread_semaphore_t)s4;
@@ -738,7 +738,7 @@ _dispatch_thread_semaphore_dispose(_dispatch_thread_semaphore_t sema)
738738
DISPATCH_VERIFY_MIG(kr);
739739
DISPATCH_SEMAPHORE_VERIFY_KR(kr);
740740
#elif USE_POSIX_SEM
741-
sem_t *s4 = (sem_t*)sema;
741+
sem_t *s4 = (sem_t *)sema;
742742
int ret = sem_destroy(s4);
743743
free(s4);
744744
DISPATCH_SEMAPHORE_VERIFY_RET(ret);
@@ -763,7 +763,7 @@ _dispatch_thread_semaphore_signal(_dispatch_thread_semaphore_t sema)
763763
kern_return_t kr = semaphore_signal(s4);
764764
DISPATCH_SEMAPHORE_VERIFY_KR(kr);
765765
#elif USE_POSIX_SEM
766-
sem_t *s4 = (sem_t*)sema;
766+
sem_t *s4 = (sem_t *)sema;
767767
int ret = sem_post(s4);
768768
DISPATCH_SEMAPHORE_VERIFY_RET(ret);
769769
#elif USE_WIN32_SEM
@@ -789,7 +789,7 @@ _dispatch_thread_semaphore_wait(_dispatch_thread_semaphore_t sema)
789789
} while (slowpath(kr == KERN_ABORTED));
790790
DISPATCH_SEMAPHORE_VERIFY_KR(kr);
791791
#elif USE_POSIX_SEM
792-
sem_t *s4 = (sem_t*)sema;
792+
sem_t *s4 = (sem_t *)sema;
793793
int ret;
794794
do {
795795
ret = sem_wait(s4);

src/shims/linux_stubs.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
/*
2-
* @APPLE_APACHE_LICENSE_HEADER_START@
2+
* This source file is part of the Swift.org open source project
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Copyright (c) 2015 Apple Inc. and the Swift project authors
75
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
6+
* Licensed under Apache License v2.0 with Runtime Library Exception
97
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
8+
* See http://swift.org/LICENSE.txt for license information
9+
* See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1510
*
16-
* @APPLE_APACHE_LICENSE_HEADER_END@
1711
*/
1812

19-
2013
/*
2114
* This file contains stubbed out functions we are using during
2215
* the initial linux port. When the port is complete, this file

src/shims/linux_stubs.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
/*
2-
* @APPLE_APACHE_LICENSE_HEADER_START@
2+
* This source file is part of the Swift.org open source project
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Copyright (c) 2015 Apple Inc. and the Swift project authors
75
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
6+
* Licensed under Apache License v2.0 with Runtime Library Exception
97
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
8+
* See http://swift.org/LICENSE.txt for license information
9+
* See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1510
*
16-
* @APPLE_APACHE_LICENSE_HEADER_END@
1711
*/
1812

1913
// forward declarations for functions we are stubbing out

src/source.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4737,7 +4737,7 @@ _dispatch_mach_debug_attr(dispatch_mach_t dm, char* buf, size_t bufsiz)
47374737
{
47384738
#ifdef __LINUX_PORT_HDD__
47394739
LINUX_PORT_ERROR();
4740-
return (size_t)0;
4740+
return 0;
47414741
#else
47424742
dispatch_queue_t target = dm->do_targetq;
47434743
return dsnprintf(buf, bufsiz, "target = %s[%p], receive = 0x%x, "
@@ -4759,7 +4759,7 @@ _dispatch_mach_debug(dispatch_mach_t dm, char* buf, size_t bufsiz)
47594759
{
47604760
#ifdef __LINUX_PORT_HDD__
47614761
LINUX_PORT_ERROR();
4762-
return (size_t)0;
4762+
return 0;
47634763
#else
47644764
size_t offset = 0;
47654765
offset += dsnprintf(&buf[offset], bufsiz - offset, "%s[%p] = { ",

src/transform.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ _dispatch_transform_from_utf16le(dispatch_data_t data)
533533
{
534534
#ifdef __LINUX_PORT_HDD__
535535
LINUX_PORT_ERROR();
536-
return (dispatch_data_t)0;
536+
return NULL;
537537
#else
538538
return _dispatch_transform_from_utf16(data, OSLittleEndian);
539539
#endif
@@ -544,7 +544,7 @@ _dispatch_transform_from_utf16be(dispatch_data_t data)
544544
{
545545
#ifdef __LINUX_PORT_HDD__
546546
LINUX_PORT_ERROR();
547-
return (dispatch_data_t)0;
547+
return NULL;
548548
#else
549549
return _dispatch_transform_from_utf16(data, OSBigEndian);
550550
#endif
@@ -555,7 +555,7 @@ _dispatch_transform_to_utf16le(dispatch_data_t data)
555555
{
556556
#ifdef __LINUX_PORT_HDD__
557557
LINUX_PORT_ERROR();
558-
return (dispatch_data_t)0;
558+
return NULL;
559559
#else
560560
return _dispatch_transform_to_utf16(data, OSLittleEndian);
561561
#endif
@@ -566,7 +566,7 @@ _dispatch_transform_to_utf16be(dispatch_data_t data)
566566
{
567567
#ifdef __LINUX_PORT_HDD__
568568
LINUX_PORT_ERROR();
569-
return (dispatch_data_t)0;
569+
return NULL;
570570
#else
571571
return _dispatch_transform_to_utf16(data, OSBigEndian);
572572
#endif

0 commit comments

Comments
 (0)