Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
fa861d55
Commit
fa861d55
authored
Nov 22, 2017
by
Ronan
Browse files
fix(core): add explicit on some constructors
parent
f492097c
Changes
10
Hide whitespace changes
Inline
Side-by-side
include/linphone/utils/enum-generator.h
View file @
fa861d55
...
...
@@ -55,7 +55,7 @@ LINPHONE_BEGIN_NAMESPACE
// TODO: This macro should be used but it is triggering a bug in doxygen that
// has been fixed in the 1.8.8 version. See https://bugzilla.gnome.org/show_bug.cgi?id=731985
// Meanwhile use 2 different macros
// Meanwhile use 2 different macros
.
#if 0
#define L_DECLARE_C_ENUM(NAME, VALUES) \
typedef enum L_CONCAT(_, L_CONCAT(L_C_ENUM_PREFIX, NAME)) { \
...
...
src/address/address.cpp
View file @
fa861d55
...
...
@@ -39,33 +39,33 @@ Address::Address (const string &address) : ClonableObject(*new AddressPrivate) {
}
}
Address
::
Address
(
const
Address
&
src
)
:
ClonableObject
(
*
new
AddressPrivate
)
{
L_D
();
SalAddress
*
salAddress
=
src
.
getPrivate
()
->
internalAddress
;
if
(
salAddress
)
d
->
internalAddress
=
sal_address_clone
(
salAddress
);
}
Address
::
Address
(
const
IdentityAddress
&
src
)
:
ClonableObject
(
*
new
AddressPrivate
)
{
Address
::
Address
(
const
IdentityAddress
&
identityAddress
)
:
ClonableObject
(
*
new
AddressPrivate
)
{
L_D
();
const
string
&
username
=
src
.
getUsername
();
const
string
&
username
=
identityAddress
.
getUsername
();
if
(
username
.
empty
())
return
;
const
string
&
domain
=
src
.
getDomain
();
const
string
&
domain
=
identityAddress
.
getDomain
();
if
(
domain
.
empty
())
return
;
string
uri
=
src
.
getScheme
()
+
":"
+
username
+
"@"
+
(
string
uri
=
identityAddress
.
getScheme
()
+
":"
+
username
+
"@"
+
(
domain
.
find
(
':'
)
!=
string
::
npos
?
"["
+
domain
+
"]"
:
domain
);
if
(
src
.
hasGruu
())
uri
+=
";gr="
+
src
.
getGruu
();
if
(
identityAddress
.
hasGruu
())
uri
+=
";gr="
+
identityAddress
.
getGruu
();
d
->
internalAddress
=
sal_address_new
(
L_STRING_TO_C
(
uri
));
}
Address
::
Address
(
const
Address
&
src
)
:
ClonableObject
(
*
new
AddressPrivate
)
{
L_D
();
SalAddress
*
salAddress
=
src
.
getPrivate
()
->
internalAddress
;
if
(
salAddress
)
d
->
internalAddress
=
sal_address_clone
(
salAddress
);
}
Address
::~
Address
()
{
L_D
();
if
(
d
->
internalAddress
)
...
...
src/address/address.h
View file @
fa861d55
...
...
@@ -41,8 +41,8 @@ class LINPHONE_PUBLIC Address : public ClonableObject {
public:
explicit
Address
(
const
std
::
string
&
address
=
""
);
Address
(
const
IdentityAddress
&
identityAddress
);
Address
(
const
Address
&
src
);
Address
(
const
IdentityAddress
&
src
);
~
Address
();
Address
&
operator
=
(
const
Address
&
src
);
...
...
src/address/identity-address.cpp
View file @
fa861d55
...
...
@@ -42,20 +42,21 @@ IdentityAddress::IdentityAddress (const string &address) : ClonableObject(*new I
}
}
IdentityAddress
::
IdentityAddress
(
const
Identity
Address
&
src
)
:
ClonableObject
(
*
new
IdentityAddressPrivate
)
{
IdentityAddress
::
IdentityAddress
(
const
Address
&
address
)
:
ClonableObject
(
*
new
IdentityAddressPrivate
)
{
L_D
();
d
->
scheme
=
src
.
getScheme
();
d
->
username
=
src
.
getUsername
();
d
->
domain
=
src
.
getDomain
();
d
->
gruu
=
src
.
getGruu
();
d
->
scheme
=
address
.
getScheme
();
d
->
username
=
address
.
getUsername
();
d
->
domain
=
address
.
getDomain
();
if
(
address
.
hasUriParam
(
"gr"
))
d
->
gruu
=
address
.
getUriParamValue
(
"gr"
);
}
IdentityAddress
::
IdentityAddress
(
const
Address
&
src
)
:
ClonableObject
(
*
new
IdentityAddressPrivate
)
{
IdentityAddress
::
IdentityAddress
(
const
Identity
Address
&
src
)
:
ClonableObject
(
*
new
IdentityAddressPrivate
)
{
L_D
();
d
->
scheme
=
src
.
getScheme
();
d
->
username
=
src
.
getUsername
();
d
->
domain
=
src
.
getDomain
();
d
->
gruu
=
src
.
get
UriParamValue
(
"gr"
);
d
->
gruu
=
src
.
get
Gruu
(
);
}
IdentityAddress
&
IdentityAddress
::
operator
=
(
const
IdentityAddress
&
src
)
{
...
...
src/address/identity-address.h
View file @
fa861d55
...
...
@@ -32,8 +32,8 @@ class IdentityAddressPrivate;
class
LINPHONE_PUBLIC
IdentityAddress
:
public
ClonableObject
{
public:
explicit
IdentityAddress
(
const
std
::
string
&
address
=
""
);
IdentityAddress
(
const
Address
&
address
);
IdentityAddress
(
const
IdentityAddress
&
src
);
IdentityAddress
(
const
Address
&
src
);
~
IdentityAddress
()
=
default
;
IdentityAddress
&
operator
=
(
const
IdentityAddress
&
src
);
...
...
src/c-wrapper/api/c-chat-room.cpp
View file @
fa861d55
...
...
@@ -230,7 +230,9 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr)
}
void
linphone_chat_room_add_participant
(
LinphoneChatRoom
*
cr
,
const
LinphoneAddress
*
addr
)
{
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
addParticipant
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
addr
),
nullptr
,
false
);
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
addParticipant
(
LinphonePrivate
::
IdentityAddress
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
addr
)),
nullptr
,
false
);
}
void
linphone_chat_room_add_participants
(
LinphoneChatRoom
*
cr
,
const
bctbx_list_t
*
addresses
)
{
...
...
@@ -246,14 +248,16 @@ bool_t linphone_chat_room_can_handle_participants (const LinphoneChatRoom *cr) {
}
LinphoneParticipant
*
linphone_chat_room_find_participant
(
const
LinphoneChatRoom
*
cr
,
const
LinphoneAddress
*
addr
)
{
return
L_GET_C_BACK_PTR
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
findParticipant
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
addr
)));
return
L_GET_C_BACK_PTR
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
findParticipant
(
LinphonePrivate
::
IdentityAddress
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
addr
))
));
}
const
LinphoneAddress
*
linphone_chat_room_get_conference_address
(
const
LinphoneChatRoom
*
cr
)
{
if
(
cr
->
conferenceAddressCache
)
linphone_address_unref
(
cr
->
conferenceAddressCache
);
const
LinphonePrivate
::
Address
&
address
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getConferenceAddress
();
const
LinphonePrivate
::
Identity
Address
&
address
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getConferenceAddress
();
if
(
address
.
isValid
())
cr
->
conferenceAddressCache
=
linphone_address_new
(
address
.
asString
().
c_str
());
else
...
...
@@ -356,7 +360,7 @@ LinphoneChatRoom *_linphone_client_group_chat_room_new (LinphoneCore *core, cons
from
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
linphone_proxy_config_get_identity_address
(
proxy
))
->
asString
();
if
(
from
.
empty
())
from
=
linphone_core_get_primary_contact
(
core
);
LinphonePrivate
::
Address
me
(
from
);
LinphonePrivate
::
Identity
Address
me
(
from
);
LinphoneChatRoom
*
cr
=
L_INIT
(
ChatRoom
);
L_SET_CPP_PTR_FROM_C_OBJECT
(
cr
,
make_shared
<
LinphonePrivate
::
ClientGroupChatRoom
>
(
core
->
cppCore
,
L_C_TO_STRING
(
uri
),
me
,
L_C_TO_STRING
(
subject
))
...
...
src/c-wrapper/api/c-participant.cpp
View file @
fa861d55
...
...
@@ -48,7 +48,7 @@ void linphone_participant_set_user_data(LinphoneParticipant *participant, void *
}
const
LinphoneAddress
*
linphone_participant_get_address
(
const
LinphoneParticipant
*
participant
)
{
LinphonePrivate
::
Address
addr
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
participant
)
->
getAddress
();
LinphonePrivate
::
Address
addr
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
participant
)
->
getAddress
()
)
;
if
(
participant
->
addressCache
)
linphone_address_unref
(
participant
->
addressCache
);
participant
->
addressCache
=
linphone_address_new
(
addr
.
asString
().
c_str
());
...
...
src/content/content.cpp
View file @
fa861d55
...
...
@@ -49,14 +49,14 @@ Content::Content (Content &&src) : ClonableObject(*new ContentPrivate), AppDataC
d
->
contentDisposition
=
move
(
src
.
getPrivate
()
->
contentDisposition
);
}
Content
::
Content
(
ContentPrivate
&
p
)
:
ClonableObject
(
p
)
{
}
Content
::
Content
(
ContentPrivate
&
p
)
:
ClonableObject
(
p
)
{}
Content
::~
Content
()
{
L_D
();
/* Fills the body with zeros before releasing since it may contain
private data like cipher keys or decoded messages. */
/*
* Fills the body with zeros before releasing since it may contain
* private data like cipher keys or decoded messages.
*/
d
->
body
.
assign
(
d
->
body
.
size
(),
0
);
}
...
...
src/core/core.cpp
View file @
fa861d55
...
...
@@ -42,7 +42,7 @@ shared_ptr<Core> Core::create (LinphoneCore *cCore) {
// Do not use `make_shared` => Private constructor.
shared_ptr
<
Core
>
core
=
shared_ptr
<
Core
>
(
new
Core
);
CorePrivate
*
const
d
=
core
->
getPrivate
();
CorePrivate
*
const
d
=
core
->
getPrivate
();
d
->
cCore
=
cCore
;
d
->
mainDb
.
reset
(
new
MainDb
(
core
->
getSharedFromThis
()));
...
...
src/core/platform-helpers/platform-helpers.h
View file @
fa861d55
...
...
@@ -50,14 +50,14 @@ public:
virtual
std
::
string
getConfigPath
()
=
0
;
protected:
inline
PlatformHelpers
(
LinphoneCore
*
lc
)
:
mCore
(
lc
)
{}
inline
explicit
PlatformHelpers
(
LinphoneCore
*
lc
)
:
mCore
(
lc
)
{}
LinphoneCore
*
mCore
;
};
class
StubbedPlatformHelpers
:
public
PlatformHelpers
{
public:
StubbedPlatformHelpers
(
LinphoneCore
*
lc
);
explicit
StubbedPlatformHelpers
(
LinphoneCore
*
lc
);
virtual
~
StubbedPlatformHelpers
()
=
default
;
void
setDnsServers
()
override
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment