From 03b57bdc55017f3855cc405e82f1654529f64b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 28 Jan 2015 17:06:32 +0100 Subject: [PATCH] Removed BRoster::Launch() const args kludges. * They are no longer needed, as Launch() no longer takes a const-less char array. --- src/apps/processcontroller/ProcessController.cpp | 13 +++++++------ src/apps/webpositive/BrowserWindow.cpp | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp index e5ea71b043..bfe9a0e392 100644 --- a/src/apps/processcontroller/ProcessController.cpp +++ b/src/apps/processcontroller/ProcessController.cpp @@ -1,7 +1,7 @@ /* ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved. Copyright (C) 2004 beunited.org - Copyright (c) 2006-2013, Haiku, Inc. All rights reserved. + Copyright (c) 2006-2015, Haiku, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -244,13 +244,14 @@ ProcessController::Init() void ProcessController::_HandleDebugRequest(team_id team, thread_id thread) { - char *argv[2]; char paramString[16]; char idString[16]; - strlcpy(paramString, thread > 0 ? "--thread" : "--team", sizeof(paramString)); - snprintf(idString, sizeof(idString), "%" B_PRId32, thread > 0 ? thread : team); - argv[0] = paramString; - argv[1] = idString; + strlcpy(paramString, thread > 0 ? "--thread" : "--team", + sizeof(paramString)); + snprintf(idString, sizeof(idString), "%" B_PRId32, + thread > 0 ? thread : team); + + const char* argv[] = {paramString, idString, NULL}; status_t error = be_roster->Launch(kDebuggerSignature, 2, argv); if (error != B_OK) { // TODO: notify user diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 6e643ac3d8..7d4e644ff9 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -5,7 +5,7 @@ * Copyright (C) 2010 Stephan Aßmus * Copyright (C) 2010 Michael Lotz * Copyright (C) 2010 Rene Gollent - * Copyright 2013-2014 Haiku, Inc. All rights reserved. + * Copyright 2013-2015 Haiku, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -420,7 +420,7 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings, menu->AddItem(new BMenuItem(B_TRANSLATE("Settings"), new BMessage(SHOW_SETTINGS_WINDOW))); menu->AddItem(new BMenuItem(B_TRANSLATE("Script console"), - new BMessage(SHOW_CONSOLE_WINDOW))); + new BMessage(SHOW_CONSOLE_WINDOW))); BMenuItem* aboutItem = new BMenuItem(B_TRANSLATE("About"), new BMessage(B_ABOUT_REQUESTED)); menu->AddItem(aboutItem); @@ -2502,7 +2502,7 @@ BrowserWindow::_SmartURLHandler(const BString& url) temp = "application/x-vnd.Be.URL."; temp += proto; - char* argv[1] = { (char*)url.String() }; + const char* argv[1] = { url.String(), NULL }; if (be_roster->Launch(temp.String(), 1, argv) == B_OK) return;