|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32std.h> |
|
21 |
|
22 #include "HelloTraceTypes.h" |
|
23 #include "HelloTraceTypesDup.h" |
|
24 #include "HelloTraceTypesDup2.inl" |
|
25 |
|
26 #include "OstTraceDefinitions.h" |
|
27 #ifdef OST_TRACE_COMPILER_IN_USE |
|
28 #include "HelloTraceTypesTraces.h" |
|
29 #endif |
|
30 |
|
31 void HelloTraceTypes::SignedIntegers() |
|
32 { |
|
33 TInt8 eightBit = - (TInt8) 1 << 6; |
|
34 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_SIGNEDINTEGERS_8, |
|
35 "8 bit signed: %hhd", eightBit ); |
|
36 |
|
37 TInt16 sixteenBit = - (TInt16) 1 << 14; |
|
38 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_SIGNEDINTEGERS_16, |
|
39 "16 bit signed: %hd", sixteenBit ); |
|
40 |
|
41 TInt32 thirtyTwoBit = - (TInt32) 1 << 30; |
|
42 OstTrace1( TRACE_INTERNALS, HELLOTRACETYPES_SIGNEDINTEGERS_32, |
|
43 "32 bit signed: %d", thirtyTwoBit ); |
|
44 |
|
45 TInt64 sixtyFourBit = - (TInt64) 1 << 62; |
|
46 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_SIGNEDINTEGERS_64, |
|
47 "64 bit signed: %Ld", sixtyFourBit ); |
|
48 } |
|
49 |
|
50 void HelloTraceTypes::UnsignedIntegers() |
|
51 { |
|
52 TUint8 eightBit = (TUint8) 1 << 6; |
|
53 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_UNSIGNEDINTEGERS_8, |
|
54 "8 bit unsigned: %hhu", eightBit ); |
|
55 |
|
56 TUint16 sixteenBit = (TUint16) 1 << 14; |
|
57 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_UNSIGNEDINTEGERS_16, |
|
58 "16 bit unsigned: %hu", sixteenBit ); |
|
59 |
|
60 TUint32 thirtyTwoBit = (TUint32) 1 << 30; |
|
61 OstTrace1( TRACE_INTERNALS, HELLOTRACETYPES_UNSIGNEDINTEGERS_32, |
|
62 "32 bit unsigned: %u", thirtyTwoBit ); |
|
63 |
|
64 TUint64 sixtyFourBit = (TUint64) 1 << 62; |
|
65 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_UNSIGNEDINTEGERS_64, |
|
66 "64 bit unsigned: %Lu", sixtyFourBit ); |
|
67 } |
|
68 |
|
69 void HelloTraceTypes::Descriptors() |
|
70 { |
|
71 _LIT8(KAscii, "Some ASCII text"); |
|
72 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_ASCII, "8 bit descriptor: %s", KAscii() ); |
|
73 |
|
74 _LIT16(KUnicode, "Some unicode text"); |
|
75 OstTraceExt1( TRACE_INTERNALS, HELLOTRACETYPES_UNICODE, "16 bit descriptor: %S", KUnicode() ); |
|
76 } |