blob: 4c813a0dc386625bc75157578089a285bd328214 (
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
|
// Test05.cpp
#include "nsINode.h"
#include "nsCOMPtr.h"
NS_DEF_PTR(nsINode);
/*
Windows:
raw, nsCOMPtr 21 bytes
Macintosh:
Raw, nsCOMPtr 64 bytes
*/
class Test05_Raw {
public:
Test05_Raw();
~Test05_Raw();
void /*nsresult*/ GetNode(nsINode** aNode);
private:
nsINode* 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(nsINode** 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(nsINode** aNode);
private:
nsCOMPtr<nsINode> mNode;
};
void // nsresult
Test05_nsCOMPtr::GetNode(nsINode** aNode)
// m64, w21
{
// if ( !aNode )
// return NS_ERROR_NULL_POINTER;
*aNode = mNode;
NS_IF_ADDREF(*aNode);
// return NS_OK;
}
|