diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2017-06-07 16:14:47 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2017-06-07 16:14:47 -0400 |
| commit | 011237c2f48381f8341633d84d5ba8f13c80d7a6 (patch) | |
| tree | 278ff6e8bb9bddd0d83310931c3abfb8c8de87b3 | |
| parent | 332da554c67ede42217f4bb6fdf29192a57fca46 (diff) | |
| download | pyisda-011237c2f48381f8341633d84d5ba8f13c80d7a6.tar.gz | |
partial revert of 332da55
| -rw-r--r-- | pyisda/curve.pxd | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd index f736f30..4b6b362 100644 --- a/pyisda/curve.pxd +++ b/pyisda/curve.pxd @@ -7,9 +7,6 @@ from libc.string cimport memcpy from libc.stdlib cimport malloc, calloc, free from libc.stdint cimport uint64_t -cdef extern from "string.h" nogil: - void* mempcpy(void* dest, const void* src, size_t n) - cdef extern from "isda/zerocurve.h" nogil: ctypedef int TBoolean @@ -50,10 +47,14 @@ cdef inline size_t TCurve_size(int num_items) nogil: sizeof(long) + sizeof(TRatePt) * num_items cdef inline void serialize(TCurve* curve, unsigned char* buf) nogil: - buf = <unsigned char*>mempcpy(buf, &(curve.fNumItems), sizeof(curve.fNumItems)) - buf = <unsigned char*>mempcpy(buf, curve.fArray, sizeof(TRatePt) * curve.fNumItems) - buf = <unsigned char*>memcpy(buf, &(curve.fBaseDate), sizeof(TDate)) - buf = <unsigned char*>mempcpy(buf, &(curve.fBasis), sizeof(double)) + memcpy(buf, &(curve.fNumItems), sizeof(curve.fNumItems)) + buf += sizeof(curve.fNumItems) + memcpy(buf, curve.fArray, sizeof(TRatePt) * curve.fNumItems) + buf += sizeof(TRatePt) * curve.fNumItems + memcpy(buf, &(curve.fBaseDate), sizeof(TDate)) + buf += sizeof(TDate) + memcpy(buf, &(curve.fBasis), sizeof(double)) + buf += sizeof(double) memcpy(buf, &(curve.fDayCountConv), sizeof(long)) cdef inline unsigned char* deserialize(unsigned char* buf, TCurve* curve) nogil: |
