Bug 119624 - Remove home-brewed nullptr
Summary: Remove home-brewed nullptr
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mikhail Pozdnyakov
URL:
Keywords:
: 120966 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-09 05:37 PDT by Mikhail Pozdnyakov
Modified: 2014-01-20 11:06 PST (History)
11 users (show)

See Also:


Attachments
patch (4.23 KB, patch)
2013-08-09 06:14 PDT, Mikhail Pozdnyakov
andersca: review-
Details | Formatted Diff | Diff
patch v2 (17.94 KB, patch)
2013-09-11 07:00 PDT, Mikhail Pozdnyakov
andersca: review+
andersca: commit-queue-
Details | Formatted Diff | Diff
to be landed (17.96 KB, patch)
2013-09-12 03:09 PDT, Mikhail Pozdnyakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Pozdnyakov 2013-08-09 05:37:21 PDT
At the moment nullptr can be used only for smart pointers initialization, because WTF version of std::nullptr_t is restricted. Basing its implementation on example from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf would let us to use it with plain pointers as well.
Comment 1 Mikhail Pozdnyakov 2013-08-09 06:14:50 PDT
Created attachment 208426 [details]
patch
Comment 2 Anders Carlsson 2013-08-09 10:18:10 PDT
Comment on attachment 208426 [details]
patch

I’m pretty sure we can rip out the NullPtr emulation and just use the builtin C++11 nullptr now. Can you try doing that instead?
Comment 3 Mikhail Pozdnyakov 2013-08-12 00:18:59 PDT
(In reply to comment #2)
> (From update of attachment 208426 [details])
> I’m pretty sure we can rip out the NullPtr emulation and just use the builtin C++11 nullptr now. Can you try doing that instead?

I have tried. EFL port at least does not build.

/media/ssd/WebKit/Source/WTF/wtf/PassOwnArrayPtr.h:45:35: error: function definition does not declare parameters
In file included from /media/ssd/WebKit/Tools/ImageDiff/efl/ImageDiff.cpp:45:0:
/media/ssd/WebKit/Source/WTF/wtf/OwnArrayPtr.h:70:42: error: declaration of 'operator=' as non-function
/media/ssd/WebKit/Source/WTF/wtf/OwnArrayPtr.h:70:26: error: expected ';' at end of member declaration
/media/ssd/WebKit/Source/WTF/wtf/OwnArrayPtr.h:70:42: error: function definition does not declare parameters
In file included from /media/ssd/WebKit/Tools/ImageDiff/efl/ImageDiff.cpp:46:0:
/media/ssd/WebKit/Source/WTF/wtf/OwnPtr.h:50:30: error: function definition does not declare parameters
/media/ssd/WebKit/Source/WTF/wtf/OwnPtr.h:81:41: error: declaration of 'operator=' as non-function
/media/ssd/WebKit/Source/WTF/wtf/OwnPtr.h:81:25: error: expected ';' at end of member declaration
/media/ssd/WebKit/Source/WTF/wtf/OwnPtr.h:81:41: error: function definition does not declare parameters

Could you please re-visit the patch?
Comment 4 Anders Carlsson 2013-08-12 10:23:28 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 208426 [details] [details])
> > I’m pretty sure we can rip out the NullPtr emulation and just use the builtin C++11 nullptr now. Can you try doing that instead?
> 
> I have tried. EFL port at least does not build.
> 
> /media/ssd/WebKit/Source/WTF/wtf/PassOwnArrayPtr.h:45:35: error: function definition does not declare parameters

Can you check if COMPILER_SUPPORTS(CXX_NULLPTR) is true? 

> Could you please re-visit the patch?

Let’s try to figure out why C++11 nullptr doesn’t work instead!
Comment 5 Mikhail Pozdnyakov 2013-09-11 07:00:55 PDT
Created attachment 211309 [details]
patch v2

Removed home-brewed nullptr.
Comment 6 Anders Carlsson 2013-09-11 07:22:39 PDT
Comment on attachment 211309 [details]
patch v2

Excellent! Could you please add the rationale to the ChangeLog? Something like how we can just use the standard C++11 nullptr and sd::nullptr_t types now.
Comment 7 Mikhail Pozdnyakov 2013-09-12 03:09:34 PDT
Created attachment 211413 [details]
to be landed

Added rational to change log.
Comment 8 WebKit Commit Bot 2013-09-12 03:42:21 PDT
Comment on attachment 211413 [details]
to be landed

Clearing flags on attachment: 211413

Committed r155604: <http://trac.webkit.org/changeset/155604>
Comment 9 WebKit Commit Bot 2013-09-12 03:42:24 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Anders Carlsson 2014-01-20 11:06:10 PST
*** Bug 120966 has been marked as a duplicate of this bug. ***