hrev52025 adds 6 changesets to branch 'master'
old head: c12499571324b5f9d9b4cd50cbf2894b1bc1eee1
new head: 9b326aa28754c521810b369b09ed3900cba041b6
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=9b326aa28754+%5Ec12499571324
----------------------------------------------------------------------------
b2f22ba09f33: build: Actually disable non-useful Clang warnings.
* The if-case was appending to gccBaseFlags after the rest of the file
was done using it, so it was ineffective. Now we set it with the rest
of the baseFlags.
* We already pass no-integrated-as in configure, no need to do it in
MainBuildRules.
* B_USE_BUILTIN_ATOMIC_FUNCTIONS isn't used anymore, so get rid of it.
fe17f0df1f73: scsi: Use _res and not res in MK_ERROR.
Some users of MK_ERROR pass in parameters from a variable called "res",
which is obviously not what they want to do, as that will use this "res"
and not theirs.
Spotted by Clang.
9216fc01782e: More class/struct mixup fixes.
Spotted by Clang.
9b29611fb897: ACPI: Set handle to NULL.
There is a (probably non-viable) case where it might not get initialized
by the function and then potentially used, so set it to NULL to silence
Clang.
a309b7c3a143: bin: Clang warning fixes.
* Functions that call exit() should return void
* char* -> const char*
* main returns int, not bool.
9b326aa28754: mail: Store mode flags by-value, not by-reference.
They are passed into the constructor by-value, and Clang warns that
we are taking the reference of a temporary.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
30 files changed, 63 insertions(+), 73 deletions(-)
build/jam/ArchitectureRules | 19 ++++---------
build/jam/MainBuildRules | 4 ---
.../debugger/user_interface/UserInterface.h | 2 +-
headers/private/drivers/scsi_periph.h | 4 +--
headers/private/interface/ShapePrivate.h | 3 +-
headers/private/shared/HashMap.h | 2 +-
src/add-ons/kernel/bus_managers/acpi/Device.cpp | 2 +-
.../disk/virtual/virtio_block/virtio_block.cpp | 4 +--
.../kernel/file_systems/nfs4/NFS4Object.h | 4 +--
.../kernel/file_systems/nfs4/NFS4Server.h | 2 +-
.../kernel/file_systems/nfs4/ReplyInterpreter.h | 2 +-
src/add-ons/kernel/file_systems/nfs4/Request.h | 2 +-
.../kernel/file_systems/nfs4/RequestBuilder.h | 6 ++--
src/add-ons/screen_savers/gravity/GravityView.h | 2 +-
src/apps/deskcalc/CalcView.h | 2 +-
src/apps/mail/QueryList.h | 2 +-
src/apps/terminal/TerminalCharClassifier.h | 2 +-
src/bin/checkfs.cpp | 2 +-
src/bin/eject.cpp | 2 +-
src/bin/setversion.cpp | 30 ++++++++++----------
.../debugger/controllers/DebugReportGenerator.h | 2 +-
src/kits/storage/PathMonitor.cpp | 4 +--
src/preferences/media/MediaListItem.h | 10 +++----
src/servers/app/ClickTarget.h | 2 +-
.../app/drawing/interface/remote/RemoteMessage.h | 2 +-
src/servers/mail/DefaultNotifier.h | 2 +-
src/servers/net/DHCPClient.h | 4 +--
src/servers/registrar/AppInfoList.h | 4 +--
.../registrar/AppInfoListMessagingTargetSet.h | 2 +-
src/system/kernel/scheduler/scheduler_cpu.h | 6 ++--
############################################################################
Commit: b2f22ba09f338a8a6b36ffc821d848cb545b6f22
URL: https://git.haiku-os.org/haiku/commit/?id=b2f22ba09f33
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Jun 19 02:04:48 2018 UTC
build: Actually disable non-useful Clang warnings.
* The if-case was appending to gccBaseFlags after the rest of the file
was done using it, so it was ineffective. Now we set it with the rest
of the baseFlags.
* We already pass no-integrated-as in configure, no need to do it in
MainBuildRules.
* B_USE_BUILTIN_ATOMIC_FUNCTIONS isn't used anymore, so get rid of it.
----------------------------------------------------------------------------
diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules
index a028f8b928..87a4ae36cd 100644
--- a/build/jam/ArchitectureRules
+++ b/build/jam/ArchitectureRules
@@ -43,6 +43,12 @@ rule ArchitectureSetup architecture
gccBaseFlags += -fno-builtin-fork -fno-builtin-vfork ;
}
+ # disable some Clang warnings that are not very useful
+ if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
+ gccBaseFlags += -Wno-address-of-packed-member
-Wno-unused-private-field
+ -Wno-cast-align -Wno-gnu-designator ;
+ }
+
local cpu = $(HAIKU_CPU_$(architecture)) ;
if $(cpu) = arm {
if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 {
@@ -106,15 +112,6 @@ rule ArchitectureSetup architecture
HAIKU_C++FLAGS_$(architecture) += -Wno-deprecated ;
}
- switch $(cpu) {
- case x86* :
- # Enable use of the gcc built-in atomic functions
instead of
- # atomic_*(). The former are inlined and have thus less
overhead.
- # They are not available with gcc 2, but the header
will take care
- # of that.
- HAIKU_DEFINES_$(architecture) +=
B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
- }
-
# warning flags
HAIKU_WARNING_CCFLAGS_$(architecture)
= -Wall -Wno-trigraphs -Wmissing-prototypes
@@ -134,10 +131,6 @@ rule ArchitectureSetup architecture
HAIKU_WERROR_FLAGS_$(architecture) +=
-Wno-unused-but-set-variable ;
}
- if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
- gccBaseFlags += -Wno-address-of-packed-member
-Wno-unused-private-field ;
- }
-
# debug flags
local debugFlags = -ggdb ;
diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules
index 0f7305d99a..fbb70e08ce 100644
--- a/build/jam/MainBuildRules
+++ b/build/jam/MainBuildRules
@@ -353,10 +353,6 @@ rule CreateAsmStructOffsetsHeader header : source
flags += -Wno-invalid-offsetof ;
# TODO: Rather get rid of the respective offsetof() instances.
- if $(HAIKU_CC_IS_CLANG_$(TARGET_PACKAGING_ARCH)) = 1 {
- flags += -no-integrated-as ;
- }
-
# locate object, search for source, and set on target variables
Depends $(header) : $(source) $(PLATFORM) ;
############################################################################
Commit: fe17f0df1f73559ef1017bac2d4772d5550c03a3
URL: https://git.haiku-os.org/haiku/commit/?id=fe17f0df1f73
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Jun 19 02:05:45 2018 UTC
scsi: Use _res and not res in MK_ERROR.
Some users of MK_ERROR pass in parameters from a variable called "res",
which is obviously not what they want to do, as that will use this "res"
and not theirs.
Spotted by Clang.
----------------------------------------------------------------------------
diff --git a/headers/private/drivers/scsi_periph.h
b/headers/private/drivers/scsi_periph.h
index 9be19ab86f..9d470c6c1a 100644
--- a/headers/private/drivers/scsi_periph.h
+++ b/headers/private/drivers/scsi_periph.h
@@ -44,8 +44,8 @@ typedef struct err_res {
} err_res;
#define MK_ERROR( aaction, code ) ({ \
- err_res res = {error_code: (code), action: (aaction) }; \
- res; \
+ err_res _res = {error_code: (code), action: (aaction) }; \
+ _res; \
})
// cookie issued by driver to identify itself
############################################################################
Commit: 9216fc01782e67a039b918399d45c8c0c9199d71
URL: https://git.haiku-os.org/haiku/commit/?id=9216fc01782e
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Jun 19 02:06:26 2018 UTC
More class/struct mixup fixes.
Spotted by Clang.
----------------------------------------------------------------------------
diff --git a/headers/private/debugger/user_interface/UserInterface.h
b/headers/private/debugger/user_interface/UserInterface.h
index 17a7a16332..52a4e80e2a 100644
--- a/headers/private/debugger/user_interface/UserInterface.h
+++ b/headers/private/debugger/user_interface/UserInterface.h
@@ -15,7 +15,7 @@
#include "Types.h"
-class entry_ref;
+struct entry_ref;
class CpuState;
class ExpressionInfo;
diff --git a/headers/private/interface/ShapePrivate.h
b/headers/private/interface/ShapePrivate.h
index 31e201e2d5..e4c2832cfe 100644
--- a/headers/private/interface/ShapePrivate.h
+++ b/headers/private/interface/ShapePrivate.h
@@ -27,7 +27,8 @@
#define OP_SMALL_ARC_TO_CCW 0x08000000
-struct shape_data : public BReferenceable {
+class shape_data : public BReferenceable {
+public:
uint32* opList;
BPoint* ptList;
int32 opCount;
diff --git a/headers/private/shared/HashMap.h b/headers/private/shared/HashMap.h
index 4acc38b6ff..ffd86436a6 100644
--- a/headers/private/shared/HashMap.h
+++ b/headers/private/shared/HashMap.h
@@ -450,7 +450,7 @@ HashMap<Key, Value>::Size() const
// GetIterator
template<typename Key, typename Value>
-struct HashMap<Key, Value>::Iterator
+class HashMap<Key, Value>::Iterator
HashMap<Key, Value>::GetIterator() const
{
return Iterator(this);
diff --git
a/src/add-ons/kernel/drivers/disk/virtual/virtio_block/virtio_block.cpp
b/src/add-ons/kernel/drivers/disk/virtual/virtio_block/virtio_block.cpp
index cc092d0709..65149d1886 100644
--- a/src/add-ons/kernel/drivers/disk/virtual/virtio_block/virtio_block.cpp
+++ b/src/add-ons/kernel/drivers/disk/virtual/virtio_block/virtio_block.cpp
@@ -9,8 +9,8 @@
#include "virtio_blk.h"
-struct DMAResource;
-struct IOScheduler;
+class DMAResource;
+class IOScheduler;
static const uint8 kDriveIcon[] = {
diff --git a/src/add-ons/kernel/file_systems/nfs4/NFS4Object.h
b/src/add-ons/kernel/file_systems/nfs4/NFS4Object.h
index 2ec041e20a..5d6fed2215 100644
--- a/src/add-ons/kernel/file_systems/nfs4/NFS4Object.h
+++ b/src/add-ons/kernel/file_systems/nfs4/NFS4Object.h
@@ -13,8 +13,8 @@
#include "RPCServer.h"
-class OpenStateCookie;
-class OpenState;
+struct OpenStateCookie;
+struct OpenState;
class NFS4Object {
public:
diff --git a/src/add-ons/kernel/file_systems/nfs4/NFS4Server.h
b/src/add-ons/kernel/file_systems/nfs4/NFS4Server.h
index 7c2c8a5d52..bd18639972 100644
--- a/src/add-ons/kernel/file_systems/nfs4/NFS4Server.h
+++ b/src/add-ons/kernel/file_systems/nfs4/NFS4Server.h
@@ -17,7 +17,7 @@
class FileSystem;
-class OpenFileCookie;
+struct OpenFileCookie;
class NFS4Server : public RPC::ProgramData {
public:
diff --git a/src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.h
b/src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.h
index 819cce4955..5660df88f7 100644
--- a/src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.h
+++ b/src/add-ons/kernel/file_systems/nfs4/ReplyInterpreter.h
@@ -57,7 +57,7 @@ struct DirEntry {
~DirEntry();
};
-class LockInfo;
+struct LockInfo;
class ReplyInterpreter {
public:
diff --git a/src/add-ons/kernel/file_systems/nfs4/Request.h
b/src/add-ons/kernel/file_systems/nfs4/Request.h
index f740bb4619..3a439cbe99 100644
--- a/src/add-ons/kernel/file_systems/nfs4/Request.h
+++ b/src/add-ons/kernel/file_systems/nfs4/Request.h
@@ -14,7 +14,7 @@
#include "RPCServer.h"
-class Cookie;
+struct Cookie;
class FileSystem;
class Request {
diff --git a/src/add-ons/kernel/file_systems/nfs4/RequestBuilder.h
b/src/add-ons/kernel/file_systems/nfs4/RequestBuilder.h
index 00b0d07f75..acaff6f6fd 100644
--- a/src/add-ons/kernel/file_systems/nfs4/RequestBuilder.h
+++ b/src/add-ons/kernel/file_systems/nfs4/RequestBuilder.h
@@ -19,9 +19,9 @@
#include "XDR.h"
-class OpenState;
-class LockInfo;
-class LockOwner;
+struct OpenState;
+struct LockInfo;
+struct LockOwner;
class RequestBuilder {
public:
diff --git a/src/add-ons/screen_savers/gravity/GravityView.h
b/src/add-ons/screen_savers/gravity/GravityView.h
index b8072bcb40..7b69ae94aa 100644
--- a/src/add-ons/screen_savers/gravity/GravityView.h
+++ b/src/add-ons/screen_savers/gravity/GravityView.h
@@ -16,7 +16,7 @@
class Gravity;
-class GravitySource;
+struct GravitySource;
class GravityView : public BGLView {
diff --git a/src/apps/deskcalc/CalcView.h b/src/apps/deskcalc/CalcView.h
index bf126917d1..323d8cb130 100644
--- a/src/apps/deskcalc/CalcView.h
+++ b/src/apps/deskcalc/CalcView.h
@@ -37,7 +37,7 @@ class BMenuItem;
class BMessage;
class BMessageRunner;
class BPopUpMenu;
-class CalcOptions;
+struct CalcOptions;
class CalcOptionsWindow;
class ExpressionTextView;
diff --git a/src/apps/mail/QueryList.h b/src/apps/mail/QueryList.h
index 47205eaef5..104791976a 100644
--- a/src/apps/mail/QueryList.h
+++ b/src/apps/mail/QueryList.h
@@ -16,7 +16,7 @@
#include <Query.h>
-struct QueryList;
+class QueryList;
class QueryListener {
diff --git a/src/apps/terminal/TerminalCharClassifier.h
b/src/apps/terminal/TerminalCharClassifier.h
index de0d36411f..3346a5c36d 100644
--- a/src/apps/terminal/TerminalCharClassifier.h
+++ b/src/apps/terminal/TerminalCharClassifier.h
@@ -18,7 +18,7 @@ enum {
};
-class UTF8Char;
+struct UTF8Char;
class TerminalCharClassifier {
public:
diff --git a/src/kits/debugger/controllers/DebugReportGenerator.h
b/src/kits/debugger/controllers/DebugReportGenerator.h
index 9eebca4059..73d940bde8 100644
--- a/src/kits/debugger/controllers/DebugReportGenerator.h
+++ b/src/kits/debugger/controllers/DebugReportGenerator.h
@@ -14,7 +14,7 @@
#include "ValueNodeContainer.h"
-class entry_ref;
+struct entry_ref;
class Architecture;
class AreaInfo;
class BFile;
diff --git a/src/kits/storage/PathMonitor.cpp b/src/kits/storage/PathMonitor.cpp
index 2462437313..1a8d475b6d 100644
--- a/src/kits/storage/PathMonitor.cpp
+++ b/src/kits/storage/PathMonitor.cpp
@@ -50,8 +50,8 @@
namespace {
-struct Directory;
-struct Node;
+class Directory;
+class Node;
struct WatcherHashDefinition;
typedef BOpenHashTable<WatcherHashDefinition> WatcherMap;
diff --git a/src/preferences/media/MediaListItem.h
b/src/preferences/media/MediaListItem.h
index 5aa050bee9..895efbd106 100644
--- a/src/preferences/media/MediaListItem.h
+++ b/src/preferences/media/MediaListItem.h
@@ -2,7 +2,7 @@
//
// Copyright (c) 2003, OpenBeOS
//
-// This software is part of the OpenBeOS distribution and is covered
+// This software is part of the OpenBeOS distribution and is covered
// by the MIT License.
//
//
@@ -10,7 +10,7 @@
// Author: Sikosis, Jérôme Duval
// Description: Media Preferences
// Created : June 25, 2003
-//
+//
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
#ifndef __MEDIALISTITEM_H__
#define __MEDIALISTITEM_H__
@@ -22,7 +22,7 @@
struct dormant_node_info;
-class MediaIcons;
+struct MediaIcons;
class MediaWindow;
class AudioMixerListItem;
@@ -45,10 +45,10 @@ public:
virtual void Update(BView* owner, const
BFont* font);
virtual void DrawItem(BView* owner, BRect
frame,
bool
complete = false);
-
+
virtual const char* Label() = 0;
-
+
static MediaIcons* Icons() {return sIcons;}
static void SetIcons(MediaIcons* icons)
{sIcons = icons;}
diff --git a/src/servers/app/ClickTarget.h b/src/servers/app/ClickTarget.h
index ead8ee9f68..7264dbf9d2 100644
--- a/src/servers/app/ClickTarget.h
+++ b/src/servers/app/ClickTarget.h
@@ -14,7 +14,7 @@
Used to discriminate between different targets in order to filter
multi-clicks. A click on a different target resets the click count.
*/
-struct ClickTarget {
+class ClickTarget {
public:
enum Type {
TYPE_INVALID,
diff --git a/src/servers/app/drawing/interface/remote/RemoteMessage.h
b/src/servers/app/drawing/interface/remote/RemoteMessage.h
index 37123433cf..f161e39e0b 100644
--- a/src/servers/app/drawing/interface/remote/RemoteMessage.h
+++ b/src/servers/app/drawing/interface/remote/RemoteMessage.h
@@ -33,7 +33,7 @@ class RemotePainter;
class ServerBitmap;
class ServerCursor;
class ServerFont;
-class ViewLineArrayInfo;
+struct ViewLineArrayInfo;
enum {
RP_INIT_CONNECTION = 1,
diff --git a/src/servers/net/DHCPClient.h b/src/servers/net/DHCPClient.h
index 63b3bf0df4..4383d38a5f 100644
--- a/src/servers/net/DHCPClient.h
+++ b/src/servers/net/DHCPClient.h
@@ -17,8 +17,8 @@
class BMessageRunner;
-class dhcp_message;
-class socket_timeout;
+struct dhcp_message;
+struct socket_timeout;
enum dhcp_state {
diff --git a/src/servers/registrar/AppInfoList.h
b/src/servers/registrar/AppInfoList.h
index 61fa5015f8..d0eae58c44 100644
--- a/src/servers/registrar/AppInfoList.h
+++ b/src/servers/registrar/AppInfoList.h
@@ -30,9 +30,9 @@
#include <List.h>
#include <OS.h>
-class entry_ref;
+struct entry_ref;
-class RosterAppInfo;
+struct RosterAppInfo;
// AppInfoList
class AppInfoList {
diff --git a/src/servers/registrar/AppInfoListMessagingTargetSet.h
b/src/servers/registrar/AppInfoListMessagingTargetSet.h
index da56dc3d26..db4a3a01a1 100644
--- a/src/servers/registrar/AppInfoListMessagingTargetSet.h
+++ b/src/servers/registrar/AppInfoListMessagingTargetSet.h
@@ -12,7 +12,7 @@
#include "AppInfoList.h"
#include "MessageDeliverer.h"
-class RosterAppInfo;
+struct RosterAppInfo;
class AppInfoListMessagingTargetSet : public MessagingTargetSet {
public:
diff --git a/src/system/kernel/scheduler/scheduler_cpu.h
b/src/system/kernel/scheduler/scheduler_cpu.h
index 11a681b707..9b5ef79027 100644
--- a/src/system/kernel/scheduler/scheduler_cpu.h
+++ b/src/system/kernel/scheduler/scheduler_cpu.h
@@ -29,9 +29,9 @@ class DebugDumper;
struct ThreadData;
class ThreadProcessing;
-struct CPUEntry;
-struct CoreEntry;
-struct PackageEntry;
+class CPUEntry;
+class CoreEntry;
+class PackageEntry;
// The run queues. Holds the threads ready to run ordered by priority.
// One queue per schedulable target per core. Additionally, each
############################################################################
Commit: 9b29611fb8977e1a5b236986df9c50b791b72ddd
URL: https://git.haiku-os.org/haiku/commit/?id=9b29611fb897
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Jun 19 03:17:38 2018 UTC
ACPI: Set handle to NULL.
There is a (probably non-viable) case where it might not get initialized
by the function and then potentially used, so set it to NULL to silence
Clang.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/bus_managers/acpi/Device.cpp
b/src/add-ons/kernel/bus_managers/acpi/Device.cpp
index 7b7ed1d725..3a9dfbbc58 100644
--- a/src/add-ons/kernel/bus_managers/acpi/Device.cpp
+++ b/src/add-ons/kernel/bus_managers/acpi/Device.cpp
@@ -87,7 +87,7 @@ acpi_walk_resources(acpi_device device, char *method,
static status_t
acpi_device_init_driver(device_node *node, void **cookie)
{
- ACPI_HANDLE handle;
+ ACPI_HANDLE handle = NULL;
const char *path = NULL;
uint32 type;
############################################################################
Commit: a309b7c3a143f47b51f0b27d6702c380a6da3b6c
URL: https://git.haiku-os.org/haiku/commit/?id=a309b7c3a143
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Jun 19 03:18:34 2018 UTC
bin: Clang warning fixes.
* Functions that call exit() should return void
* char* -> const char*
* main returns int, not bool.
----------------------------------------------------------------------------
diff --git a/src/bin/checkfs.cpp b/src/bin/checkfs.cpp
index 9c63de655d..97fe65d134 100644
--- a/src/bin/checkfs.cpp
+++ b/src/bin/checkfs.cpp
@@ -98,7 +98,7 @@ main(int argc, char** argv)
if (status != B_OK) {
fprintf(stderr, "%s: Could not prepare the device for
modifications: "
"%s\n", kProgramName, strerror(status));
- return false;
+ return 1;
}
// Check if the partition supports repairing
diff --git a/src/bin/eject.cpp b/src/bin/eject.cpp
index 52f17cd39a..3f93a3a3be 100644
--- a/src/bin/eject.cpp
+++ b/src/bin/eject.cpp
@@ -59,7 +59,7 @@ private:
};
-static int usage(char *prog)
+static int usage(const char *prog)
{
printf("usage: eject [-q|-l|-s|-b|-u] /dev/disk/.../raw\n");
// printf("usage: eject [-q|-l|-s|-b|-u] [scsi|ide|/dev/disk/.../raw]\n");
diff --git a/src/bin/setversion.cpp b/src/bin/setversion.cpp
index ab9aa60789..1c56fbfbd3 100644
--- a/src/bin/setversion.cpp
+++ b/src/bin/setversion.cpp
@@ -24,7 +24,7 @@ const char *kProgramName = __progname;
#endif
-enum arg_needed {
+enum arg_needed {
switch_needed, major_version, middle_version, minor_version,
variety_version, internal_version, long_string, short_string
};
@@ -103,7 +103,7 @@ errorToString(BString& output, status_t error, const char
*appName = NULL)
case e_expecting:
output = "expecting -short, -long, -app or -system\n";
break;
- case e_long_string:
+ case e_long_string:
output = "expecting long version string\n";
break;
case e_short_string:
@@ -134,7 +134,7 @@ errorToString(BString& output, status_t error, const char
*appName = NULL)
}
-static int
+static void
errorOut(status_t error, const char *appName = NULL, bool showUsage = true)
{
BString output;
@@ -184,12 +184,12 @@ parse(bool &systemModified, bool &appModified, arg_needed
&argNeeded,
systemModified = true;
} else if (strcmp(argv[i], "-long") == 0) {
if (mode == no_switch)
- errorOut(e_app_sys_switch);
+ errorOut(e_app_sys_switch);
argNeeded = long_string;
} else if (strcmp(argv[i], "-short") == 0) {
if (mode == no_switch)
- errorOut(e_app_sys_switch);
+ errorOut(e_app_sys_switch);
argNeeded = short_string;
} else if (mode == no_switch)
@@ -197,20 +197,20 @@ parse(bool &systemModified, bool &appModified, arg_needed
&argNeeded,
else if (strncmp(argv[i], "-", 1) == 0)
errorOut(e_parameter);
else
- errorOut(e_expecting);
+ errorOut(e_expecting);
break;
case major_version:
if (isalpha(argv[i][0]))
- errorOut(e_major_version);
+ errorOut(e_major_version);
version.major = atoi(argv[i]);
- argNeeded = middle_version;
+ argNeeded = middle_version;
break;
case middle_version:
if (isalpha(argv[i][0]))
- errorOut(e_middle_version);
+ errorOut(e_middle_version);
version.middle = atoi(argv[i]);
argNeeded = minor_version;
@@ -220,7 +220,7 @@ parse(bool &systemModified, bool &appModified, arg_needed
&argNeeded,
if (isalpha(argv[i][0]))
errorOut(e_minor_version);
- version.minor = atoi(argv[i]);
+ version.minor = atoi(argv[i]);
if (i >= argc-1) {
argNeeded = switch_needed;
@@ -251,7 +251,7 @@ parse(bool &systemModified, bool &appModified, arg_needed
&argNeeded,
if (isalpha(argv[i][0]))
errorOut(e_expecting);
- version.internal = atoi(argv[i]);
+ version.internal = atoi(argv[i]);
argNeeded = switch_needed;
break;
@@ -304,9 +304,9 @@ main(int argc, char *argv[])
{
if (argc < 3) {
if (argc < 2)
- return errorOut(e_app_sys_switch);
+ errorOut(e_app_sys_switch);
- return errorOut(e_specify_version);
+ errorOut(e_specify_version);
}
// reset version infos
@@ -355,10 +355,10 @@ main(int argc, char *argv[])
}
if (systemModified) {
- status = info.SetVersionInfo(&systemVersion,
B_SYSTEM_VERSION_KIND);
+ status = info.SetVersionInfo(&systemVersion,
B_SYSTEM_VERSION_KIND);
if (status < B_OK)
errorOut(status, NULL, false);
- }
+ }
return 0;
}
############################################################################
Revision: hrev52025
Commit: 9b326aa28754c521810b369b09ed3900cba041b6
URL: https://git.haiku-os.org/haiku/commit/?id=9b326aa28754
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Jun 19 03:20:18 2018 UTC
mail: Store mode flags by-value, not by-reference.
They are passed into the constructor by-value, and Clang warns that
we are taking the reference of a temporary.
----------------------------------------------------------------------------
diff --git a/src/servers/mail/DefaultNotifier.h
b/src/servers/mail/DefaultNotifier.h
index 5c2ada5d90..55c157acbe 100644
--- a/src/servers/mail/DefaultNotifier.h
+++ b/src/servers/mail/DefaultNotifier.h
@@ -42,7 +42,7 @@ private:
bool fIsInbound;
ErrorLogWindow* fErrorWindow;
BNotification fNotification;
- uint32& fShowMode;
+ uint32 fShowMode;
uint32 fTotalItems;
uint32 fItemsDone;