[vtk-developers] 0, NULL -> nullptr

Ken Martin ken.martin at kitware.com
Wed Jul 26 14:19:34 EDT 2017


I have merged this as a new large commit. I'll try fixing any issues that
crop up on the nightlies tomorrow. There are still many uses of NULL in
comments and classes that did not build on my linux system (such as Win32
and OSX specific classes) If you see uses of NULL or 0 in code you are
editing that should be nullptr, please update them.

I did go beyond just clang-tidy so if you see issues/regressions with the
change let me know.

Going forward in C++ code please use nullptr as it has better type safety
and overload resolution than NULL or 0.

In comments I tried to use "nullptr" or "null" depending on the context as
opposed to NULL.

Topics in flight may have merge conflicts (probably :-( ).


On Tue, Jul 25, 2017 at 2:08 PM, Ken Martin <ken.martin at kitware.com> wrote:

>
> Here is a topic for updating VTK/Common to use nullptr based on fixes from
> clang-tidy
>
> https://gitlab.kitware.com/vtk/vtk/merge_requests/3055
>
> I just did common as I figured that would impact fewer people. My plan is
> to do other directories in chunks over time but I can go whole hog and do
> it all at once if you all think that is better.  The change is from Rob's
> script ala...
>
> #!/bin/bash
>
> # The vtk build must have CMAKE_EXPORT_COMPILE_COMMANDS=ON
>
> path=$(pwd)
> build_path="/home/ken/Documents/vtk/vtkbin"
> clang_tidy="/usr/bin/clang-tidy"
> args="-checks=-*,modernize-use-nullptr --header-filter=$path -p
> $build_path -fix"
> for file in $1/*.cxx; do
>   $clang_tidy $args $file
> done
>
>
>
> --
> Ken Martin PhD
> Distinguished Engineer
> Kitware Inc.
> 28 Corporate Drive
> Clifton Park NY 12065
>
> This communication, including all attachments, contains confidential and
> legally privileged information, and it is intended only for the use of the
> addressee.  Access to this email by anyone else is unauthorized. If you are
> not the intended recipient, any disclosure, copying, distribution or any
> action taken in reliance on it is prohibited and may be unlawful. If you
> received this communication in error please notify us immediately and
> destroy the original message.  Thank you.
>



-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170726/a36df27b/attachment.html>


More information about the vtk-developers mailing list