Re: [webkit-dev] Guideline for nullptr

2014-01-07 Thread Carlos Garcia Campos
El lun, 06-01-2014 a las 14:19 -0800, Martin Robinson escribió:
 On Mon, Jan 6, 2014 at 1:16 PM, Ryosuke Niwa rn...@webkit.org wrote:
  Sounds like a great idea to me.
 
 Seconding this. nullptr also has much better compatibility with varargs than 
 0.

Yeah, with nullptr we don't need the coding style exceptions for C API
using NULL as a sentinel.



___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Guideline for nullptr

2014-01-06 Thread Dan Bernstein


Sent from my iPad

 On Jan 6, 2014, at 11:55 AM, Darin Adler da...@apple.com wrote:
 
 I suggest we use nullptr, rather than of 0 or NULL, for all pointer nulls in 
 WebKit C++ sources. I don’t see any advantage to using 0 or NULL over 
 nullptr, and nullptr has multiple advantages. Three obvious ones: Compile 
 time error if accidentally passed to something expecting an integer, can be 
 distinguished from an integer in function overloading, can tell it’s a 
 pointer.
 
 Any objections?
 
 — Darin
 
 PS: Maybe even instead of nil in WebKit Objective-C++ code?

In Objective-C++, nil is nullptr, so I suggest that we stick with the language 
convention of writing it as nil.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Guideline for nullptr

2014-01-06 Thread Anders Carlsson

On Jan 6, 2014, at 12:01 PM, Dan Bernstein m...@apple.com wrote:

 
 
 Sent from my iPad
 
 On Jan 6, 2014, at 11:55 AM, Darin Adler da...@apple.com wrote:
 
 I suggest we use nullptr, rather than of 0 or NULL, for all pointer nulls in 
 WebKit C++ sources. I don’t see any advantage to using 0 or NULL over 
 nullptr, and nullptr has multiple advantages. Three obvious ones: Compile 
 time error if accidentally passed to something expecting an integer, can be 
 distinguished from an integer in function overloading, can tell it’s a 
 pointer.
 
 Any objections?

I think this is a great idea and something I’ve been doing ever since nullptr 
became available to us.

 
 — Darin
 
 PS: Maybe even instead of nil in WebKit Objective-C++ code?
 
 In Objective-C++, nil is nullptr, so I suggest that we stick with the 
 language convention of writing it as nil.

I agree. (Also, using Nil for null classes).

- Anders

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Guideline for nullptr

2014-01-06 Thread Ryosuke Niwa
Sounds like a great idea to me.

- R. Niwa


On Mon, Jan 6, 2014 at 12:04 PM, Anders Carlsson ander...@apple.com wrote:


 On Jan 6, 2014, at 12:01 PM, Dan Bernstein m...@apple.com wrote:

 
 
  Sent from my iPad
 
  On Jan 6, 2014, at 11:55 AM, Darin Adler da...@apple.com wrote:
 
  I suggest we use nullptr, rather than of 0 or NULL, for all pointer
 nulls in WebKit C++ sources. I don’t see any advantage to using 0 or NULL
 over nullptr, and nullptr has multiple advantages. Three obvious ones:
 Compile time error if accidentally passed to something expecting an
 integer, can be distinguished from an integer in function overloading, can
 tell it’s a pointer.
 
  Any objections?

 I think this is a great idea and something I’ve been doing ever since
 nullptr became available to us.

 
  — Darin
 
  PS: Maybe even instead of nil in WebKit Objective-C++ code?
 
  In Objective-C++, nil is nullptr, so I suggest that we stick with the
 language convention of writing it as nil.

 I agree. (Also, using Nil for null classes).

 - Anders

 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Guideline for nullptr

2014-01-06 Thread Martin Robinson
On Mon, Jan 6, 2014 at 1:16 PM, Ryosuke Niwa rn...@webkit.org wrote:
 Sounds like a great idea to me.

Seconding this. nullptr also has much better compatibility with varargs than 0.

--Martin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev