summaryrefslogtreecommitdiffstats
path: root/src/libs/xpcom18a4/xpcom/tests/SizeTest05.cpp
blob: 0211610ea0692779a3bc0cc6edac83beb84778d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Test05.cpp

#include "nsIDOMNode.h"
#include "nsCOMPtr.h"

#ifdef __MWERKS__
	#pragma exceptions off
#endif

NS_DEF_PTR(nsIDOMNode);

	/*
		Windows:
                        raw, nsCOMPtr           21 bytes

		Macintosh:
                        Raw, nsCOMPtr           64 bytes
	*/

class Test05_Raw
	{
		public:
                        Test05_Raw();
                 ~Test05_Raw();

			void /*nsresult*/ GetNode( nsIDOMNode** aNode );

		private:
			nsIDOMNode* mNode;
	};

Test05_Raw::Test05_Raw()
		: mNode(0)
	{
		// nothing else to do here
	}

Test05_Raw::~Test05_Raw()
	{
		NS_IF_RELEASE(mNode);
	}

void // nsresult
Test05_Raw::GetNode( nsIDOMNode** aNode )
		// m64, w21
	{
//		if ( !aNode )
//			return NS_ERROR_NULL_POINTER;

		*aNode = mNode;
		NS_IF_ADDREF(*aNode);

//		return NS_OK;
	}



class Test05_nsCOMPtr
	{
		public:
			void /*nsresult*/ GetNode( nsIDOMNode** aNode );

		private:
			nsCOMPtr<nsIDOMNode> mNode;
	};

void // nsresult
Test05_nsCOMPtr::GetNode( nsIDOMNode** aNode )
		// m64, w21
	{
//		if ( !aNode )
//			return NS_ERROR_NULL_POINTER;

		*aNode = mNode;
		NS_IF_ADDREF(*aNode);

//		return NS_OK;
	}