Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-07 Thread Anders Widell
> > > > > -Original Message- > From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com] > Sent: den 4 april 2014 16:52 > To: Anders Widell; Nagendra Kumar; Hans Feldt; Praveen Malviya > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 o

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-07 Thread Anders Björnerstedt
[mailto:hans.nordeb...@ericsson.com] Sent: den 4 april 2014 16:52 To: Anders Widell; Nagendra Kumar; Hans Feldt; Praveen Malviya Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713] validations and asserts are not the

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Hans Feldt
t > Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace > patricia tree db V2 [#713] > > Just some thoughts regarding NULL pointers: > > When I write a function, I by default assume that pointers passed to it as > arguments are not NULL. Only if the API d

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Hans Nordebäck
@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713] Asserts are fine even if the input is supposed to already be validated. But as I said, asserting that a pointer is not NULL is not so useful since you crash anyway when dereferencing

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Anders Widell
t: den 4 april 2014 16:27 > To: Nagendra Kumar; Hans Nordebäck; Hans Feldt; Praveen Malviya > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace > patricia tree db V2 [#713] > > Just some thoughts regarding NULL po

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Hans Nordebäck
input already have been validated in calling functions? /BR HansN -Original Message- From: Anders Widell Sent: den 4 april 2014 16:27 To: Nagendra Kumar; Hans Nordebäck; Hans Feldt; Praveen Malviya Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] amfd: use tem

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Anders Widell
Just some thoughts regarding NULL pointers: When I write a function, I by default assume that pointers passed to it as arguments are not NULL. Only if the API documentation explicitly states that a NULL pointer is a valid input for that argument, then the function needs to handle it. Otherwise

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Hans Nordebäck
Message- From: Zoran Milinkovic Sent: den 4 april 2014 15:48 To: praveen malviya; Hans Nordebäck Cc: opensaf-devel@lists.sourceforge.net Subject: RE: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713] + typename AmfDbMap::iterator it = db.find(name

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Zoran Milinkovic
: Hans Nordebäck Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713] Please find comments inline with [Praveen]. Thanks, Praveen On 26-Mar-14 4:57 PM, Hans Nordeback wrote: > osaf/services/saf/amf/amfd/incl

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Hans Feldt
A null pointer is just a special case of a bad pointer which cannot be validated. An assert is ok to show the contract for calling this method Skickat från min Sony Xperia™-smartphone Nagendra Kumar skrev Ack with comment the functions added are not NULL safe. It crashed if passed N

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread praveen malviya
Please find comments inline with [Praveen]. Thanks, Praveen On 26-Mar-14 4:57 PM, Hans Nordeback wrote: > osaf/services/saf/amf/amfd/include/db_template.h | 63 > > 1 files changed, 63 insertions(+), 0 deletions(-) > > > diff --git a/osaf/services/saf/amf/amfd/includ

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Nagendra Kumar
Ack with comment the functions added are not NULL safe. It crashed if passed NULL. Do we want to have some checks ? Thanks -Nagu > -Original Message- > From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com] > Sent: 26 March 2014 16:58 > To: hans.fe...@ericsson.com; Nagendra Kumar; Pra

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-01 Thread Hans Feldt
Ack I guess later we need to make this file common between director and node director. Thanks, Hans On 03/26/2014 12:27 PM, Hans Nordeback wrote: > osaf/services/saf/amf/amfd/include/db_template.h | 63 > > 1 files changed, 63 insertions(+), 0 deletions(-) > > > di

[devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-03-26 Thread Hans Nordeback
osaf/services/saf/amf/amfd/include/db_template.h | 63 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/osaf/services/saf/amf/amfd/include/db_template.h b/osaf/services/saf/amf/amfd/include/db_template.h new file mode 100644 --- /dev/null +++ b/osaf/servi