 |
Changeset 3418
- Timestamp:
- 04/07/08 19:34:50
(8 months ago)
- Author:
- sean
- Message:
Applied DMD 1.028 changes. Left old license in place however.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1856 |
r3418 |
|
| 41 | 41 | { |
|---|
| 42 | 42 | debug printf("f = %p,%d, t = %p,%d, size = %d\n", |
|---|
| 43 | | cast(void*)from, from.length, cast(void*)to, to.length, size); |
|---|
| | 43 | from.ptr, from.length, to.ptr, to.length, size); |
|---|
| 44 | 44 | |
|---|
| 45 | 45 | if (to.length != from.length) |
|---|
| … | … | |
| 47 | 47 | throw new Exception("lengths don't match for array copy"); |
|---|
| 48 | 48 | } |
|---|
| 49 | | else if (cast(byte *)to + to.length * size <= cast(byte *)from || |
|---|
| 50 | | cast(byte *)from + from.length * size <= cast(byte *)to) |
|---|
| | 49 | else if (to.ptr + to.length * size <= from.ptr || |
|---|
| | 50 | from.ptr + from.length * size <= to.ptr) |
|---|
| 51 | 51 | { |
|---|
| 52 | | memcpy(cast(byte *)to, cast(byte *)from, to.length * size); |
|---|
| | 52 | memcpy(to.ptr, from.ptr, to.length * size); |
|---|
| 53 | 53 | } |
|---|
| 54 | 54 | else |
|---|
| 55 | 55 | { |
|---|
| 56 | 56 | throw new Exception("overlapping array copy"); |
|---|
| 57 | | } |
|---|
| | 57 | } |
|---|
| 58 | 58 | return to; |
|---|
| 59 | 59 | } |
|---|
| r1856 |
r3418 |
|
| 41 | 41 | { |
|---|
| 42 | 42 | debug printf("f = %p,%d, t = %p,%d, size = %d\n", |
|---|
| 43 | | cast(void*)from, from.length, cast(void*)to, to.length, size); |
|---|
| | 43 | from.ptr, from.length, to.ptr, to.length, size); |
|---|
| 44 | 44 | |
|---|
| 45 | 45 | if (to.length != from.length) |
|---|
| … | … | |
| 47 | 47 | throw new Exception("lengths don't match for array copy"); |
|---|
| 48 | 48 | } |
|---|
| 49 | | else if (cast(byte *)to + to.length * size <= cast(byte *)from || |
|---|
| 50 | | cast(byte *)from + from.length * size <= cast(byte *)to) |
|---|
| | 49 | else if (to.ptr + to.length * size <= from.ptr || |
|---|
| | 50 | from.ptr + from.length * size <= to.ptr) |
|---|
| 51 | 51 | { |
|---|
| 52 | | memcpy(cast(byte *)to, cast(byte *)from, to.length * size); |
|---|
| | 52 | memcpy(to.ptr, from.ptr, to.length * size); |
|---|
| 53 | 53 | } |
|---|
| 54 | 54 | else |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic