Kaydet (Commit) 7a8d48f5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: Ied61699170bd5d2c3878135b1a43b4dc1deff4d4
üst 28034eaf
......@@ -58,7 +58,7 @@ class i_xml_parser_event_handler;
class xml_parser
{
public:
xml_parser(const XML_Char* EncodingName = 0);
xml_parser(const XML_Char* EncodingName = nullptr);
~xml_parser();
......
......@@ -70,7 +70,7 @@ namespace /* private */
}
xml_parser::xml_parser(const XML_Char* EncodingName) :
document_handler_(0),
document_handler_(nullptr),
xml_parser_(XML_ParserCreate(EncodingName))
{
init();
......@@ -89,7 +89,7 @@ extern "C"
static void xml_start_element_handler(void* UserData, const XML_Char* name, const XML_Char** atts)
{
assert(UserData != NULL);
assert(UserData != nullptr);
xml_parser* pImpl = get_parser_instance(UserData);
......
......@@ -228,9 +228,9 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
static cppu::ImplementationEntry const services[] = {
{ &createInstance, &getDefaultImplementationName,
&getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
&getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, nullptr,
0 },
{ 0, 0, 0, 0, 0, 0 }
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
}
......
......@@ -146,7 +146,7 @@ Service::Service(): enabled_(false) {
if (context.is()) {
OUString desktop;
context->getValueByName("system.desktop-environment") >>= desktop;
enabled_ = desktop == "KDE4" && KApplication::kApplication() != 0;
enabled_ = desktop == "KDE4" && KApplication::kApplication() != nullptr;
}
}
......@@ -192,9 +192,9 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
static cppu::ImplementationEntry const services[] = {
{ &createInstance, &getServiceImplementationName,
&getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
&getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, nullptr,
0 },
{ 0, 0, 0, 0, 0, 0 }
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
}
......
......@@ -168,12 +168,12 @@ static OUString ImplGetLocale(int category)
const char *locale = setlocale(category, "");
// Return "en-US" for C locales
if( (locale == NULL) || ( locale[0] == 'C' && locale[1] == '\0' ) )
if( (locale == nullptr) || ( locale[0] == 'C' && locale[1] == '\0' ) )
return OUString( "en-US" );
const char *cp;
const char *uscore = NULL;
const char *uscore = nullptr;
// locale string have the format lang[_ctry][.encoding][@modifier]
// we are only interested in the first two items, so we handle
......@@ -187,7 +187,7 @@ static OUString ImplGetLocale(int category)
}
OUStringBuffer aLocaleBuffer;
if( uscore != NULL )
if( uscore != nullptr )
{
aLocaleBuffer.appendAscii(locale, uscore++ - locale);
aLocaleBuffer.append("-");
......
......@@ -42,10 +42,10 @@ static const cppu::ImplementationEntry kImplementations_entries[] =
LocaleBackend::getBackendName,
LocaleBackend::getBackendServiceNames,
cppu::createSingleComponentFactory,
NULL,
nullptr,
0
},
{ NULL, NULL, NULL, NULL, NULL, 0 }
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
} ;
......
......@@ -296,7 +296,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM
OString cmd = aBuffer.makeStringAndClear();
FILE * f = popen(cmd.getStr(), "w");
if (f == 0 || pclose(f) != 0)
if (f == nullptr || pclose(f) != 0)
{
throw css::uno::Exception("No mail client configured",
static_cast < XSimpleMailClient * > (this) );
......
......@@ -39,14 +39,14 @@ namespace
static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface)
{
const OString sFullInterface = OUStringToOString("org.freedesktop.PackageKit." + sInterface, RTL_TEXTENCODING_ASCII_US);
GErrorWrapper error(NULL);
GDBusProxy* proxy = NULL;
GErrorWrapper error(nullptr);
GDBusProxy* proxy = nullptr;
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE, NULL,
G_DBUS_PROXY_FLAGS_NONE, nullptr,
"org.freedesktop.PackageKit",
"/org/freedesktop/PackageKit",
reinterpret_cast<const gchar*>(sFullInterface.getStr()),
NULL,
nullptr,
&error.getRef());
if(!proxy)
throw RuntimeException("couldnt get a proxy!");
......@@ -166,7 +166,7 @@ void SyncDbusSessionHelper::InstallPrinterDrivers(
const OString sPackagenameAscii = OUStringToOString(sPackagename, RTL_TEXTENCODING_ASCII_US);
const OString sInteractionAscii = OUStringToOString(sInteraction, RTL_TEXTENCODING_ASCII_US);
std::shared_ptr<GDBusProxy> proxy(lcl_GetPackageKitProxy("Query"), GObjectDeleter<GDBusProxy>());
GErrorWrapper error(NULL);
GErrorWrapper error(nullptr);
std::shared_ptr<GVariant> result(g_dbus_proxy_call_sync (proxy.get(),
"IsInstalled",
g_variant_new ("(ss)",
......@@ -174,7 +174,7 @@ void SyncDbusSessionHelper::InstallPrinterDrivers(
sInteractionAscii.getStr()),
G_DBUS_CALL_FLAGS_NONE,
-1, /* timeout */
NULL, /* cancellable */
nullptr, /* cancellable */
&error.getRef()),GVariantDeleter());
if(result.get())
o_isInstalled = bool(g_variant_get_boolean(g_variant_get_child_value(result.get(),0)));
......
......@@ -262,7 +262,7 @@ private:
iso_lang_replacement_table_t::iterator iter =
iso_lang_replacement_table_.find(iso_lang);
replacement_table_t* prt = NULL;
replacement_table_t* prt = nullptr;
if (iso_lang_replacement_table_.end() == iter)
{
......@@ -330,7 +330,7 @@ void read_ulf_file(const std::string& FileName, Substitutor& Substitutor)
// UTF8 files starting with a byte-order-mark we create a copy of the
// original file without the byte-order-mark
OUString tmpfile_url;
osl_createTempFile(NULL, NULL, &tmpfile_url.pData);
osl_createTempFile(nullptr, nullptr, &tmpfile_url.pData);
OUString tmpfile_sys;
osl::FileBase::getSystemPathFromFileURL(tmpfile_url, tmpfile_sys);
......
......@@ -231,13 +231,13 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
if ( !aLaunchBuffer.isEmpty() )
{
FILE *pLaunch = popen( aLaunchBuffer.makeStringAndClear().getStr(), "w" );
if ( pLaunch != NULL )
if ( pLaunch != nullptr )
{
if ( 0 == pclose( pLaunch ) )
return;
}
// Failed, do not try DESKTOP_LAUNCH any more
pDesktopLaunch = NULL;
pDesktopLaunch = nullptr;
}
OString cmd =
......@@ -248,7 +248,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
aBuffer.makeStringAndClear();
#endif
FILE *pLaunch = popen(cmd.getStr(), "w");
if ( pLaunch != NULL )
if ( pLaunch != nullptr )
{
if ( 0 == pclose( pLaunch ) )
return;
......
......@@ -46,7 +46,7 @@ inline void ensure_final_slash(/*inout*/ OUString& path)
recently_used_file::recently_used_file() :
file_(NULL)
file_(nullptr)
{
osl::Security sec;
OUString homedir_url;
......@@ -66,12 +66,12 @@ recently_used_file::recently_used_file() :
int fd = open(tmp.getStr(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd != -1) {
file_ = fdopen(fd, "w+");
if (file_ == 0) {
if (file_ == nullptr) {
close(fd);
}
}
if (NULL == file_)
if (nullptr == file_)
throw "I/O error opening ~/.recently-used";
if (lockf(fileno(file_), F_LOCK, 0) != 0)
......
......@@ -80,7 +80,7 @@ namespace /* private */ {
is_private_(is_private),
groups_(groups)
{
timestamp_ = time(NULL);
timestamp_ = time(nullptr);
}
void set_uri(const string_t& character)
......@@ -216,7 +216,7 @@ namespace /* private */ {
{
public:
explicit recently_used_file_filter(recently_used_item_list_t& item_list) :
item_(NULL),
item_(nullptr),
item_list_(item_list)
{
named_command_map_[TAG_RECENT_FILES] = &recently_used_item::set_nothing;
......@@ -234,14 +234,14 @@ namespace /* private */ {
const string_t& local_name,
const xml_tag_attribute_container_t& /*attributes*/) override
{
if ((local_name == TAG_RECENT_ITEM) && (NULL == item_))
if ((local_name == TAG_RECENT_ITEM) && (nullptr == item_))
item_ = new recently_used_item;
}
virtual void end_element(const string_t& /*raw_name*/, const string_t& local_name) override
{
// check for end tags w/o start tag
if( local_name != TAG_RECENT_FILES && NULL == item_ )
if( local_name != TAG_RECENT_FILES && nullptr == item_ )
return; // will result in an XML parser error anyway
if (named_command_map_.find(local_name) != named_command_map_.end())
......@@ -255,7 +255,7 @@ namespace /* private */ {
if (local_name == TAG_RECENT_ITEM)
{
item_list_.push_back(item_);
item_ = NULL;
item_ = nullptr;
}
current_element_.clear();
}
......@@ -406,7 +406,7 @@ namespace /* private */ {
if (iter != item_list.end())
{
(*iter)->timestamp_ = time(NULL);
(*iter)->timestamp_ = time(nullptr);
if (!(*iter)->has_group(GROUP_OOO))
(*iter)->groups_.push_back(GROUP_OOO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment