~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty

« back to all changes in this revision

Viewing changes to Source/NSCopyObject.m

Tags: upstream-1.20.0
ImportĀ upstreamĀ versionĀ 1.20.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
   Boston, MA 02111 USA.
23
23
 
24
24
   <title>NSCopyObject class reference</title>
25
 
   $Date: 2008-06-08 11:38:33 +0100 (Sun, 08 Jun 2008) $ $Revision: 26606 $
 
25
   $Date: 2010-02-25 11:49:31 -0700 (Thu, 25 Feb 2010) $ $Revision: 29753 $
26
26
   */
27
27
 
28
 
#include "config.h"
29
 
#include "GNUstepBase/preface.h"
30
 
#include "Foundation/NSObject.h"
 
28
#import "common.h"
31
29
 
32
 
NSObject *NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone)
 
30
NSObject *NSCopyObject(NSObject *anObject, NSUInteger extraBytes, NSZone *zone)
33
31
{
34
32
  id copy = NSAllocateObject(((id)anObject)->class_pointer, extraBytes, zone);
35
33
  memcpy(copy, anObject,
36
 
         ((id)anObject)->class_pointer->instance_size + extraBytes);
 
34
    class_getInstanceSize(object_getClass(anObject)) + extraBytes);
37
35
  return copy;
38
36
}