equal
deleted
inserted
replaced
33 */ |
33 */ |
34 LOCAL_C TInt PointerToOffset(const TAny* aAny, TInt aHeapBase) |
34 LOCAL_C TInt PointerToOffset(const TAny* aAny, TInt aHeapBase) |
35 { |
35 { |
36 if (aAny && aHeapBase) |
36 if (aAny && aHeapBase) |
37 { |
37 { |
38 return (TInt)aAny - (TInt)aHeapBase; |
38 return reinterpret_cast<TInt>(aAny) - aHeapBase; |
39 } |
39 } |
40 return 0; |
40 return 0; |
41 } |
41 } |
42 |
42 |
43 /** Helper function for converting an offset (that was calculated using |
43 /** Helper function for converting an offset (that was calculated using |
45 @param aOffset The offset to be converted to a pointer. |
45 @param aOffset The offset to be converted to a pointer. |
46 @param aHeapBase The heap base of the current process. |
46 @param aHeapBase The heap base of the current process. |
47 @return A pointer relative to the passed heap base. |
47 @return A pointer relative to the passed heap base. |
48 @see PointerToOffset() |
48 @see PointerToOffset() |
49 */ |
49 */ |
50 LOCAL_C TAny* OffsetToPointer(const TInt aOffset, TInt aHeapBase) |
50 LOCAL_C TAny* OffsetToPointer(TInt aOffset, TInt aHeapBase) |
51 { |
51 { |
52 if (aOffset && aHeapBase) |
52 if (aOffset && aHeapBase) |
53 { |
53 { |
54 return (TAny*)(aOffset + (TInt)aHeapBase); |
54 return reinterpret_cast<TAny*>(aOffset + aHeapBase); |
55 } |
55 } |
56 return NULL; |
56 return NULL; |
57 } |
57 } |
58 |
58 |
59 CFbClient::CFbClient(RHeap* aHeap): |
59 CFbClient::CFbClient(RHeap* aHeap): |